storageprovider

package
v0.0.0-...-e9f0680 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: AGPL-3.0 Imports: 9 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 {
	EnableDocker bool          `json:"enableDocker"`
	Mysql        storage.Mysql `yaml:"mysql"`
	Redis        storage.Redis `yaml:"redis"`
}

func NewConfig

func NewConfig() *Config

func (*Config) RegisterFlagsWithPrefix

func (c *Config) RegisterFlagsWithPrefix(prefix string, f *pflag.FlagSet)

RegisterFlagsWithPrefix is used to register flags

func (*Config) Validate

func (c *Config) Validate() error

type Manager

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

func (*Manager) GetMysqlCon

func (s *Manager) GetMysqlCon() (*gorm.DB, error)

func (*Manager) GetRedisCon

func (s *Manager) GetRedisCon() (*redis.Client, error)

type Provider

type Provider interface {
	GetMysqlCon() (*gorm.DB, error)
	GetRedisCon() (*redis.Client, error)
}

func New

func New(log logger.Logger, cfg *Config) Provider

Jump to

Keyboard shortcuts

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