cfg

package
v0.0.0-...-a41176a Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2022 License: BSD-3-Clause 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 {
	Connections ConfigConnections `yaml:"connections"`
	Services    ConfigServices    `yaml:"services"`
}

type ConfigConnections

type ConfigConnections struct {
	Mongo    map[string]ConfigDatabaseMongo    `yaml:"mongo"`
	Postgres map[string]ConfigDatabasePostgres `yaml:"postgres"`
}

type ConfigDatabaseMongo

type ConfigDatabaseMongo struct {
}

type ConfigDatabasePostgres

type ConfigDatabasePostgres struct {
	Host    string `yaml:"host"`
	Port    uint16 `yaml:"port"`
	Dbname  string `yaml:"dbname"`
	Sslmode string `yaml:"sslmode"`
}

type ConfigService

type ConfigService struct {
	DBType   TypeDB `yaml:"dbtype"`
	ConnName string `yaml:"connname"`
}

type ConfigServices

type ConfigServices struct {
	Avatar ConfigService
}

type Secret

type Secret struct {
	Connections SecretConnections `yaml:"connections"`
}

type SecretConnections

type SecretConnections struct {
	Postgres map[string]SecretDatabasePostgres `yaml:"postgres"`
	Mongo    map[string]SecretDatabaseMongo    `yaml:"mongo"`
}

type SecretDatabaseMongo

type SecretDatabaseMongo struct {
}

type SecretDatabasePostgres

type SecretDatabasePostgres struct {
	User     string `yaml:"user"`
	Password string `yaml:"password"`
}

type Service

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

func NewService

func NewService(configFile, secretFile string) (*Service, error)

func (Service) GetAvatarConfig

func (s Service) GetAvatarConfig() (*ConfigService, error)

func (Service) GetMongoConfig

func (s Service) GetMongoConfig(name string) (*ConfigDatabaseMongo, error)

func (Service) GetMongoSecret

func (s Service) GetMongoSecret(name string) (*SecretDatabaseMongo, error)

func (Service) GetPostgresConfig

func (s Service) GetPostgresConfig(name string) (*ConfigDatabasePostgres, error)

func (Service) GetPostgresSecret

func (s Service) GetPostgresSecret(name string) (*SecretDatabasePostgres, error)

type TypeCfg

type TypeCfg string
const (
	YAML TypeCfg = "yaml"
	ENV  TypeCfg = "env"
)

type TypeDB

type TypeDB string
const (
	MONGO    TypeDB = "mongo"
	POSTGRES TypeDB = "postgres"
)

Jump to

Keyboard shortcuts

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