data_store

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package data_store - Will move this to central repo, temporarily is copy pasted everywhere

Index

Constants

View Source
const (
	ESDefaultTimeout = time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cassandra

type Cassandra struct {
	Keyspace          string   `mapstructure:"keyspace"`
	Hosts             []string `mapstructure:"hosts"`
	Timeout           int      `mapstructure:"timeout"`
	ReconnectInterval int      `mapstructure:"reconnect_interval"`
	Port              int      `mapstructure:"port"`
	// contains filtered or unexported fields
}

func (*Cassandra) Cluster

func (ds *Cassandra) Cluster() *gocql.ClusterConfig

func (*Cassandra) Init

func (ds *Cassandra) Init() error

func (*Cassandra) LoadFromConfig

func (ds *Cassandra) LoadFromConfig(key string, config *viper.Viper) error

func (*Cassandra) Session

func (ds *Cassandra) Session() *gocql.Session

type ElasticSearch

type ElasticSearch struct {
	Hosts   []string      `mapstructure:"hosts"`
	Timeout time.Duration `mapstructure:"timeout"`
	// contains filtered or unexported fields
}

func (*ElasticSearch) Client

func (ds *ElasticSearch) Client() *elasticsearch.Client

func (*ElasticSearch) LoadFromConfig

func (ds *ElasticSearch) LoadFromConfig(key string, config *viper.Viper) error

type Gorm added in v0.1.2

type Gorm struct {
	User                 string `mapstructure:"user"`
	Password             string `mapstructure:"password"`
	Net                  string `mapstructure:"net"`
	Addr                 string `mapstructure:"addr"`
	DBName               string `mapstructure:"db_name"`
	AllowNativePasswords bool   `mapstructure:"allow_native_passwords"`
	Timeout              int    `json:"timeout"`
	ReadTimeout          int    `json:"read_timeout"`
	WriteTimeout         int    `json:"write_timeout"`
}

func (*Gorm) Db added in v0.1.2

func (ds *Gorm) Db() *gorm.DB

func (*Gorm) LoadFromConfig added in v0.1.2

func (ds *Gorm) LoadFromConfig(key string, config *viper.Viper) error

type Kafka

type Kafka struct {
	Hosts []string `mapstructure:"hosts"`
	Topic string   `mapstructure:"topic"`
	// contains filtered or unexported fields
}

func (*Kafka) LoadFromConfig

func (ds *Kafka) LoadFromConfig(key string, config *viper.Viper) error

func (*Kafka) Producer

func (ds *Kafka) Producer() sarama.AsyncProducer

type Mysql

type Mysql struct {
	User                 string `mapstructure:"user"`
	Password             string `mapstructure:"password"`
	Net                  string `mapstructure:"net"`
	Addr                 string `mapstructure:"addr"`
	DBName               string `mapstructure:"db_name"`
	AllowNativePasswords bool   `mapstructure:"allow_native_passwords"`
	Timeout              int    `json:"timeout"`
	ReadTimeout          int    `json:"read_timeout"`
	WriteTimeout         int    `json:"write_timeout"`
	// contains filtered or unexported fields
}

func (*Mysql) Db

func (ds *Mysql) Db() *sql.DB

func (*Mysql) LoadFromConfig

func (ds *Mysql) LoadFromConfig(key string, config *viper.Viper) error

type Postgres

type Postgres struct {
}

func (*Postgres) LoadFromConfig

func (ds *Postgres) LoadFromConfig(key string, config *viper.Viper) error

type Redis

type Redis struct {
	Addr     string `mapstructure:"addr"`
	Password string `mapstructure:"password"`
	DB       int    `mapstructure:"db"`
	// contains filtered or unexported fields
}

func (*Redis) Client

func (ds *Redis) Client() *redis.Client

func (*Redis) LoadFromConfig

func (ds *Redis) LoadFromConfig(key string, config *viper.Viper) error

type RedisSentinel

type RedisSentinel struct {
	MasterName string   `mapstructure:"name"`
	Addrs      []string `mapstructure:"addr"`
	//Username   string   `mapstructure:"username"`
	Password string `mapstructure:"password"`
	// contains filtered or unexported fields
}

RedisSentinel @todo: Merge with redis

func (*RedisSentinel) Client

func (ds *RedisSentinel) Client() *redis.Client

func (*RedisSentinel) LoadFromConfig

func (ds *RedisSentinel) LoadFromConfig(key string, config *viper.Viper) error

Jump to

Keyboard shortcuts

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