store

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMemoryCache

func NewMemoryCache(config config.MemoryCacheConfig) *cache.Cache

func NewRedis

func NewRedis(config config.CacheConfig) *redis.Client

Types

type MongoDB added in v0.1.6

type MongoDB struct {
	Client  *mongo.Client
	Context context.Context
	*mongo.Database
}

func NewMongo

func NewMongo(database config.DatabaseConfig, debug bool) *MongoDB

func (*MongoDB) Close added in v0.1.6

func (d *MongoDB) Close()

Close closes the mongo-go-driver connection.

type Orm

type Orm struct {
	*gorm.DB
	// contains filtered or unexported fields
}

Orm facilitate database interactions, support mysql

func NewOrm

func NewOrm(database config.DatabaseConfig, debug bool) *Orm

NewOrm creates a new model, and opens database connection based on cfg settings

func (*Orm) AddModels

func (orm *Orm) AddModels(values ...interface{}) error

AddModels add the values to the models registry

func (*Orm) AutoMigrateAll

func (orm *Orm) AutoMigrateAll()

AutoMigrateAll runs migrations for all the registered models

func (*Orm) Close

func (orm *Orm) Close() error

Jump to

Keyboard shortcuts

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