Versions in this module Expand all Collapse all v0 v0.1.1 Apr 2, 2020 v0.1.0 Apr 2, 2020 Changes in this version + func Base64To256BitKey(ks string) (*[32]byte, error) + func GUID() string + func GetEnvironment() map[string]string + func GetMonitoringLabels() map[string]string + func GetPortNumber(address string) (int, error) + func LogError(err error, msg string) + func LogErrorf(err error, msg string, v ...interface{}) + func LogFatal(err error, msg string) + func LogFatalf(err error, msg string, v ...interface{}) + func To256BitKey(key []byte) (*[32]byte, error) + func UpdateBaseDirectory(cfg ConfigView, baseDir string) + func UpdateServerDefaults(cfg ConfigView, grpcAddress string, httpAddress string) + type Config struct + func EmptyConfig() *Config + func (c *Config) AllSettings() map[string]interface{} + func (c *Config) GetBool(k string) bool + func (c *Config) GetDuration(k string) time.Duration + func (c *Config) GetFloat64(k string) float64 + func (c *Config) GetInt(k string) int + func (c *Config) GetString(k string) string + func (c *Config) Set(k string, v interface{}) + func (c *Config) SetDefault(k string, v interface{}) + type ConfigView interface + GetBool func(string) bool + GetDuration func(string) time.Duration + GetFloat64 func(string) float64 + GetInt func(string) int + GetString func(string) string + func DefaultConfig() ConfigView + func MustLoadConfig() ConfigView + type Counter struct + func NewCounter() *Counter + func (c *Counter) Get() int64 + func (c *Counter) Inc() int64 + func (c *Counter) IncBy(by int64) int64 + type Crypter interface + Decrypt func(cipherText []byte) ([]byte, error) + Encrypt func(plainText []byte) ([]byte, error) + func MustCrypter(base64EncryptionKey string) Crypter + func NewAES256Crypter(key *[32]byte) Crypter + func NewCrypter(base64EncryptionKey string) (Crypter, error) + func NewNullEncrypter() Crypter + type ListenSpec struct + Address string + Port int + Protocol string + func OpenWithAddress(protocol string, address string) (*ListenSpec, error) + func (ls *ListenSpec) Acquire() net.Listener + func (ls *ListenSpec) Close() error + func (ls *ListenSpec) IsOpen() bool + type Pubsub struct + func NewPubsub() *Pubsub + func (p *Pubsub) Publish(topic string, msg interface{}) + func (p *Pubsub) Subscribe(topic string) (chan interface{}, func()) + type Stopwatch struct + func NewStopwatch() *Stopwatch + func NewStopwatchAt(start time.Time) *Stopwatch + func (s *Stopwatch) TickMillis() int64 + func (s *Stopwatch) TickNanos() int64 + type Switch struct + func NewSwitch(name string) *Switch + func (s *Switch) Get() bool + func (s *Switch) Off() + func (s *Switch) On() + func (s *Switch) OnIfOff() bool + func (s *Switch) Toggle() bool + type ThrottledCall struct + func NewThrottledCall(name string, delay time.Duration) *ThrottledCall + func (tc *ThrottledCall) Close() + func (tc *ThrottledCall) Invoke(f func()) + type UnitOfWork func() + type WorkQueue interface + Drain func() + Enqueue func(f UnitOfWork) error + func NewWorkQueue() WorkQueue + func NewWorkQueueWithSize(size int) WorkQueue