Documentation
¶
Index ¶
- Constants
- func Debug(str string, args ...any)
- func Debug2(str string, args ...any)
- func Error(str string, args ...any)
- func Error2(str string, args ...any)
- func Fatal(str string, args ...any)
- func Fatal2(str string, args ...any)
- func FormatConfigMap(mapValue map[string]any, mapType reflect.Type)
- func FormatZapArgs(args ...interface{}) (res []any, fields []zap.Field)
- func GetDefaultOptions(skip int) (options []zap.Option)
- func GetFromSystem(key string) string
- func GetGitCommit() string
- func GetPwdDir() string
- func GetReleaseTime() string
- func GetReleaseVersion() string
- func Info(str string, args ...any)
- func Info2(str string, args ...any)
- func IsVersion() bool
- func LoggerInit(c *LogConfig)
- func NewEncoderConfig() zapcore.EncoderConfig
- func NewLoggerByCallerSkip(l *zap.Logger, skip int) *zap.Logger
- func NewZapLogger(c *LogConfig) *zap.Logger
- func OnSignal(fn func())
- func OutInfo()
- func ReadConfig[C any](conf string) (cfg C, err error)
- func Warn(str string, args ...any)
- func Warn2(str string, args ...any)
- type Cache
- func (this_ *Cache[T]) Clear()
- func (this_ *Cache[T]) Delete(keys ...string)
- func (this_ *Cache[T]) Get(key string) (res T, find bool)
- func (this_ *Cache[T]) GetAnRemove(key string) (res T, find bool)
- func (this_ *Cache[T]) GetOrLoad(key string, load func() (T, error)) (res T, err error)
- func (this_ *Cache[T]) Put(key string, v T)
- func (this_ *Cache[T]) PutIfAbsent(key string, v T)
- func (this_ *Cache[T]) Remove(removeKeys ...string)
- func (this_ *Cache[T]) Set(key string, value T)
- type CacheGroup
- func (this_ *CacheGroup[T]) Clear()
- func (this_ *CacheGroup[T]) Delete(keys ...string)
- func (this_ *CacheGroup[T]) Get(key string) (T, bool)
- func (this_ *CacheGroup[T]) GetCache(key string) *Cache[T]
- func (this_ *CacheGroup[T]) GetCacheByHash(hashCode uint32) *Cache[T]
- func (this_ *CacheGroup[T]) GetStringHashCode(str string) uint32
- func (this_ *CacheGroup[T]) Put(key string, v T)
- func (this_ *CacheGroup[T]) PutIfAbsent(key string, v T)
- type CacheItem
- type CacheOptions
- type CoreError
- type DoFunc
- type DoFuncList
- type Event
- type EventContext
- type Listener
- type ListenerList
- type LogConfig
- type Logger
- type Starter
- func (this_ *Starter) AddInitComponentFunc(name string, order int, fn func() error)
- func (this_ *Starter) AddInitConfigFunc(name string, order int, fn func() error)
- func (this_ *Starter) AddInitDataFunc(name string, order int, fn func() error)
- func (this_ *Starter) AddInitFactoryFunc(name string, order int, fn func() error)
- func (this_ *Starter) AddInitTableFunc(name string, order int, fn func() error)
- func (this_ *Starter) AddServerStartFunc(name string, order int, fn func() error)
- func (this_ *Starter) CallEvent(event Event, args ...any)
- func (this_ *Starter) CallStop()
- func (this_ *Starter) DoInit() (err error)
- func (this_ *Starter) GetListeners(event Event) (res []*Listener)
- func (this_ *Starter) OnEvent(event Event, onEvent func(args ...any), order int)
- func (this_ *Starter) ServerStart() (err error)
- func (this_ *Starter) SetShouldWait(v bool)
- func (this_ *Starter) ShouldWait() bool
- func (this_ *Starter) Start() (err error)
- func (this_ *Starter) Wait()
- type TError
Constants ¶
View Source
const ( EventSystemInitBefore = Event("system-init-before-event") EventSystemInitAfter = Event("system-init-after-event") EventConfigInitBefore = Event("config-init-before-event") EventConfigInitAfter = Event("config-init-after-event") EventComponentInitBefore = Event("component-init-before-event") EventComponentInitAfter = Event("component-init-after-event") EventFactoryInitBefore = Event("factory-init-before-event") EventFactoryInitAfter = Event("factory-init-after-event") EventTableInitBefore = Event("table-init-before-event") EventTableInitAfter = Event("table-init-after-event") EventDataInitBefore = Event("data-init-before-event") EventDataInitAfter = Event("data-init-after-event") EventServerStartBefore = Event("server-start-before-event") EventServerStartAfter = Event("server-start-after-event") EventReady = Event("ready-event") EventStopBefore = Event("stop-before-event") EventStop = Event("stop-event") )
Variables ¶
This section is empty.
Functions ¶
func FormatZapArgs ¶
func GetDefaultOptions ¶
func GetFromSystem ¶
func GetGitCommit ¶
func GetGitCommit() string
func GetReleaseTime ¶
func GetReleaseTime() string
func GetReleaseVersion ¶
func GetReleaseVersion() string
func LoggerInit ¶
func LoggerInit(c *LogConfig)
func NewEncoderConfig ¶
func NewEncoderConfig() zapcore.EncoderConfig
func NewLoggerByCallerSkip ¶
NewLoggerByCallerSkip 跳过的调用方数量 skip = 1 表示 输出的 文件名 行号等 为上层方法
func NewZapLogger ¶
NewZapLogger creator a new zap logger hook {Filename, Maxsize(megabytes), MaxBackups, MaxAge(days)} level zap.Level { DebugLevel, InfoLevel, WarnLevel, ErrorLevel, }
func ReadConfig ¶
Types ¶
type Cache ¶
type Cache[T any] struct { // contains filtered or unexported fields }
Cache 临时缓存结构
func NewCacheByOptions ¶
func NewCacheByOptions[T any](opts *CacheOptions, obj T) *Cache[T]
NewCacheByOptions 创建一个 带策略的 缓存
func (*Cache[T]) GetAnRemove ¶
GetAnRemove 从缓存中获取一个项
func (*Cache[T]) PutIfAbsent ¶
PutIfAbsent 不存在则新增
type CacheGroup ¶
type CacheGroup[T any] struct { // contains filtered or unexported fields }
func NewCacheGroup ¶
func NewCacheGroup[T any](cacheSize int, obj T) *CacheGroup[T]
func NewCacheGroupByOption ¶
func NewCacheGroupByOption[T any](cacheSize int, opts *CacheOptions, obj T) *CacheGroup[T]
func (*CacheGroup[T]) Get ¶
func (this_ *CacheGroup[T]) Get(key string) (T, bool)
func (*CacheGroup[T]) GetCache ¶
func (this_ *CacheGroup[T]) GetCache(key string) *Cache[T]
func (*CacheGroup[T]) GetCacheByHash ¶
func (this_ *CacheGroup[T]) GetCacheByHash(hashCode uint32) *Cache[T]
func (*CacheGroup[T]) GetStringHashCode ¶
func (this_ *CacheGroup[T]) GetStringHashCode(str string) uint32
func (*CacheGroup[T]) PutIfAbsent ¶
func (this_ *CacheGroup[T]) PutIfAbsent(key string, v T)
PutIfAbsent 不存在则新增
type CacheItem ¶
type CacheItem[T any] struct { // contains filtered or unexported fields }
CacheItem 缓存项结构
type CacheOptions ¶
type DoFuncList ¶
type DoFuncList []*DoFunc
func (DoFuncList) Len ¶
func (a DoFuncList) Len() int
func (DoFuncList) Sort ¶
func (a DoFuncList) Sort()
func (DoFuncList) Swap ¶
func (a DoFuncList) Swap(i, j int)
type EventContext ¶
type ListenerList ¶
type ListenerList []*Listener
func (ListenerList) Len ¶
func (p ListenerList) Len() int
func (ListenerList) Less ¶
func (p ListenerList) Less(i, j int) bool
func (ListenerList) Sort ¶
func (p ListenerList) Sort()
func (ListenerList) Swap ¶
func (p ListenerList) Swap(i, j int)
type LogConfig ¶
type LogConfig struct {
Console bool `json:"console,omitempty" yaml:"console,omitempty"`
Filename string `json:"filename,omitempty" yaml:"filename,omitempty"`
MaxSize int `json:"maxSize,omitempty" yaml:"maxSize,omitempty"`
MaxAge int `json:"maxAge,omitempty" yaml:"maxAge,omitempty"`
MaxBackups int `json:"maxBackups,omitempty" yaml:"maxBackups,omitempty"`
Level string `json:"level,omitempty" yaml:"level,omitempty"`
}
type Logger ¶
type Starter ¶
type Starter struct {
// contains filtered or unexported fields
}
func NewStarter ¶
func NewStarter() (res *Starter)
func (*Starter) AddInitComponentFunc ¶
func (*Starter) AddInitConfigFunc ¶
func (*Starter) AddInitDataFunc ¶
func (*Starter) AddInitFactoryFunc ¶
func (*Starter) AddInitTableFunc ¶
func (*Starter) AddServerStartFunc ¶
func (*Starter) GetListeners ¶
func (*Starter) ServerStart ¶
func (*Starter) SetShouldWait ¶
func (*Starter) ShouldWait ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
dialects
|
|
|
dm
* Copyright (c) 2000-2018, 达梦数据库有限公司.
|
* Copyright (c) 2000-2018, 达梦数据库有限公司. |
|
dm/parser
* Copyright (c) 2000-2018, 达梦数据库有限公司.
|
* Copyright (c) 2000-2018, 达梦数据库有限公司. |
|
dm/security
This is a mirror of golang.org/x/crypto/internal/subtle.
|
This is a mirror of golang.org/x/crypto/internal/subtle. |
|
dm/util
* Copyright (c) 2000-2018, 达梦数据库有限公司.
|
* Copyright (c) 2000-2018, 达梦数据库有限公司. |
|
kingbase_v8r3/gokb
Package kb is a pure Go Kingbase driver for the database/sql package.
|
Package kb is a pure Go Kingbase driver for the database/sql package. |
|
kingbase_v8r3/gokb/oid
Package oid contains OID constants as defined by the Kingbase server.
|
Package oid contains OID constants as defined by the Kingbase server. |
|
kingbase_v8r3/gokb/scram
Package scram implements a SCRAM-{SHA-1,etc} client per RFC5802.
|
Package scram implements a SCRAM-{SHA-1,etc} client per RFC5802. |
|
kingbase_v8r6/gokb
Package kb is a pure Go Kingbase driver for the database/sql package.
|
Package kb is a pure Go Kingbase driver for the database/sql package. |
|
kingbase_v8r6/gokb/oid
Package oid contains OID constants as defined by the Kingbase server.
|
Package oid contains OID constants as defined by the Kingbase server. |
|
kingbase_v8r6/gokb/scram
Package scram implements a SCRAM-{SHA-1,etc} client per RFC5802.
|
Package scram implements a SCRAM-{SHA-1,etc} client per RFC5802. |
|
odbc
Package odbc implements database/sql driver to access data via odbc interface.
|
Package odbc implements database/sql driver to access data via odbc interface. |
Click to show internal directories.
Click to hide internal directories.