datastruct

package
v0.0.0-...-452f74e Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2022 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoConf

type MongoConf struct {
	Host     string `yaml:"host" json:"host"`
	Port     int    `yaml:"port" json:"port"`
	Username string `yaml:"username" json:"username"`
	Password string `yaml:"password" json:"password"`
}

type MultiError

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

MultiError multiple errors, its useful in single error can not represent complex error all it's methods is gorountine safe. ref https://github.com/prometheus/alertmanager/blob/master/types/types.go#L268

func (*MultiError) Add

func (e *MultiError) Add(err error)

func (*MultiError) AddStrError

func (e *MultiError) AddStrError(err string)

AddStrError add string error

func (*MultiError) Errors

func (e *MultiError) Errors() []error

Errors get a errors copy

func (*MultiError) Len

func (e *MultiError) Len() int

func (*MultiError) String

func (e *MultiError) String(delimiter string) string

type MySQLConf

type MySQLConf struct {
	Addr     string `yaml:"addr" json:"addr"`
	Database string `yaml:"database" json:"database"`
	Username string `yaml:"username" json:"username"`
	Password string `yaml:"password" json:"password"`
}

type Pair

type Pair struct {
	Key string `json:"key"`
	Val string `json:"val"`
}

Pair a string key/value pair

type Pairs

type Pairs []Pair

func NewPairsFromMap

func NewPairsFromMap(m map[string]string) Pairs

NewPairsFromMap map {key, value} to Pairs (keep sequence stable)

func (Pairs) ToString

func (pairs Pairs) ToString(kvSep, pSep string) string

ToString Pair to a string, "kvSep" for key/value delimiter; "pSep" for Pair delimiter if "kvSep" is "", default set "=" if "pSep" is "", default set ", "

type RedisConf

type RedisConf struct {
	Addr     string `yaml:"addr" json:"addr"`
	Password string `yaml:"password" json:"password"`
	DB       int    `yaml:"db" json:"db"`
}

type SF64Pair

type SF64Pair struct {
	Key string  `json:"key" yaml:"key"`
	Val float64 `json:"val" yaml:"val"`
}

SF64Pair <string, float64> pair

type SIPair

type SIPair struct {
	Key string `json:"key" yaml:"key"`
	Val int    `json:"val" yaml:"val"`
}

SIPair <string, int> pair

type TimePair

type TimePair struct {
	StartTime time.Time `json:"start_time" yaml:"start_time"`
	EndTime   time.Time `json:"end_time" yaml:"end_time"`
}

TimePair time range

type WXMPConf

type WXMPConf struct {
	AppID  string `yaml:"appid"`
	Secret string `yaml:"secret"`
}

WXMPConf 微信小程序配置

Jump to

Keyboard shortcuts

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