database

package
v0.0.0-...-ace9e8d Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorNoConfig            = errors.New("database: no conf file")
	ErrorUnsupportedDatabase = errors.New("database: unsupported database kind")
	ErrorOpenConnection      = errors.New("database: open connection failed")
	ErrorNoConnection        = errors.New("database: no connection available")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Kind     string `yaml:"Kind"`
	Host     string `yaml:"Host"`
	Port     int    `yaml:"Port"`
	Username string `yaml:"Username"`
	Password string `yaml:"Password"`
	DB       string `yaml:"DB"`
	Charset  string `yaml:"Charset"`
}

func (*Config) Load

func (c *Config) Load(confPath string) error

func (*Config) Save

func (c *Config) Save(confPath string) error

type Service

type Service struct {
	// contains filtered or unexported fields
}

func (*Service) DB

func (s *Service) DB() (*gorm.DB, error)

func (*Service) Start

func (s *Service) Start(confPath string) error

Jump to

Keyboard shortcuts

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