Documentation ¶
Index ¶
- func AbsPathify(inPath string) string
- func BoolToInt(v bool) int
- func BuildMapFromString(mappingStr string) (map[string]string, error)
- func BytesToInt64(v []byte) int64
- func BytesToUint32(v []byte) uint32
- func DiscoverMetaGraph(val []byte) (string, string)
- func DoubleSha256(b []byte) []byte
- func Float64ToString(v float64) string
- func Int64ToBytes(v int64) []byte
- func Int64ToString(v int64) string
- func IntToBool(v int) bool
- func IntToString(v int) string
- func MarshalToType(val any, dest any, allowUnknownFields bool) error
- func RandomID(size int) (string, error)
- func StringToFloat64(v string) float64
- func StringToInt(v string) int
- func StringToInt64(v string) int64
- func StringToTime(v string) time.Time
- func SubstituteEntities(template []byte, entityMap map[string]string, nowTimestamp *time.Time) ([]byte, error)
- func TimeToString(t time.Time) string
- func Uint32ToBytes(v uint32) []byte
- func UserHomeDir() string
- type BoltClient
- func (bc *BoltClient) Close() error
- func (bc *BoltClient) FetchBytes(bucket, key string) ([]byte, error)
- func (bc *BoltClient) FetchInt(bucket, key string) (int, error)
- func (bc *BoltClient) FetchString(bucket, key string) (string, error)
- func (bc *BoltClient) Update(bucket, key string, value []byte) error
- func (bc *BoltClient) UpdateInline(tx *bbolt.Tx, bucket, key string, value []byte) error
- func (bc *BoltClient) UpdateInt64(bucket, key string, value int64) error
- type GracefulWarden
- type InstallSchemaFunc
- type ZerologQueryTracer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AbsPathify ¶
AbsPathify turns relative path into absolute by expanding all environment variables and analysing the current working directory
func BytesToInt64 ¶
func BytesToUint32 ¶
func DiscoverMetaGraph ¶
func DoubleSha256 ¶
DoubleSha256 calculates sha256(sha256(b)) and returns the resulting bytes.
func Float64ToString ¶
func Int64ToBytes ¶
func Int64ToString ¶
func IntToString ¶
func StringToFloat64 ¶
func StringToInt ¶
func StringToInt64 ¶
func StringToTime ¶
func SubstituteEntities ¶
func TimeToString ¶
func Uint32ToBytes ¶
func UserHomeDir ¶
func UserHomeDir() string
Types ¶
type BoltClient ¶
func NewBoltClient ¶
func NewBoltClient(boltDBFile string, installSchemaFunc InstallSchemaFunc) (*BoltClient, error)
func (*BoltClient) Close ¶
func (bc *BoltClient) Close() error
func (*BoltClient) FetchBytes ¶
func (bc *BoltClient) FetchBytes(bucket, key string) ([]byte, error)
func (*BoltClient) FetchString ¶
func (bc *BoltClient) FetchString(bucket, key string) (string, error)
func (*BoltClient) UpdateInline ¶
func (*BoltClient) UpdateInt64 ¶
func (bc *BoltClient) UpdateInt64(bucket, key string, value int64) error
type GracefulWarden ¶
type GracefulWarden struct {
// contains filtered or unexported fields
}
GracefulWarden listens for system signals and invokes Close() methods to all 'subscribed' io.Closers (use CloseOnShutdown method to subscribe a closer)
func NewGracefulWarden ¶
func NewGracefulWarden(patienceTimeout int64) *GracefulWarden
Create a warden. Only one copy of GracefulWarden can be present in the system.
func (*GracefulWarden) CloseOnShutdown ¶
func (gw *GracefulWarden) CloseOnShutdown(closer io.Closer)
Given Closer will have Close() method invoked when the server process receives some system signals (see implementation below for full list)
type InstallSchemaFunc ¶
type InstallSchemaFunc func(bc *BoltClient) error
type ZerologQueryTracer ¶ added in v1.2.0
ZerologQueryTracer implements pgx.QueryTracer and logs query details using Zerolog logger.
func NewZerologQueryTracer ¶ added in v1.2.0
func NewZerologQueryTracer(lvl zerolog.Level) *ZerologQueryTracer
func (*ZerologQueryTracer) TraceQueryEnd ¶ added in v1.2.0
func (tl *ZerologQueryTracer) TraceQueryEnd(ctx context.Context, conn *pgx.Conn, data pgx.TraceQueryEndData)
func (*ZerologQueryTracer) TraceQueryStart ¶ added in v1.2.0
func (tl *ZerologQueryTracer) TraceQueryStart(ctx context.Context, conn *pgx.Conn, data pgx.TraceQueryStartData) context.Context