component

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2023 License: MulanPSL-2.0 Imports: 33 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) (*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]EsDatabase
	// contains filtered or unexported fields
}

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 EsClient added in v0.1.3

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

	IndexSuffix string
	// contains filtered or unexported fields
}

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) Search added in v0.1.4

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

type EsDatabase added in v0.1.4

type EsDatabase interface {
	Init(int, *ElasticSearch)
	CliFlags(string) []cli.Flag
	Config() *define.EntityEs
	Load(string) error
}

type Mongo

type Mongo struct {
	Cfg  define.ComponentMongo
	Clts map[string]MongoDatabase
	// contains filtered or unexported fields
}

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 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) 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{}) 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) FindOne added in v0.1.4

func (c *MongoClient) FindOne(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) Load added in v0.1.3

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

type MongoDatabase added in v0.1.4

type MongoDatabase interface {
	Init(int, *Mongo)
	CliFlags(string) []cli.Flag
	Config() *define.EntityMongo
	Load(string) error
}

type MySQL

type MySQL struct {
	Cfg  define.ComponentMysql
	Clts map[string]MysqlDatabase
	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)

type MysqlDatabase added in v0.1.4

type MysqlDatabase interface {
	Init(int, *MySQL)
	CliFlags(string) []cli.Flag
	Config() *define.EntityMysql
	Load(string) error
}

type MysqlLogger

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

func (*MysqlLogger) Error

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

func (*MysqlLogger) Info

func (l *MysqlLogger) Info(_ 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 glogger.Interface)

func (*MysqlLogger) Trace

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

func (*MysqlLogger) Warn

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

type Redis

type Redis struct {
	Cfg  define.ComponentRedis
	Clts map[string]RedisDatabase
}

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) 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

type RedisDatabase added in v0.1.4

type RedisDatabase interface {
	Init(int, *Redis)
	CliFlags(string) []cli.Flag
	Config() *define.EntityRedis
	Load(string) error
}

type Resize added in v0.1.3

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

func (*Resize) Check added in v0.1.3

func (r *Resize) Check(cap, len int) bool

func (*Resize) NewCap added in v0.1.3

func (r *Resize) NewCap(len int) int

Jump to

Keyboard shortcuts

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