Versions in this module Expand all Collapse all v1 v1.0.3 Nov 27, 2024 v1.0.2 Nov 27, 2024 v1.0.1 Nov 27, 2024 Changes in this version + type Config struct + Database string + Host string + Options map[string]interface{} + Password string + Port int + Username string + type DBInterface interface + Connect func(ctx context.Context) error + Disconnect func(ctx context.Context) error + IsConnected func() bool + Ping func(ctx context.Context) error + Reconnect func(ctx context.Context) error + type DataOperation interface + Create func(ctx context.Context, collection string, data interface{}) error + Delete func(ctx context.Context, collection string, filter interface{}) error + List func(ctx context.Context, collection string, filter interface{}, ...) error + Read func(ctx context.Context, collection string, filter interface{}, result interface{}) error + Update func(ctx context.Context, collection string, filter interface{}, update interface{}) error + type Etcd struct + func NewEtcd(config *Config) *Etcd + func (e *Etcd) Connect(ctx context.Context) error + func (e *Etcd) Delete(ctx context.Context, key string) error + func (e *Etcd) Disconnect(ctx context.Context) error + func (e *Etcd) Get(ctx context.Context, key string) (string, error) + func (e *Etcd) IsConnected() bool + func (e *Etcd) Ping(ctx context.Context) error + func (e *Etcd) Put(ctx context.Context, key, value string) error + func (e *Etcd) Reconnect(ctx context.Context) error + func (e *Etcd) Watch(ctx context.Context, key string) clientv3.WatchChan + type MongoDB struct + func NewMongoDB(config *Config) *MongoDB + func (m *MongoDB) Connect(ctx context.Context) error + func (m *MongoDB) Create(ctx context.Context, collection string, data interface{}) error + func (m *MongoDB) Delete(ctx context.Context, collection string, filter interface{}) error + func (m *MongoDB) Disconnect(ctx context.Context) error + func (m *MongoDB) IsConnected() bool + func (m *MongoDB) List(ctx context.Context, collection string, filter interface{}, ...) error + func (m *MongoDB) Ping(ctx context.Context) error + func (m *MongoDB) Read(ctx context.Context, collection string, filter interface{}, result interface{}) error + func (m *MongoDB) Reconnect(ctx context.Context) error + func (m *MongoDB) Update(ctx context.Context, collection string, filter interface{}, update interface{}) error + type PostgreSQL struct + func NewPostgreSQL(config *Config) *PostgreSQL + func (p *PostgreSQL) Connect(ctx context.Context) error + func (p *PostgreSQL) Create(ctx context.Context, table string, data interface{}) error + func (p *PostgreSQL) Delete(ctx context.Context, table string, filter interface{}) error + func (p *PostgreSQL) Disconnect(ctx context.Context) error + func (p *PostgreSQL) IsConnected() bool + func (p *PostgreSQL) List(ctx context.Context, table string, filter interface{}, results interface{}) error + func (p *PostgreSQL) Ping(ctx context.Context) error + func (p *PostgreSQL) Read(ctx context.Context, table string, filter interface{}, result interface{}) error + func (p *PostgreSQL) Reconnect(ctx context.Context) error + func (p *PostgreSQL) Update(ctx context.Context, table string, filter interface{}, update interface{}) error + type Redis struct + func NewRedis(config *Config) *Redis + func (r *Redis) Connect(ctx context.Context) error + func (r *Redis) Delete(ctx context.Context, key string) error + func (r *Redis) Disconnect(ctx context.Context) error + func (r *Redis) Exists(ctx context.Context, key string) (bool, error) + func (r *Redis) Get(ctx context.Context, key string) (string, error) + func (r *Redis) IsConnected() bool + func (r *Redis) Ping(ctx context.Context) error + func (r *Redis) Reconnect(ctx context.Context) error + func (r *Redis) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) error + type SQLServer struct + func NewSQLServer(config *Config) *SQLServer + func (s *SQLServer) Connect(ctx context.Context) error + func (s *SQLServer) Create(ctx context.Context, table string, data map[string]interface{}) error + func (s *SQLServer) Delete(ctx context.Context, table string, filter map[string]interface{}) error + func (s *SQLServer) Disconnect(ctx context.Context) error + func (s *SQLServer) IsConnected() bool + func (s *SQLServer) List(ctx context.Context, table string, filter map[string]interface{}, ...) error + func (s *SQLServer) Ping(ctx context.Context) error + func (s *SQLServer) Read(ctx context.Context, table string, filter map[string]interface{}, ...) error + func (s *SQLServer) Reconnect(ctx context.Context) error + func (s *SQLServer) Update(ctx context.Context, table string, filter map[string]interface{}, ...) error