Versions in this module Expand all Collapse all v1 v1.0.2 Oct 28, 2022 Changes in this version + const AppKey + const CacheKey + const ConfigKey + const DistributedKey + const EnvDevelopment + const EnvKey + const EnvProduction + const EnvTesting + const IDKey + const KernelKey + const LogKey + const ORMKey + const RedisKey + const SSHKey + const TraceKey + const TraceKeyCaller + const TraceKeyCspanID + const TraceKeyMethod + const TraceKeyParentID + const TraceKeySpanID + const TraceKeyTime + const TraceKeyTraceID + type App interface + AppFolder func() string + AppID func() string + BaseFolder func() string + CommandFolder func() string + ConfigFolder func() string + DeployFolder func() string + LoadAppConfig func(kv map[string]string) + LogFolder func() string + MiddlewareFolder func() string + ProviderFolder func() string + RuntimeFolder func() string + TestFolder func() string + Version func() string + type CacheService interface + Calc func(ctx context.Context, key string, step int64) (int64, error) + Decrement func(ctx context.Context, key string) (int64, error) + Del func(ctx context.Context, key string) error + DelMany func(ctx context.Context, keys []string) error + Get func(ctx context.Context, key string) (string, error) + GetMany func(ctx context.Context, keys []string) (map[string]string, error) + GetObj func(ctx context.Context, key string, model interface{}) error + GetTTL func(ctx context.Context, key string) (time.Duration, error) + Increment func(ctx context.Context, key string) (int64, error) + Remember func(ctx context.Context, key string, timeout time.Duration, ...) error + Set func(ctx context.Context, key string, val string, timeout time.Duration) error + SetForever func(ctx context.Context, key string, val string) error + SetForeverObj func(ctx context.Context, key string, val interface{}) error + SetMany func(ctx context.Context, data map[string]string, timeout time.Duration) error + SetObj func(ctx context.Context, key string, val interface{}, timeout time.Duration) error + SetTTL func(ctx context.Context, key string, timeout time.Duration) error + type Config interface + Get func(key string) interface{} + GetBool func(key string) bool + GetFloat64 func(key string) float64 + GetInt func(key string) int + GetIntSlice func(key string) []int + GetString func(key string) string + GetStringMap func(key string) map[string]interface{} + GetStringMapString func(key string) map[string]string + GetStringMapStringSlice func(key string) map[string][]string + GetStringSlice func(key string) []string + GetTime func(key string) time.Time + IsExist func(key string) bool + Load func(key string, val interface{}) error + type CtxFielder func(ctx context.Context) map[string]interface + type DBConfig struct + Charset string + Collation string + ConnMaxIdle int + ConnMaxIdletime string + ConnMaxLifetime string + ConnMaxOpen int + Database string + Driver string + Dsn string + Host string + Loc string + ParseTime bool + Password string + Port int + Protocol string + ReadTimeout string + Timeout string + Username string + WriteTimeout string + func (conf *DBConfig) FormatDsn() (string, error) + type DBOption func(container framework.Container, config *DBConfig) error + type Distributed interface + Select func(serviceName string, appID string, holdTime time.Duration) (selectAppID string, err error) + type Env interface + All func() map[string]string + AppEnv func() string + Get func(string) string + IsExist func(string) bool + type Formatter func(level LogLevel, t time.Time, msg string, fields map[string]interface{}) ([]byte, error) + type IDService interface + NewID func() string + type Kernel interface + HttpEngine func() http.Handler + type Log interface + Debug func(ctx context.Context, msg string, fields map[string]interface{}) + Error func(ctx context.Context, msg string, fields map[string]interface{}) + Fatal func(ctx context.Context, msg string, fields map[string]interface{}) + Info func(ctx context.Context, msg string, fields map[string]interface{}) + Panic func(ctx context.Context, msg string, fields map[string]interface{}) + SetCtxFielder func(handler CtxFielder) + SetFormatter func(formatter Formatter) + SetLevel func(level LogLevel) + SetOutput func(out io.Writer) + Trace func(ctx context.Context, msg string, fields map[string]interface{}) + Warn func(ctx context.Context, msg string, fields map[string]interface{}) + type LogLevel uint32 + const DebugLevel + const ErrorLevel + const FatalLevel + const InfoLevel + const PanicLevel + const TraceLevel + const UnknownLevel + const WarnLevel + type ORMService interface + GetDB func(option ...DBOption) (*gorm.DB, error) + type RedisConfig struct + func (config *RedisConfig) UniqKey() string + type RedisOption func(container framework.Container, config *RedisConfig) error + type RedisService interface + GetClient func(option ...RedisOption) (*redis.Client, error) + type RememberFunc func(ctx context.Context, container framework.Container) (interface{}, error) + type SSHConfig struct + Host string + NetWork string + Port string + func (config *SSHConfig) UniqKey() string + type SSHOption func(container framework.Container, config *SSHConfig) error + type SSHService interface + GetClient func(option ...SSHOption) (*ssh.Client, error) + type Trace interface + ExtractHTTP func(req *http.Request) *TraceContext + GetTrace func(c context.Context) *TraceContext + InjectHTTP func(req *http.Request, trace *TraceContext) *http.Request + NewTrace func() *TraceContext + StartSpan func(trace *TraceContext) *TraceContext + ToMap func(trace *TraceContext) map[string]string + WithTrace func(c context.Context, trace *TraceContext) context.Context + type TraceContext struct + Annotation map[string]string + CspanID string + ParentID string + SpanID string + TraceID string