Versions in this module Expand all Collapse all v1 v1.0.1003 Jul 7, 2024 v1.0.1002 Mar 29, 2024 v1.0.1001 Dec 3, 2023 Changes in this version type Mongo + GetConfig func() MongoProviderConfig type MongoODM + Count func(ctx context.Context) (res int64, err error) + SetLimit func(limit int64) MongoODM + SetSkip func(skip int64) MongoODM + SetSort func(sortBy string, desc bool) MongoODM type MongoProviderConfig + TimeoutConnection int v1.0.1000 Aug 22, 2023 Changes in this version + var ConfigManual = map[string]string + var RecordNotFound = errors.New("record not found in database") + func SetManual(man map[string]string) map[string]string + type ConsumerCallback func(Messages, ConsumerCallbackIsDone) + type ConsumerCallbackIsDone struct + Done context.CancelFunc + EndRequest func() + type Database interface + Init func(logger.Logger) Database + LoadEmbedded func(EmbeddedOptions) Embedded + LoadKafka func(string, KafkaProviderConfig) Kafka + LoadMongo func(tag string, config MongoProviderConfig) Mongo + LoadRabbitMQ func(string, RabbitMQProviderConfig) RabbitMQ + LoadRedis func(string, RedisProviderConfig) Redis + LoadSQL func(string, SQLConfig) SQL + SetTracer func(tracing.Tracing) + type Embedded interface + DB func() *nutsdb.DB + Delete func(bucket string, key string) (err error) + Get func(bucket string, key string, value interface{}, encoding Encoding) (err error) + GetAllKeys func(bucket string) (keys []string, err error) + Set func(bucket string, key string, value interface{}, encoding Encoding) (err error) + type EmbeddedOptions struct + Directory string + type Encoder struct + Encoding Encoding + Raw io.Reader + func (c *Encoder) Context() context.Context + func (c *Encoder) Decode(data interface{}) error + func (c *Encoder) Encode(data interface{}) (res []byte, err error) + func (c *Encoder) Exchange() string + func (c *Encoder) RoutingKey() string + func (c *Encoder) SetContext(ctx context.Context) + type Encoding int + const EncodingBase64Gob + const EncodingGob + const EncodingJSON + const EncodingNone + const EncodingProto + type Kafka interface + Consumer func(KafkaOptions, ConsumerCallback) + Producer func(ProducerIsReady) + Push func(ctx context.Context, id string, options KafkaOptions, body interface{}, ...) error + type KafkaOptions struct + Encoding Encoding + Group string + Limiter int + MultipleThread bool + RegistryValue string + SchemeID int + SchemeVersion int + Topic string + type KafkaProviderConfig struct + Debug string + Enable bool + Host string + Mechanisms string + Password string + Registry string + SecurityProtocol string + Username string + type Messages interface + Context func() context.Context + Decode func(interface{}) error + Exchange func() string + RoutingKey func() string + SetContext func(context.Context) + func NewEncoder(raw io.Reader, exchange, routingKey string, enc Encoding) Messages + type Mongo interface + Client func() *mongo.Client + ODM func() MongoODM + Start func() (err error) + UseEncryption func(encLib encryption.Encryption) Mongo + WithMonitor func(enable bool) Mongo + type MongoIndex struct + Collection string + Compound bool + Desc bool + ExpiredAfterSecond int32 + Field string + PrimaryKey bool + Unique bool + type MongoODM interface + Collection func(model interface{}, name string) MongoODM + Create func(ctx context.Context, data interface{}) *MongoTransaction + Delete func(ctx context.Context) *MongoTransaction + Drop func(ctx context.Context) MongoODM + Error func() error + Filter func(filter map[string]interface{}) MongoODM + Find func(ctx context.Context, dest interface{}) *MongoTransaction + FindRaw func(ctx context.Context) (results []bson.Raw, cc *MongoTransaction) + Index func() MongoODM + NativeCollection func() *mongo.Collection + Update func(ctx context.Context, data map[string]interface{}) *MongoTransaction + Upsert func(ctx context.Context, data interface{}, matchKey []string) *MongoTransaction + type MongoProviderConfig struct + AutoReconnect bool + Database string + Enable bool + Host string + MaxError int + Name string + Options string + Password string + Port int + StartInterval int + Uri string + UserName string + type MongoTransaction struct + DeletedCount int64 + EffectedIDs []primitive.ObjectID + Error error + InsertedIDs []primitive.ObjectID + type ORM interface + AutoMigrate func(dst ...interface{}) (err error) + Model func(dst interface{}) OrmModel + type OrmModel interface + Create func(data interface{}) (err error) + Debug func() OrmModel + Delete func() (rowEffected int64, err error) + Drop func() error + Equal func(query ...interface{}) OrmModel + Find func(dst interface{}) error + FindRaw func() (res []interface{}, err error) + First func(dst interface{}) error + Limit func(limit int) OrmModel + NotEqual func(query ...interface{}) OrmModel + Offset func(offset int) OrmModel + Or func(query ...interface{}) OrmModel + Order func(query ...clause.OrderByColumn) OrmModel + Truncate func() error + Update func(data map[string]interface{}) (err error) + Upsert func(data interface{}) (err error) + Where func(query interface{}, args ...interface{}) OrmModel + WithContext func(ctx context.Context) OrmModel + type ProducerIsReady func() + type Provider int + type RabbitMQ interface + Consumer func(RabbitMQOptions, ConsumerCallback) + Producer func(RabbitMQOptions) + Push func(ctx context.Context, id, exchange, key string, body interface{}, ...) error + type RabbitMQOptions struct + AutoDeleted bool + Durable bool + Encoding Encoding + Exchange string + ExchangeType string + NoWait bool + RoutingKey string + type RabbitMQProviderConfig struct + DedicatedConnection bool + Enable bool + Host string + Password string + Port int + ReconnectDuration int + Username string + type Redis interface + GetClient func() (pool radix.Client) + GetConfig func() RedisProviderConfig + Init func() error + type RedisProviderConfig struct + AutoReconnect bool + Enable bool + Host string + MaxError int + Name string + Password string + Pool int + Port int + StartInterval int + type SQL interface + Close func() error + Config func() SQLConfig + GetEncryption func() (encLib encryption.Encryption) + Gorm func() *gorm.DB + ORM func() ORM + Start func() error + UseEncryption func(encLib encryption.Encryption) SQL + type SQLConfig struct + AutoReconnect bool + Connection string + DBPath string + Database string + Driver string + Enable bool + Host string + MaxError int + Name string + Options string + Password string + Port int + SsLMode string + StartInterval int + TimeoutConnection int + TimeoutTransaction int + Username string