component

package
v0.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2024 License: MulanPSL-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cron added in v0.1.3

type Cron struct {
	Cfg define.ComponentCron
	// contains filtered or unexported fields
}

func (*Cron) CliFlags added in v0.1.3

func (s *Cron) CliFlags() []cli.Flag

func (*Cron) Close added in v0.1.3

func (s *Cron) Close() error

func (*Cron) FreeCron added in v0.1.3

func (s *Cron) FreeCron(name string) error

func (*Cron) Init added in v0.1.3

func (s *Cron) Init(_ logger.Interface, _ *gsf.AppConfig, _ *cli.Context) error

func (*Cron) NewCron added in v0.1.3

func (s *Cron) NewCron(name string) (*cron.Cron, error)

func (*Cron) NewCronEx added in v0.1.3

func (s *Cron) NewCronEx(name string, bSize int, resize cron.Resize) (*cron.Cron, error)

func (*Cron) Run added in v0.1.3

func (s *Cron) Run() error

type ElasticSearch

type ElasticSearch struct {
	Cfg  define.ComponentEs
	Clts map[string]*EsClient
	Log  logger.Interface
}

func (*ElasticSearch) CliFlags

func (c *ElasticSearch) CliFlags() []cli.Flag

func (*ElasticSearch) Close

func (c *ElasticSearch) Close() error

func (*ElasticSearch) Init

func (c *ElasticSearch) Init(l logger.Interface, cfg *gsf.AppConfig, _ *cli.Context) error

func (*ElasticSearch) LoadOne added in v0.1.3

func (c *ElasticSearch) LoadOne(name string) (err error)

func (*ElasticSearch) Run

func (c *ElasticSearch) Run() (err error)

type EsApiLog added in v0.3.1

type EsApiLog func(op, idx, body string) func()

type EsClient added in v0.1.3

type EsClient struct {
	DB  *elasticsearch.Client
	Cfg define.EntityEs

	IndexSuffix string
	// contains filtered or unexported fields
}

func (*EsClient) ApiLog added in v0.2.0

func (c *EsClient) ApiLog(op, idx, body string) func()

func (*EsClient) CliFlags added in v0.1.3

func (c *EsClient) CliFlags(name string) []cli.Flag

func (*EsClient) Config added in v0.1.4

func (c *EsClient) Config() *define.EntityEs

func (*EsClient) Init added in v0.1.4

func (c *EsClient) Init(env int, cc *ElasticSearch)

func (*EsClient) Load added in v0.1.3

func (c *EsClient) Load(name string) (err error)

func (*EsClient) Ref added in v0.2.0

func (c *EsClient) Ref() *ElasticSearch

func (*EsClient) Search added in v0.1.4

func (c *EsClient) Search(idx string, body string, receive interface{}) (cnt uint64, err error)

func (*EsClient) SearchLog added in v0.3.1

func (c *EsClient) SearchLog(l EsApiLog, idx string, body string, receive interface{}) (cnt uint64, err error)

type Mongo

type Mongo struct {
	Cfg  define.ComponentMongo
	Clts map[string]*MongoClient
	Log  logger.Interface
}

func (*Mongo) CliFlags

func (c *Mongo) CliFlags() []cli.Flag

func (*Mongo) Close

func (c *Mongo) Close() error

func (*Mongo) Init

func (c *Mongo) Init(l logger.Interface, cfg *gsf.AppConfig, ctx *cli.Context) error

func (*Mongo) LoadOne added in v0.1.3

func (c *Mongo) LoadOne(name string) (err error)

func (*Mongo) Run

func (c *Mongo) Run() error

type MongoApiLog added in v0.3.1

type MongoApiLog func(tbl, op string, args [][2]interface{}) func()

type MongoClient added in v0.1.3

type MongoClient struct {
	DB  *mongo.Database
	Cfg define.EntityMongo
	// contains filtered or unexported fields
}

func (*MongoClient) AggregateAll added in v0.1.4

func (c *MongoClient) AggregateAll(list interface{}, table string, pipeline interface{}, opts ...*options.AggregateOptions) error

func (*MongoClient) AggregateAllLog added in v0.3.1

func (c *MongoClient) AggregateAllLog(l MongoApiLog, list interface{}, table string, pipeline interface{}, opts ...*options.AggregateOptions) error

func (*MongoClient) ApiLog added in v0.2.0

func (c *MongoClient) ApiLog(tbl, op string, args [][2]interface{}) func()

func (*MongoClient) CliFlags added in v0.1.3

func (c *MongoClient) CliFlags(name string) []cli.Flag

func (*MongoClient) Config added in v0.1.4

func (c *MongoClient) Config() *define.EntityMongo

func (*MongoClient) Count added in v0.1.4

func (c *MongoClient) Count(table string, pipeline interface{}, opts ...*options.CountOptions) int64

func (*MongoClient) CountLog added in v0.3.1

func (c *MongoClient) CountLog(l MongoApiLog, table string, pipeline interface{}, opts ...*options.CountOptions) int64

func (*MongoClient) FindAll added in v0.1.4

func (c *MongoClient) FindAll(list interface{}, table string, filter interface{}, opts ...*options.FindOptions) error

func (*MongoClient) FindAllLog added in v0.3.1

func (c *MongoClient) FindAllLog(l MongoApiLog, list interface{}, table string, filter interface{}, opts ...*options.FindOptions) error

func (*MongoClient) FindOne added in v0.1.4

func (c *MongoClient) FindOne(list interface{}, table string, filter interface{}, opts ...*options.FindOneOptions) error

func (*MongoClient) FindOneLog added in v0.3.1

func (c *MongoClient) FindOneLog(l MongoApiLog, data interface{}, table string, filter interface{}, opts ...*options.FindOneOptions) error

func (*MongoClient) Init added in v0.1.4

func (c *MongoClient) Init(env int, cc *Mongo)

func (*MongoClient) Insert added in v0.2.0

func (c *MongoClient) Insert(table string, data interface{}, opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error)

func (*MongoClient) InsertLog added in v0.3.1

func (c *MongoClient) InsertLog(l MongoApiLog, table string, data interface{}, opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error)

func (*MongoClient) Load added in v0.1.3

func (c *MongoClient) Load(name string) error

func (*MongoClient) Ref added in v0.2.0

func (c *MongoClient) Ref() *Mongo

func (*MongoClient) Update added in v0.2.0

func (c *MongoClient) Update(table string, filter, data interface{}, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)

func (*MongoClient) UpdateLog added in v0.3.1

func (c *MongoClient) UpdateLog(l MongoApiLog, table string, filter, data interface{}, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)

type MySQL

type MySQL struct {
	Cfg  define.ComponentMysql
	Clts map[string]*MySQLClient
	Log  MysqlLogger
}

func (*MySQL) CliFlags

func (c *MySQL) CliFlags() []cli.Flag

func (*MySQL) Close

func (c *MySQL) Close() error

func (*MySQL) Init

func (c *MySQL) Init(l glogger.Interface, cfg *gsf.AppConfig, _ *cli.Context) error

func (*MySQL) LoadOne added in v0.1.3

func (c *MySQL) LoadOne(name string) (err error)

func (*MySQL) Run

func (c *MySQL) Run() error

func (*MySQL) SetLogLevel

func (c *MySQL) SetLogLevel(v int)

type MySQLClient added in v0.1.3

type MySQLClient struct {
	DB  *gorm.DB
	Cfg define.EntityMysql
	// contains filtered or unexported fields
}

func (*MySQLClient) CliFlags added in v0.1.3

func (c *MySQLClient) CliFlags(name string) []cli.Flag

func (*MySQLClient) Config added in v0.1.4

func (c *MySQLClient) Config() *define.EntityMysql

func (*MySQLClient) Init added in v0.1.4

func (c *MySQLClient) Init(env int, cc *MySQL)

func (*MySQLClient) Load added in v0.1.3

func (c *MySQLClient) Load(name string) (err error)

func (*MySQLClient) Ref added in v0.2.0

func (c *MySQLClient) Ref() *MySQL

type MysqlLogger

type MysqlLogger struct {
	// contains filtered or unexported fields
}

func (*MysqlLogger) Error

func (l *MysqlLogger) Error(ctx context.Context, msg string, data ...interface{})

func (*MysqlLogger) Info

func (l *MysqlLogger) Info(ctx context.Context, msg string, data ...interface{})

func (*MysqlLogger) LogMode

func (l *MysqlLogger) LogMode(level logger.LogLevel) logger.Interface

func (*MysqlLogger) SetLogger

func (l *MysqlLogger) SetLogger(log MysqlLoggerInterface)

func (*MysqlLogger) Trace

func (l *MysqlLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)

func (*MysqlLogger) Warn

func (l *MysqlLogger) Warn(ctx context.Context, msg string, data ...interface{})

type MysqlLoggerDefault added in v0.3.1

type MysqlLoggerDefault struct {
	// contains filtered or unexported fields
}

func (MysqlLoggerDefault) Error added in v0.3.1

func (l MysqlLoggerDefault) Error(_ context.Context, format string, v ...interface{})

func (MysqlLoggerDefault) Info added in v0.3.1

func (l MysqlLoggerDefault) Info(_ context.Context, format string, v ...interface{})

func (MysqlLoggerDefault) Warn added in v0.3.1

func (l MysqlLoggerDefault) Warn(_ context.Context, format string, v ...interface{})

type MysqlLoggerInterface added in v0.3.1

type MysqlLoggerInterface interface {
	Info(ctx context.Context, format string, v ...interface{})
	Warn(ctx context.Context, format string, v ...interface{})
	Error(ctx context.Context, format string, v ...interface{})
}

type Redis

type Redis struct {
	Cfg  define.ComponentRedis
	Clts map[string]*RedisClient
	Log  logger.Interface
}

func (*Redis) CliFlags

func (c *Redis) CliFlags() []cli.Flag

func (*Redis) Close

func (c *Redis) Close() error

func (*Redis) Init

func (c *Redis) Init(l logger.Interface, cfg *gsf.AppConfig, _ *cli.Context) error

func (*Redis) LoadOne added in v0.1.3

func (c *Redis) LoadOne(name string) (err error)

func (*Redis) Run

func (c *Redis) Run() (err error)

type RedisClient added in v0.1.3

type RedisClient struct {
	DB  *redis.Client
	Cfg define.EntityRedis
	// contains filtered or unexported fields
}

func (*RedisClient) ApiLog added in v0.2.0

func (c *RedisClient) ApiLog(args [][2]interface{}) func()

func (*RedisClient) CliFlags added in v0.1.3

func (c *RedisClient) CliFlags(name string) []cli.Flag

func (*RedisClient) Config added in v0.1.4

func (c *RedisClient) Config() *define.EntityRedis

func (*RedisClient) Init added in v0.1.4

func (c *RedisClient) Init(env int, cc *Redis)

func (*RedisClient) Load added in v0.1.3

func (c *RedisClient) Load(name string) error

func (*RedisClient) Ref added in v0.2.0

func (c *RedisClient) Ref() *Redis

Directories

Path Synopsis
msg
sms

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL