utils

package
v0.24.19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const HTTPReqTimeout = 1 * time.Minute

Variables

View Source
var Salt = "this is only example"
View Source
var Settings = &Hub{}
View Source
var Version = "0.10"

Functions

func DisposeNonce

func DisposeNonce(n uint64)

DisposeNonce frees the nonce value for others to use.

func IndyBaseDir

func IndyBaseDir() string

func NewNonce

func NewNonce() uint64

NewNonce generates new uint64 nonce with Go's crypto package

func NewNonceStr

func NewNonceStr() string

NewNonceStr generates new nonce with Go's crypto package, and returns value as string.

func NewReg

func NewReg(data []byte) (r *regMapType)

func NonceNum

func NonceNum(s string) uint64

func NonceToStr

func NonceToStr(n uint64) string

func ParseNonce

func ParseNonce(ns string) uint64

func ReserveNonce

func ReserveNonce(n uint64) uint64

func UUID

func UUID() string

UUID generates new nonce with Go's crypto package, and returns value as string.

Types

type Hub

type Hub struct {
	// contains filtered or unexported fields
}

func (*Hub) CertFileForAPNS

func (h *Hub) CertFileForAPNS() string

func (*Hub) ExportPath

func (h *Hub) ExportPath() string

func (*Hub) GRPCAdmin

func (h *Hub) GRPCAdmin() string

func (*Hub) HostAddr

func (h *Hub) HostAddr() string

func (*Hub) LocalTestMode

func (h *Hub) LocalTestMode() bool

func (*Hub) RegisterBackupInterval

func (h *Hub) RegisterBackupInterval() time.Duration

func (*Hub) RegisterBackupName

func (h *Hub) RegisterBackupName() string

func (*Hub) RegisterName

func (h *Hub) RegisterName() string

func (*Hub) ServiceName

func (h *Hub) ServiceName() string

func (*Hub) ServiceName2

func (h *Hub) ServiceName2() string

ServiceName2 returns service name to new worker EA based endpoints. This is something that will be refactored later.

func (*Hub) SetCertFileForAPNS

func (h *Hub) SetCertFileForAPNS(certFileForAPNS string)

func (*Hub) SetExportPath

func (h *Hub) SetExportPath(exportPath string)

SetExportPath sets path for wallet exports.

func (*Hub) SetGRPCAdmin

func (h *Hub) SetGRPCAdmin(gRPCAdmin string)

func (*Hub) SetHostAddr

func (h *Hub) SetHostAddr(ipName string)

SetHostAddr sets current host name of this service agency. The host name is used in the URLs and endpoints.

func (*Hub) SetLocalTestMode

func (h *Hub) SetLocalTestMode(localTestMode bool)

func (*Hub) SetRegisterBackupInterval

func (h *Hub) SetRegisterBackupInterval(interval time.Duration)

func (*Hub) SetRegisterBackupName

func (h *Hub) SetRegisterBackupName(name string)

func (*Hub) SetRegisterName

func (h *Hub) SetRegisterName(registerName string)

func (*Hub) SetServiceName

func (h *Hub) SetServiceName(n string)

SetServiceName sets the service name of this agency. Service name is used in the URLs and endpoint addresses.

func (*Hub) SetServiceName2

func (h *Hub) SetServiceName2(n string)

func (*Hub) SetTimeout

func (h *Hub) SetTimeout(to time.Duration)

SetTimeout sets the default timeout for HTTP and WS requests.

func (*Hub) SetVersionInfo

func (h *Hub) SetVersionInfo(info string)

SetVersionInfo sets current version info of this agency. The info is shown in the certain API calls like Ping.

func (*Hub) SetWalletBackupPath

func (h *Hub) SetWalletBackupPath(path string)

func (*Hub) SetWalletBackupTime

func (h *Hub) SetWalletBackupTime(t string)

func (*Hub) SetWsName

func (h *Hub) SetWsName(n string)

SetWsName sets web socket service name. It's in the different URL than HTTP.

func (*Hub) Timeout

func (h *Hub) Timeout() time.Duration

func (*Hub) VersionInfo

func (h *Hub) VersionInfo() string

func (*Hub) WalletBackupPath

func (h *Hub) WalletBackupPath() string

func (*Hub) WalletBackupTime

func (h *Hub) WalletBackupTime() string

func (*Hub) WalletExportPath

func (h *Hub) WalletExportPath(filename string) (exportPath, url string)

func (*Hub) WebOnboardWalletKey

func (h *Hub) WebOnboardWalletKey() string

WebOnboardWalletKey returns wallet key for web boarding wallet

func (*Hub) WebOnboardWalletName

func (h *Hub) WebOnboardWalletName() string

WebOnboardWalletName returns wallet name for web boarding wallet

func (*Hub) WsServiceName

func (h *Hub) WsServiceName() string

type Reg

type Reg struct {
	// contains filtered or unexported fields
}

func (*Reg) Add

func (r *Reg) Add(key keyDID, value ...string)

func (*Reg) EnumValues

func (r *Reg) EnumValues(handler func(k keyDID, v []string) bool)

func (*Reg) Exist

func (r *Reg) Exist(key keyDID) bool

func (*Reg) Load

func (r *Reg) Load(filename string) error

func (*Reg) Reset

func (r *Reg) Reset(filename string) (err error)

func (*Reg) Save

func (r *Reg) Save(filename string) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL