Documentation
¶
Index ¶
Constants ¶
View Source
const ( EnvKey = "gogin:env" EnvProduction = "production" EnvDevelopment = "development" EnvTesting = "testing" )
View Source
const ( TraceKeyTraceID = "trace_id" TraceKeyParentID = "parent_id" TraceKeySpanID = "span_id" TraceKeySubSpanID = "sub_span_id" TraceKeyMethod = "method" TraceKeyCaller = "caller" TraceKeyTime = "time" )
View Source
const AppKey = "gogin:app"
View Source
const CacheKey = "gogin:cache"
View Source
const DcsKey = "gogin:dcs"
View Source
const EtcKey = "gogin:etc"
View Source
const KernelKey = "gogin:kernel"
View Source
const LogKey = "gogin:log"
View Source
const OrmKey = "gogin:orm"
View Source
const RedisKey = "gogin:redis"
View Source
const TraceKey = "gogin:trace"
View Source
const UidKey = "gogin:uid"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DbConfig ¶
type DbConfig struct { WriterTimeout string `yaml:"writer_timeout"` ReaderTimeout string `yaml:"reader_timeout"` ParseTime bool `yaml:"parse_time"` Loc string `yaml:"loc"` Dsn string `yaml:"dsn"` Host string `ymal:"host"` Port int `yaml:"port"` Driver string `yaml:"driver"` Charset string `yaml:"charset"` Timeout string `yaml:"timeout"` Protocol string `yaml:"protocol"` Database string `yaml:"database"` Collation string `yaml:"collation"` AllowNativePasswords bool `yaml:"allow_native_passwords"` Username string `yaml:"username"` Password string `yaml:"password"` ConnMaxIdle int `ymal:"conn_max_idle"` ConnMaxOpen int `ymal:"conn_max_open"` ConnMaxIdletime string `yaml:"conn_max_idletime"` ConnMaxLifetime string `yaml:"conn_max_lifetime"` *gorm.Config }
type ICache ¶
type ICache interface { Set(ctx context.Context, key string, val string, timeout time.Duration) error SetObject(ctx context.Context, key string, val any, timeout time.Duration) error SetMany(ctx context.Context, data map[string]string, timeout time.Duration) error SetForever(ctx context.Context, key string, val string) error SetForeverObject(ctx context.Context, key string, val any) error Get(ctx context.Context, key string) (string, error) GetObject(ctx context.Context, key string, model any) error GetMany(ctx context.Context, keys []string) (map[string]string, error) SetTTL(ctx context.Context, key string, timeout time.Duration) error GetTTL(ctx context.Context, key string) error Remember(ctx context.Context, key string, timeout time.Duration, fn RememberFunc, model any) error Calc(ctx context.Context, key string, step int64) (int64, error) Increment(ctx context.Context, key string) (int64, error) Decrement(ctx context.Context, key string) (int64, error) Del(ctx context.Context, key string) error DelMany(ctx context.Context, keys []string) error }
type IEtc ¶
type IEtc interface { Get(key string) any GetBool(key string) bool GetInt(key string) int GetInt64(key string) int64 GetFloat32(key string) float32 GetFloat64(key string) float64 GetString(key string) string GetIntSlice(key string) []int GetStringSlice(key string) []string GetStringMap(key string) map[string]any GetStringMapString(key string) map[string]string GetStringMapStringSlice(key string) map[string][]string Load(key string, val any) error Exist(key string) bool }
type ILog ¶
type ILog interface { Panic(ctx context.Context, msg string, data map[string]any) Fatal(ctx context.Context, msg string, data map[string]any) Error(ctx context.Context, msg string, data map[string]any) Warn(ctx context.Context, msg string, data map[string]any) Info(ctx context.Context, msg string, data map[string]any) Debug(ctx context.Context, msg string, data map[string]any) Trace(ctx context.Context, msg string, data map[string]any) SetLevel(level LogLevel) SetWriter(writer io.Writer) SetHandler(handler Handler) SetFormatter(formatter Formatter) }
type IRedis ¶
type IRedis interface {
GetClient(option ...RedisOption) (*redis.Client, error)
}
type ITrace ¶
type ITrace interface { NewTrace() *TraceContext GetTrace(ctx context.Context) *TraceContext WithTrace(ctx context.Context, tcx *TraceContext) context.Context StartSpan(tcx *TraceContext) *TraceContext ToMap(tcx *TraceContext) map[string]string ExtractHttp(req *http.Request) *TraceContext InjectHttp(req *http.Request, tcx *TraceContext) *http.Request }
type RedisConfig ¶
type RedisConfig struct {
*redis.Options
}
func (*RedisConfig) UniqueKey ¶
func (c *RedisConfig) UniqueKey() string
type RedisOption ¶
type RedisOption func(container goframe.IContainer, config *RedisConfig) error
type RememberFunc ¶
type TableColumn ¶
Click to show internal directories.
Click to hide internal directories.