Versions in this module Expand all Collapse all v0 v0.0.4 Oct 24, 2021 Changes in this version + func PrepareLoadCsvData(mux string, loader CsvDataLoader, args ...string) + func RegisterScheduledEvent(evt *ScheduledEvent) + type Cache struct + Config *CacheConfig + func NewCache(config CacheConfig) (plugin *Cache, err error) + func (c *Cache) Save() (err error) + type CacheConfig struct + AutoSave int8 + CleanupInterval time.Duration + CreateNewFile bool + DefaultExpiration time.Duration + Filepath string + ID string + type CsvDataLoader interface + type CsvManager struct + func NewCsvManager() (csvManager *CsvManager, err error) + func (manager *CsvManager) Load(folder string, engine Interface) (err error) + func (manager *CsvManager) StoreTable(name string, mux string, container interface{}) + func (manager *CsvManager) Table(name string, mux string) (*sync.Map, bool) + type EventCallback func(plugins Interface, at time.Time) (err error) + type GameLog struct + Action string + Comment string + Fields map[string]interface{} + type Interface interface + Cache func(id string) *Cache + LBClient func(id string) *LBClient + MasterData func() MasterDataManager + Mongo func(id string) *Mongo + MySQL func(id string) *MySQL + Redis func(id string) *Redis + Sqlite func(id string) *Sqlite + type LBClient struct + Config *LBClientConfig + func NewLBClient(logger Logger, config LBClientConfig) (plugin *LBClient, err error) + type LBClientConfig struct + DialDualStack bool + Host string + ID string + IsTLS bool + MaxBatchDelay time.Duration + MaxConns int + MaxIdleConnDuration time.Duration + MaxPendingRequests int + Port uint16 + ReadBufferSize int + ReadTimeout time.Duration + Scheme string + WriteBufferSize int + WriteTimeout time.Duration + type Logger interface + Errorf func(format string, args ...interface{}) + Fatalf func(format string, args ...interface{}) + Infof func(format string, args ...interface{}) + Printf func(format string, args ...interface{}) + Warnf func(format string, args ...interface{}) + WithField func(key string, value interface{}) *logrus.Entry + func NewLogger(config LoggerConfig) (Logger, error) + type LoggerConfig struct + ErrorAge time.Duration + InfoAge time.Duration + Path string + WarnAge time.Duration + type MasterDataManager interface + StoreTable func(name string, mux string, container interface{}) + Table func(name string, mux string) (*sync.Map, bool) + type MasterTable interface + Range func(f func(key, value interface{}) bool) + Record func(key interface{}) (val interface{}, ok bool) + func MasterTableWithLogger(logger Logger, mux string, tableName string, container *sync.Map) MasterTable + type Mongo struct + Config *MongoDBConfig + func NewMongo(config MongoDBConfig) (plugin *Mongo, err error) + type MongoDBConfig struct + AuthMechanism string + AuthMechanismProperties map[string]string + AuthSource string + AutoAbortTransaction bool + AutoCommitTransaction bool + CompressionLevel int + ConnectTimeout time.Duration + Database string + Hosts []string + ID string + MaxConnIdleTime time.Duration + MaxPoolSize uint64 + MinPoolSize uint64 + Password string + PasswordSet bool + ReplicaSet string + ServerSelectionTimeout time.Duration + SocketTimeout time.Duration + Username string + type MySQL struct + Config *MySQLConfig + func NewMySQL(config MySQLConfig) (plugin *MySQL, err error) + type MySQLConfig struct + Addr string + AutoCommitTransaction bool + AutoRollbackTransaction bool + AutoWithTransaction bool + Charset string + ConnMaxIdleTime time.Duration + ConnMaxLifeTime time.Duration + Database string + ID string + Loc string + MaxIdleConns int + MaxOpenConns int + ParseTime string + Password string + Username string + type Redis struct + Config *RedisConfig + func NewRedis(config RedisConfig) (plugin *Redis, err error) + func (r *Redis) Lock(key string, options ...redsync.Option) (err error) + func (r *Redis) Locker() *redsync.Redsync + func (r *Redis) Mutex(name string, options ...redsync.Option) (mu *redsync.Mutex) + func (r *Redis) Unlock(key string) (status bool, err error) + type RedisConfig struct + Address string + DB int + DialTimeout time.Duration + ID string + IdleTimeout time.Duration + MaxConnAge time.Duration + MinIdleConns int + Network string + Password string + PoolSize int + PoolTimeout time.Duration + ReadTimeout time.Duration + Username string + WriteTimeout time.Duration + type ScheduledEvent struct + func NewScheduledEvent(id string, interval uint16, untilAt ...*time.Time) *ScheduledEvent + func (se *ScheduledEvent) AddCallback(fn EventCallback) *ScheduledEvent + type Scheduler struct + func DefaultScheduler(engine Interface) (s *Scheduler) + func (s *Scheduler) Start(ctx context.Context) + func (s *Scheduler) Stop() + type Sqlite struct + Config *Sqlite3Config + func NewSqlite3(config Sqlite3Config) (plugin *Sqlite, err error) + type Sqlite3Config struct + Filename string + ID string