datasource

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const Lens scene.InfraName = "datasource"

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 JsonConfig added in v0.3.7

type JsonConfig struct {
	Path string
}

type JsonDataSource

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

type MongoConfig added in v0.3.7

type MongoConfig struct {
	Host          string
	Port          int
	Username      string
	Password      string
	Database      string
	AuthSource    string
	Options       string
	UseAPIVersion bool
}

func (MongoConfig) DSN added in v0.3.7

func (c MongoConfig) DSN() string

func (MongoConfig) MaskedDSN added in v0.3.7

func (c MongoConfig) MaskedDSN() string

type MongoDataSource

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

type MysqlConfig added in v0.3.7

type MysqlConfig struct {
	Host     string
	Port     int
	Username string
	Password string
	Database string
	Options  string
}

func (MysqlConfig) DSN added in v0.3.7

func (c MysqlConfig) DSN() string

func (MysqlConfig) MaskedDSN added in v0.3.7

func (c MysqlConfig) MaskedDSN() string

type MysqlDataSource

type MysqlDataSource interface {
	SqlDataSource
}

type PostgresConfig added in v0.3.7

type PostgresConfig struct {
	Host     string
	Port     int
	Username string
	Password string
	Database string
	Options  string
}

func (PostgresConfig) DSN added in v0.3.7

func (c PostgresConfig) DSN() string

type PostgresDataSource added in v0.3.7

type PostgresDataSource interface {
	SqlDataSource
}

type RedisConfig added in v0.3.7

type RedisConfig struct {
	Host     string
	Port     int
	Username string
	Password string
	Database int
}

func (RedisConfig) DSN added in v0.3.7

func (c RedisConfig) DSN() string

func (RedisConfig) MaskedDSN added in v0.3.7

func (c RedisConfig) MaskedDSN() string

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)
	MGet(ctx context.Context, keys ...string) ([]string, error)
	Incr(ctx context.Context, key string) (int64, error)
	GetValue(ctx context.Context, key string, value interface{}) error
	Delete(ctx context.Context, key string) error
}

type SqlDataSource

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

type SqliteConfig added in v0.3.7

type SqliteConfig struct {
	Path    string
	Options string
}

func (SqliteConfig) DSN added in v0.3.7

func (c SqliteConfig) DSN() string

type SqliteDataSource

type SqliteDataSource interface {
	SqlDataSource
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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