db

package
v0.0.0-...-9008a76 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name     string
	Host     string
	Port     int
	User     string
	Password string
}

Config contains the basic DB configuration params.

type RedisConfig

type RedisConfig struct {
	Host string
	Port int
}

RedisConfig contains the configuration to access a Redis instance.

func (*RedisConfig) Address

func (rc *RedisConfig) Address() string

Address returns the address for a redis instance.

type SQLDB

type SQLDB interface {
	Master() *sqlx.DB
	Close()
}

SQLDB contains the connection to a master database and a way to shutdown the connection using Close

func NewSQLDB

func NewSQLDB(ins *obs.Insighter, conf *Config) SQLDB

NewSQLDB creates a connection to a database. In case it cannot connect, it will panic.

Jump to

Keyboard shortcuts

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