datasource

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataSource

type DataSource interface {
	scene.Disposable
	scene.Setupable
	DataSourceName() scene.ImplName
	Status() error
}

type JsonDataSource

type JsonDataSource interface {
	DataSource
	Load() ([]byte, error)
	Save(data []byte) error
}

type MongoDataSource

type MongoDataSource interface {
	DataSource
	Database() *mongo.Database
	Collection(coll string) *mongo.Collection
}

type MysqlDataSource

type MysqlDataSource interface {
	DataSource
	Connection() *sql.DB
}

type RedisDataSource

type RedisDataSource interface {
	DataSource
	Set(ctx context.Context, key string, value interface{}, expiration time.Duration) error
	Get(ctx context.Context, key string) (string, error)
	GetValue(ctx context.Context, key string, value interface{}) error
	Delete(ctx context.Context, key string) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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