Documentation
¶
Index ¶
Constants ¶
View Source
const Lens scene.InfraName = "datasource"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataSource ¶
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
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
func (SqliteConfig) DSN ¶ added in v0.3.7
func (c SqliteConfig) DSN() string
type SqliteDataSource ¶
type SqliteDataSource interface {
SqlDataSource
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.