Documentation ¶
Index ¶
- Constants
- Variables
- func Base58ToPubKey(str string) (*ecdsa.PublicKey, error)
- func CancelGlobalCtx()
- func CheckWindowsMysqld() error
- func EthPriToLibP2pPri(pri *ecdsa.PrivateKey) (crypto.PrivKey, error)
- func EthSignHash(msg string) []byte
- func ExecCmd(name string, args ...string) error
- func FileExists(path string) bool
- func FormatEthSignMsg(msg string) string
- func GenerateRangeNum(min, max int64) int64
- func GetDB() *gorm.DB
- func GetGlobalCtx() context.Context
- func GetIpfsInfo(h string) ([]byte, error)
- func Hour2Unix(hour string) (time.Time, error)
- func InitSqliteDatabase(dir, name string) error
- func IsDir(path string) bool
- func IsLocalIp(ip string) bool
- func Json2Map(j string) map[string]interface{}
- func LibP2pPriToAddress(pri crypto.PrivKey) (common.Address, error)
- func LibP2pPriToEthPri(pri crypto.PrivKey) (*ecdsa.PrivateKey, error)
- func Md5(s string) string
- func PingMysql() error
- func PwdPlaintext2CipherText(pwd string, salt string) string
- func RandFloats(min, max float64, n int) float64
- func RandStringRunes(n int) string
- func ReloadIpfsGateway() error
- func RemoveDuplicationByMap(arr []string, before func(string2 *string)) []string
- func RunWindowsMysqld() error
- func SetMysqlDB(db *MysqlDb)
- func StrLen(str string) int
- func UploadIpfs(data interface{}) (string, error)
- func UploadIpfsReader(r *bytes.Reader) (string, error)
- type Context
- type MysqlDb
- type Pager
- type SqliteDB
Constants ¶
View Source
const ( IsYes = 1 IsNo = 0 DateTimeFormatStr = time.DateTime DateFormatStr = time.DateOnly TwitterProtocol = "/ethtweet/0.1" Version = "0.8.1" )
这个包放置公共常量
View Source
const ( DBDriveSqlite = "sqlite" DBDriveMysql = "mysql" )
View Source
const DefaultPageSize = 20
View Source
const SqliteDatabaseDefaultDir = "databases"
View Source
const SqliteDatabaseName = "EthTweet.0.2.db"
Variables ¶
View Source
var DbDrive = ""
View Source
var ErrCtxCancel = errors.New("ctx cancel")
View Source
var ErrTimeout = errors.New("timeout")
View Source
var ErrTweetNonceConflict = fmt.Errorf("tweet nonce conflict")
View Source
var ErrUserAskTimeout = fmt.Errorf("do ask timeout.....")
View Source
var ErrUserAskWriteAllFail = fmt.Errorf("do ask write all fail.....")
View Source
var ErrWaitUserSync = fmt.Errorf("Synchronizing user data, please wait...")
View Source
var (
IpfsApi string
)
Functions ¶
func CancelGlobalCtx ¶
func CancelGlobalCtx()
func CheckWindowsMysqld ¶
func CheckWindowsMysqld() error
func EthPriToLibP2pPri ¶
func EthPriToLibP2pPri(pri *ecdsa.PrivateKey) (crypto.PrivKey, error)
func EthSignHash ¶
func FileExists ¶
func FormatEthSignMsg ¶
func GenerateRangeNum ¶
func GetGlobalCtx ¶
func GetIpfsInfo ¶
func InitSqliteDatabase ¶
func LibP2pPriToEthPri ¶
func LibP2pPriToEthPri(pri crypto.PrivKey) (*ecdsa.PrivateKey, error)
func PwdPlaintext2CipherText ¶
func RandFloats ¶
func RandStringRunes ¶
func ReloadIpfsGateway ¶
func ReloadIpfsGateway() error
func RemoveDuplicationByMap ¶
func RunWindowsMysqld ¶
func RunWindowsMysqld() error
func SetMysqlDB ¶
func SetMysqlDB(db *MysqlDb)
func UploadIpfs ¶
Types ¶
type MysqlDb ¶
type MysqlDb struct { Host string Port string Database string Charset string UserName string Password string MaxIdleCounts int *gorm.DB }
func GetMysqlDB ¶
func GetMysqlDB() *MysqlDb
Click to show internal directories.
Click to hide internal directories.