Documentation ¶
Index ¶
- Variables
- func CopiedBytes(source []byte) (destination []byte)
- func Debug(format string, args ...interface{})
- func Debugln(args ...interface{})
- func ErrorIf(err error, msg string, data ...interface{})
- func FatalIf(err error, msg string, data ...interface{})
- func FileExists(path string) bool
- func Filter(xs []string, f func(string) bool) []string
- func GenerateRandomId() []byte
- func Keys(v interface{}) []string
- func Map(xs []string, f func(string) string) []string
- func MsgPackMarshal(v interface{}) ([]byte, error)
- func MsgPackUnMarshal(data []byte, v interface{}) error
- func SetupConfig()
- func StringInSlice(s string, ss []string) bool
- func SubString(str string, begin, length int) (substr string)
- func Ternary(IF bool, THEN interface{}, ELSE interface{}) interface{}
- func UnicodeIndex(str, substr string) int
- type Config
Constants ¶
This section is empty.
Variables ¶
View Source
var Logger *log.Logger
Functions ¶
func CopiedBytes ¶
func FatalIf ¶ added in v1.1.0
fatalIf wrapper function which takes error and prints error messages.
func FileExists ¶
func GenerateRandomId ¶
func GenerateRandomId() []byte
func Keys ¶
func Keys(v interface{}) []string
Get keys of a map, i.e. map[string]interface{} -> []string Note that some type checks are omitted for efficiency, you need to ensure them yourself, otherwise your program should panic
func MsgPackMarshal ¶
func MsgPackUnMarshal ¶
func SetupConfig ¶
func SetupConfig()
func StringInSlice ¶
func Ternary ¶
func Ternary(IF bool, THEN interface{}, ELSE interface{}) interface{}
mimic `?:` operator Need type assertion to convert output to expected type
func UnicodeIndex ¶
Types ¶
type Config ¶
type Config struct { S3Domain string // Domain name of YIG Region string // Region name this instance belongs to, e.g cn-bj-1 IamEndpoint string // le IAM endpoint address IamKey string IamSecret string LogPath string PanicLogPath string PidFile string BindApiAddress string BindAdminAddress string SSLKeyPath string SSLCertPath string ZookeeperAddress string RedisAddress string // redis connection string, e.g localhost:1234 RedisConnectionNumber int // number of connections to redis(i.e max concurrent request number) RedisPassword string // redis auth passowrd InMemoryCacheMaxEntryCount int InstanceId string // if empty, generated one at server startup ConcurrentRequestLimit int HbaseZnodeParent string // won't change default("/hbase") if leave this option empty HbaseTimeout time.Duration DebugMode bool AdminKey string //used for tools/admin to communicate with yig GcThread int MetaCacheType int EnableDataCache bool LcThread int //used for tools/lc only, set worker numbers to do lc LcDebug bool //used for tools/lc only, if this was set true, will treat days as seconds LogLevel int //1-20 CephConfigPattern string ReservedOrigins string // www.ccc.com,www.bbb.com,127.0.0.1 MetaStore string TidbInfo string KeepAlive bool }
var CONFIG Config
Click to show internal directories.
Click to hide internal directories.