Documentation ¶
Index ¶
- Constants
- Variables
- func Absolute(path string) (string, error)
- func AddRpcLogger(w io.Writer, id string)
- func ByteToString(p []byte) string
- func BytesToInt16(b []byte) int16
- func BytesToInt64(b []byte) int64
- func BytesToUInt32(b []byte) uint32
- func BytesToUInt64(b []byte) uint64
- func BytesToUint16(b []byte) uint16
- func CalcCRC32(data []byte) uint32
- func CalcCRC32OfSlices(data [][]byte) uint32
- func CalcFileCRC32(filePath string) uint32
- func CalcFileHash(filePath, encryptionTag string, codec byte) string
- func CalcFileHashFromSlices(files []string, encryptionTag string) string
- func CalcFileKeccak(filePath string) mh.Multihash
- func CalcFileMD5(filePath string) []byte
- func CalcHash(data []byte) string
- func CalcHashBytes(data []byte) []byte
- func CalcKeccakOfSplitFiles(files []string) []byte
- func CalcMD5OfSplitFiles(filePath []string) []byte
- func CalcSliceHash(data []byte, fileHash string, sliceNumber uint64) string
- func Camel2Snake(s string) string
- func ChangePassword(walletAddress, dir, auth string, key *AccountKey) error
- func CheckError(err error) bool
- func ClearExpiredShareLinksWalletSignMessage(walletAddr string, timestamp int64) string
- func ConvertCoronaryUtf8(in string) string
- func Crc32IEEE(data []byte) uint32
- func CreateP2PKey(dir, nickname, password, hrp string) (types.Address, error)
- func CreateWallet(dir, nickname, password, hrp, mnemonic, bip39Passphrase, hdPath string) (types.Address, error)
- func DebugLog(v ...interface{})
- func DebugLogf(template string, v ...interface{})
- func DebugLogfWithCalldepth(calldepth int, template string, v ...interface{})
- func DeleteFileWalletSignMessage(fileHash, walletAddr string, timestamp int64) string
- func DeleteShareWalletSignMessage(shareId, walletAddr string, timestamp int64) string
- func DetailLog(v ...interface{})
- func DetailLogf(template string, v ...interface{})
- func DisableRpcLogger(id string)
- func DumpTraffic(v ...interface{})
- func ECCSign(text []byte, prk *ecdsa.PrivateKey) ([]byte, error)
- func ECCSignBytes(text, privateKey []byte) ([]byte, error)
- func ECCVerify(text []byte, signature []byte, key *ecdsa.PublicKey) bool
- func ECCVerifyBytes(text, signature, publicKey []byte) bool
- func EncryptKey(key *AccountKey, auth string) ([]byte, error)
- func ErrorLog(v ...interface{})
- func ErrorLogf(template string, v ...interface{})
- func FatalLogfAndExit(exitCode int, template string, v ...interface{})
- func FindMyFileListWalletSignMessage(walletAddr string, timestamp int64) string
- func FormatError(err error) string
- func GenerateRandomNumber(start int, end int, count int) []int
- func Get16MD5(data string) string
- func Get8BitUUID() string
- func GetCodecFromFileHash(hash string) (uint64, error)
- func GetDiskUsage(path string) (*disk.UsageStat, error)
- func GetFileDownloadWalletSignMessage(fileHash, walletAddr, sn string, timestamp int64) string
- func GetFileReplicaInfoWalletSignMessage(fileHash, walletAddr string, timestamp int64) string
- func GetFileStatusWalletSignMessage(fileHash, walletAddr string, timestamp int64) string
- func GetFileUploadWalletSignMessage(fileHash, walletAddr, sn string, timestamp int64) string
- func GetLastLinesFromTrafficLog(path string, n uint64) []string
- func GetMD5(data string) string
- func GetNoticeFileSliceBackupSpNodeSignMessage(reqMsg *protos.NoticeFileSliceBackup) ([]byte, error)
- func GetRandomString(length int) string
- func GetRspBackupFileSpNodeSignMessage(rspMsg *protos.RspBackupStatus) ([]byte, error)
- func GetRspFileStorageInfoNodeSignMessage(rspMsg *protos.RspFileStorageInfo) ([]byte, error)
- func GetRspUploadFileSpNodeSignMessage(rspMsg *protos.RspUploadFile) ([]byte, error)
- func GetSPListWalletSignMessage(walletAddr string, timestamp int64) string
- func GetSequenceNumberString(number uint64) string
- func GetShareFileWalletSignMessage(shareId, walletAddr string, timestamp int64) string
- func ImageCommpress(pathStr string) (string, error)
- func InitBufferPool(bufferSize, poolSize int)
- func InitIdWorker(nodeid uint8) error
- func Int16ToBytes(n int16) []byte
- func Int64ToByte(n int64) []byte
- func IntToString(i int) string
- func IsPoolFull() bool
- func IsVideoStream(hash string) bool
- func LcFirst(str string) string
- func LoadTomlConfig(s interface{}, path string) error
- func LoadYamlConfig(s interface{}, path string) error
- func Log(v ...interface{})
- func Logf(template string, v ...interface{})
- func MergeByte(b ...[]byte) []byte
- func MergeBytes(a, b []byte) []byte
- func NewMnemonic() (string, error)
- func NextSnowFlakeId() (int64, error)
- func ParseTomlValue(data string) (interface{}, error)
- func PrepayWalletSignMessage(walletAddr string, timestamp int64) string
- func RegisterNewPPWalletSignMessage(walletAddr string, timestamp int64) string
- func RegisterReqToLogger(reqId int64, terminalId string) bool
- func RegisterReqToParentReq(reqId, parentId int64) bool
- func RegisterWalletSignMessage(walletAddr string, timestamp int64) string
- func ReleaseBuffer(buffer []byte)
- func RequestBuffer() []byte
- func SetupWallet(accountDir, defaultHDPath string, ...) error
- func ShareFileWalletSignMessage(fileHash, walletAddr string, timestamp int64) string
- func ShareLinkWalletSignMessage(walletAddr string, timestamp int64) string
- func Snake2Camel(s string) string
- func SplitHostPort(addr string) (net.IP, string, error)
- func StrInSlices(slices []string, key string) bool
- func StringToInt(s string) (int, error)
- func Struct2Map(obj interface{}) map[string]interface{}
- func UcFirst(str string) string
- func Uint16ToBytes(n uint16) []byte
- func Uint32ToBytes(n uint32) []byte
- func Uint64ToBytes(n uint64) []byte
- func Uint8ToBytes(n uint8) []byte
- func ValidateHash(hash string) bool
- func WarnLog(v ...interface{})
- func WriteKeyFile(file string, content []byte) error
- func WriteTomlConfig(data interface{}, filePath string) error
- func ZeroId() int64
- type AccountKey
- type Action
- type AtomicInt32
- func (a *AtomicInt32) AddAndGetNew(delta int32) int32
- func (a *AtomicInt32) CompareAndSet(expect, update int32) bool
- func (a *AtomicInt32) DecrementAndGetNew() int32
- func (a *AtomicInt32) GetAndSetAtomic(newValue int32) int32
- func (a *AtomicInt32) GetAtomic() int32
- func (a *AtomicInt32) GetOldAndAdd(delta int32) int32
- func (a *AtomicInt32) GetOldAndDecrement() int32
- func (a *AtomicInt32) GetOldAndIncrement() int32
- func (a *AtomicInt32) IncrementAndGetNew() int32
- func (a *AtomicInt32) SetAtomic(newValue int32)
- func (a *AtomicInt32) String() string
- type AtomicInt64
- func (a *AtomicInt64) AddAndGetNew(delta int64) int64
- func (a *AtomicInt64) CompareAndSet(expect, update int64) bool
- func (a *AtomicInt64) DecrementAndGetNew() int64
- func (a *AtomicInt64) GetAndSetAtomic(newValue int64) int64
- func (a *AtomicInt64) GetAtomic() int64
- func (a *AtomicInt64) GetNewAndSetAtomic(newValue int64) int64
- func (a *AtomicInt64) GetOldAndAdd(delta int64) int64
- func (a *AtomicInt64) GetOldAndDecrement() int64
- func (a *AtomicInt64) GetOldAndIncrement() int64
- func (a *AtomicInt64) IncrementAndGetNew() int64
- func (a *AtomicInt64) SetAtomic(newValue int64)
- func (a *AtomicInt64) String() string
- type AutoCleanMap
- type AutoCleanUnsafeMap
- type CombinedLogger
- func (l *CombinedLogger) ErrorLog(v ...interface{})
- func (l *CombinedLogger) Log(level LogLevel, v ...interface{})
- func (l *CombinedLogger) LogDepth(level LogLevel, calldepth int, v ...interface{})
- func (l *CombinedLogger) SetEnablefile(b bool)
- func (l *CombinedLogger) SetEnablestd(b bool)
- func (l *CombinedLogger) SetLogLevel(lv LogLevel)
- type ErrUndefined
- type Event
- type Fsm
- type IdWorker
- type KeyStorePassphrase
- type LimitRate
- type LogLevel
- type LogMsg
- type Logger
- type MyUnsafeValue
- type MyValue
- type State
- type SysInfo
- type TransitionItem
- type Url
Constants ¶
const ( DefTaskPoolCount = 200 TaskSize = 1024 ReadTimeOut = 360 // in seconds WriteTimeOut = 360 // in seconds HandshakeTimeOut = 5 // in seconds MessageBeatLen = 4 * 1024 * 1024 // in bytes LatencyCheckSpListInterval = 24 * 3600 // in seconds LatencyCheckSpListTimeout = 3 // in seconds LatencyCheckTopSpsConsidered = 3 // number of SPs PpMinTier = 0 PpMaxTier = 3 )
const ( VIDEO_CODEC = 0x72 // VIDEO_CODEC is separate from SDS_CODEC in order to identify the videos SDS_CODEC = 0x66 // codec of legacy file hash is cid.RAW. New file hash uses SDS_CODEC. VALID_CID_VERSION = 1 VALID_MH_TYPE = 27 VALID_MH_LENGTH = 20 )
const ( SIZE_OF_INT8 = 1 SIZE_OF_UINT8 = 1 SIZE_OF_INT16 = 2 // in byte SIZE_OF_UINT16 = 2 // in byte SIZE_OF_INT32 = 4 // in byte SIZE_OF_UINT32 = 4 // in byte SIZE_OF_INT64 = 8 // in byte SIZE_OF_UINT64 = 8 // in byte )
const (
BufferPoolRefillInterval = 3 // in second
)
const (
NodeIdBits = uint(8) // node id bits size
)
Variables ¶
Functions ¶
func AddRpcLogger ¶ added in v0.10.1
func ByteToString ¶
func BytesToInt16 ¶
func BytesToInt64 ¶ added in v0.9.0
func BytesToUInt32 ¶
func BytesToUInt64 ¶ added in v0.5.0
func BytesToUint16 ¶
func CalcCRC32OfSlices ¶ added in v0.10.1
func CalcFileCRC32 ¶
func CalcFileHash ¶
func CalcFileHashFromSlices ¶ added in v0.10.1
func CalcFileKeccak ¶ added in v0.10.1
func CalcFileMD5 ¶
func CalcHashBytes ¶ added in v0.10.0
func CalcKeccakOfSplitFiles ¶ added in v0.10.1
func CalcMD5OfSplitFiles ¶ added in v0.10.1
func ChangePassword ¶
func ChangePassword(walletAddress, dir, auth string, key *AccountKey) error
ChangePassword
func CheckError ¶
CheckError TODO This is a bad way to call error log, as you cannot know where this method is called in your error log This give log line like this : [ERROR]2021/04/13 22:39:11 log.go:150: Fatal error: address 127.0.0.1: missing port in address it always refer to this file and this line If time allows, a better logging tool like "zerolog" can be used to replace these methods.
func ClearExpiredShareLinksWalletSignMessage ¶ added in v0.10.0
func CreateP2PKey ¶
CreateP2PKey creates a P2P key to be used by one of the SDS nodes, and saves the key data into the dir folder
func CreateWallet ¶
func CreateWallet(dir, nickname, password, hrp, mnemonic, bip39Passphrase, hdPath string) (types.Address, error)
CreateWallet creates a new stratos-chain wallet with the given nickname and password, and saves the key data into the dir folder
func DebugLogf ¶
func DebugLogf(template string, v ...interface{})
DebugLog calls default logger and output debug log
func DebugLogfWithCalldepth ¶ added in v0.9.0
DebugLog calls default logger and output debug log
func DeleteFileWalletSignMessage ¶ added in v0.10.0
func DeleteShareWalletSignMessage ¶ added in v0.10.0
func DetailLog ¶ added in v0.7.0
func DetailLog(v ...interface{})
DetailLog calls default logger and output detail log
func DetailLogf ¶ added in v0.7.0
func DetailLogf(template string, v ...interface{})
DetailLog calls default logger and output detail log
func DisableRpcLogger ¶ added in v0.10.1
func DisableRpcLogger(id string)
func DumpTraffic ¶ added in v0.5.0
func DumpTraffic(v ...interface{})
DumpTraffic Log calls default logger and output info log
func ECCSign ¶
func ECCSign(text []byte, prk *ecdsa.PrivateKey) ([]byte, error)
ECCSign signs the given text
func ECCSignBytes ¶
ECCSignBytes converts the private key bytes to an ecdsa.PrivateKey and then signs the given text
func ECCVerifyBytes ¶
ECCVerifyBytes converts the public key bytes to an ecdsa.PublicKey and then verifies the given signature
func EncryptKey ¶
func EncryptKey(key *AccountKey, auth string) ([]byte, error)
EncryptKey encrypts a key using the specified scrypt parameters into a json blob that can be decrypted later on.
func ErrorLogf ¶
func ErrorLogf(template string, v ...interface{})
ErrorLogf call default logger and output error log
func FatalLogfAndExit ¶ added in v0.9.0
func FindMyFileListWalletSignMessage ¶ added in v0.10.0
func FormatError ¶ added in v0.9.0
func GenerateRandomNumber ¶
GenerateRandomNumber generate (count) random numbers between (start) to (end).
func GetCodecFromFileHash ¶ added in v0.10.0
func GetFileDownloadWalletSignMessage ¶ added in v0.9.0
GetFileDownloadWalletSignMessage download: wallet sign message for download request from the (rpc or cmd) user
func GetFileReplicaInfoWalletSignMessage ¶ added in v0.10.0
GetFileReplicaInfoWalletSignMessage replica info: wallet sign message for get file replica info request from the (rpc or cmd) user
func GetFileStatusWalletSignMessage ¶ added in v0.10.0
func GetFileUploadWalletSignMessage ¶ added in v0.9.0
GetFileUploadWalletSignMessage upload: wallet sign message for file upload request from the (rpc or cmd) user
func GetLastLinesFromTrafficLog ¶ added in v0.9.0
func GetNoticeFileSliceBackupSpNodeSignMessage ¶ added in v0.10.0
func GetNoticeFileSliceBackupSpNodeSignMessage(reqMsg *protos.NoticeFileSliceBackup) ([]byte, error)
func GetRspBackupFileSpNodeSignMessage ¶ added in v0.10.0
func GetRspBackupFileSpNodeSignMessage(rspMsg *protos.RspBackupStatus) ([]byte, error)
func GetRspFileStorageInfoNodeSignMessage ¶ added in v0.9.0
func GetRspFileStorageInfoNodeSignMessage(rspMsg *protos.RspFileStorageInfo) ([]byte, error)
GetRspFileStorageInfoNodeSignMessage download: node sign message for download file response, between sp and downloader pp
func GetRspUploadFileSpNodeSignMessage ¶ added in v0.9.0
func GetRspUploadFileSpNodeSignMessage(rspMsg *protos.RspUploadFile) ([]byte, error)
GetRspUploadFileSpNodeSignMessage upload: node sign message for upload file response, between sp and uploader pp, the dest pp verify this too
func GetSPListWalletSignMessage ¶ added in v0.10.0
func GetSequenceNumberString ¶ added in v0.10.0
func GetShareFileWalletSignMessage ¶ added in v0.10.0
func ImageCommpress ¶
func InitBufferPool ¶ added in v0.10.1
func InitBufferPool(bufferSize, poolSize int)
func InitIdWorker ¶ added in v0.7.0
func Int16ToBytes ¶
func Int64ToByte ¶
func IntToString ¶
func IsPoolFull ¶ added in v0.10.1
func IsPoolFull() bool
func IsVideoStream ¶ added in v0.10.0
func LoadTomlConfig ¶ added in v0.8.0
func LoadYamlConfig ¶
func MergeBytes ¶
func NewMnemonic ¶
func NextSnowFlakeId ¶ added in v0.9.0
func ParseTomlValue ¶ added in v0.10.0
func PrepayWalletSignMessage ¶ added in v0.10.0
func RegisterNewPPWalletSignMessage ¶ added in v0.10.0
func RegisterReqToLogger ¶ added in v0.10.1
func RegisterReqToParentReq ¶ added in v0.10.1
func RegisterWalletSignMessage ¶ added in v0.10.0
func ReleaseBuffer ¶ added in v0.10.1
func ReleaseBuffer(buffer []byte)
func RequestBuffer ¶ added in v0.10.1
func RequestBuffer() []byte
func SetupWallet ¶ added in v0.9.0
func ShareFileWalletSignMessage ¶ added in v0.10.0
func ShareLinkWalletSignMessage ¶ added in v0.10.0
func StringToInt ¶
func Struct2Map ¶
func Struct2Map(obj interface{}) map[string]interface{}
func Uint16ToBytes ¶
func Uint32ToBytes ¶
func Uint64ToBytes ¶ added in v0.5.0
func Uint8ToBytes ¶ added in v0.10.0
func ValidateHash ¶ added in v0.10.1
ValidateHash only validate the hash format, does NOT verify if the hash is created by certain content
func WriteKeyFile ¶
func WriteTomlConfig ¶ added in v0.8.0
Types ¶
type AccountKey ¶
type AccountKey struct { Id uuid.UUID // Version 4 "random" for unique id not derived from key data // to simplify lookups we also store the address Address types.Address // The HD path to use to derive this key HdPath string // The mnemonic for the underlying HD wallet Mnemonic string // a nickname Name string // The bip39 passphrase for the underlying HD wallet Passphrase string // we only store privkey as pubkey/address can be derived from it // privkey in this struct is always in plaintext PrivateKey []byte }
func DecryptKey ¶
func DecryptKey(keyjson []byte, auth string) (*AccountKey, error)
DecryptKey decrypts a key from a json blob, returning the private key itself.
type AtomicInt32 ¶
type AtomicInt32 int32
AtomicInt32
func (*AtomicInt32) AddAndGetNew ¶
func (a *AtomicInt32) AddAndGetNew(delta int32) int32
AddAndGetNew
func (*AtomicInt32) CompareAndSet ¶
func (a *AtomicInt32) CompareAndSet(expect, update int32) bool
CompareAndSet
func (*AtomicInt32) DecrementAndGetNew ¶
func (a *AtomicInt32) DecrementAndGetNew() int32
DecrementAndGetNew
func (*AtomicInt32) GetAndSetAtomic ¶
func (a *AtomicInt32) GetAndSetAtomic(newValue int32) int32
GetAndSetAtomic
func (*AtomicInt32) GetOldAndAdd ¶
func (a *AtomicInt32) GetOldAndAdd(delta int32) int32
GetOldAndAdd
func (*AtomicInt32) GetOldAndDecrement ¶
func (a *AtomicInt32) GetOldAndDecrement() int32
GetOldAndDecrement
func (*AtomicInt32) GetOldAndIncrement ¶
func (a *AtomicInt32) GetOldAndIncrement() int32
GetOldAndIncrement
func (*AtomicInt32) IncrementAndGetNew ¶
func (a *AtomicInt32) IncrementAndGetNew() int32
IncrementAndGetNew
func (*AtomicInt32) String ¶
func (a *AtomicInt32) String() string
type AtomicInt64 ¶
type AtomicInt64 int64
AtomicInt64
func CreateAtomicInt64 ¶
func CreateAtomicInt64(initialValue int64) *AtomicInt64
CreateAtomicInt64 with initial value
func (*AtomicInt64) AddAndGetNew ¶
func (a *AtomicInt64) AddAndGetNew(delta int64) int64
AddAndGetNew
func (*AtomicInt64) CompareAndSet ¶
func (a *AtomicInt64) CompareAndSet(expect, update int64) bool
CompareAndSet
func (*AtomicInt64) DecrementAndGetNew ¶
func (a *AtomicInt64) DecrementAndGetNew() int64
DecrementAndGetNew
func (*AtomicInt64) GetAndSetAtomic ¶
func (a *AtomicInt64) GetAndSetAtomic(newValue int64) int64
GetAndSetAtomic return current and set new
func (*AtomicInt64) GetNewAndSetAtomic ¶
func (a *AtomicInt64) GetNewAndSetAtomic(newValue int64) int64
GetNewAndSetAtomic set new and return new
func (*AtomicInt64) GetOldAndAdd ¶
func (a *AtomicInt64) GetOldAndAdd(delta int64) int64
GetOldAndAdd return current and add delta to atomic
func (*AtomicInt64) GetOldAndDecrement ¶
func (a *AtomicInt64) GetOldAndDecrement() int64
GetOldAndDecrement return current and minus 1 to atomic
func (*AtomicInt64) GetOldAndIncrement ¶
func (a *AtomicInt64) GetOldAndIncrement() int64
GetOldAndIncrement return current and add 1 to atomic
func (*AtomicInt64) IncrementAndGetNew ¶
func (a *AtomicInt64) IncrementAndGetNew() int64
IncrementAndGetNew
func (*AtomicInt64) String ¶
func (a *AtomicInt64) String() string
type AutoCleanMap ¶
type AutoCleanMap struct {
// contains filtered or unexported fields
}
func NewAutoCleanMap ¶
func NewAutoCleanMap(delay time.Duration) *AutoCleanMap
func (*AutoCleanMap) Delete ¶
func (m *AutoCleanMap) Delete(key interface{})
func (*AutoCleanMap) HashKey ¶ added in v0.8.0
func (m *AutoCleanMap) HashKey(key interface{}) bool
func (*AutoCleanMap) Load ¶
func (m *AutoCleanMap) Load(key interface{}) (interface{}, bool)
func (*AutoCleanMap) Store ¶
func (m *AutoCleanMap) Store(key, value interface{})
type AutoCleanUnsafeMap ¶ added in v0.9.0
type AutoCleanUnsafeMap struct {
// contains filtered or unexported fields
}
func NewAutoCleanUnsafeMap ¶ added in v0.9.0
func NewAutoCleanUnsafeMap(delay time.Duration) *AutoCleanUnsafeMap
func (*AutoCleanUnsafeMap) Delete ¶ added in v0.9.0
func (m *AutoCleanUnsafeMap) Delete(key interface{})
func (*AutoCleanUnsafeMap) HashKey ¶ added in v0.9.0
func (m *AutoCleanUnsafeMap) HashKey(key interface{}) bool
func (*AutoCleanUnsafeMap) Len ¶ added in v0.10.0
func (m *AutoCleanUnsafeMap) Len() int
func (*AutoCleanUnsafeMap) Load ¶ added in v0.9.0
func (m *AutoCleanUnsafeMap) Load(key interface{}) (interface{}, bool)
func (*AutoCleanUnsafeMap) Store ¶ added in v0.9.0
func (m *AutoCleanUnsafeMap) Store(key, value interface{})
type CombinedLogger ¶ added in v0.9.0
type CombinedLogger struct {
// contains filtered or unexported fields
}
var MyLogger *CombinedLogger
var TrafficLogger *CombinedLogger
func NewDefaultLogger ¶
func NewDefaultLogger(filepath string, enableStd, enableFile bool) *CombinedLogger
func NewLogger ¶
func NewLogger(filepath string, enableStd, enableFile bool) *CombinedLogger
func NewTrafficLogger ¶ added in v0.5.0
func NewTrafficLogger(filePath string, enableStd, enableFile bool) *CombinedLogger
func (*CombinedLogger) ErrorLog ¶ added in v0.9.0
func (l *CombinedLogger) ErrorLog(v ...interface{})
func (*CombinedLogger) Log ¶ added in v0.9.0
func (l *CombinedLogger) Log(level LogLevel, v ...interface{})
func (*CombinedLogger) LogDepth ¶ added in v0.9.0
func (l *CombinedLogger) LogDepth(level LogLevel, calldepth int, v ...interface{})
func (*CombinedLogger) SetEnablefile ¶ added in v0.9.0
func (l *CombinedLogger) SetEnablefile(b bool)
func (*CombinedLogger) SetEnablestd ¶ added in v0.9.0
func (l *CombinedLogger) SetEnablestd(b bool)
func (*CombinedLogger) SetLogLevel ¶ added in v0.9.0
func (l *CombinedLogger) SetLogLevel(lv LogLevel)
SetLogLevel
type ErrUndefined ¶
type ErrUndefined int32
ErrUndefined
func (ErrUndefined) Error ¶
func (e ErrUndefined) Error() string
type Fsm ¶ added in v0.10.0
type Fsm struct { StateTransTable [][]TransitionItem // contains filtered or unexported fields }
type IdWorker ¶
type IdWorker struct {
// contains filtered or unexported fields
}
var MyIdWorker *IdWorker
func NewIdWorker ¶
NewIdWorker new a snowflake id generator object.
type KeyStorePassphrase ¶
func GetKeyStorePassphrase ¶ added in v0.5.0
func GetKeyStorePassphrase(keysDirPath string) KeyStorePassphrase
func (KeyStorePassphrase) StoreKey ¶
func (ks KeyStorePassphrase) StoreKey(filename string, key *AccountKey, auth string) error
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func GetRpcLoggerByReqId ¶ added in v0.10.1
func GetRpcLoggerByTerminalId ¶ added in v0.10.1
func (*Logger) GetLevelString ¶ added in v0.9.0
GetLevelString
func (*Logger) SetEnabled ¶ added in v0.9.0
type MyUnsafeValue ¶ added in v0.9.0
type MyUnsafeValue struct {
// contains filtered or unexported fields
}
type SysInfo ¶
type SysInfo struct { DiskSize uint64 FreeDisk uint64 MemorySize uint64 OSInfo string CPUInfo string MacAddress string }
SysInfo
type TransitionItem ¶ added in v0.10.0
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
math
Package math provides integer math utilities.
|
Package math provides integer math utilities. |
rlp
Package rlp implements the RLP serialization format.
|
Package rlp implements the RLP serialization format. |
sha3
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.
|
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202. |