postgresconfig5

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigFileName = "postgres-config.toml"

Variables

View Source
var (
	Provider       = wire.NewSet(Loading) // Provider
	ConfigFullPath = ""                   // ConfigFullPath
)

Functions

func SaveTOML

func SaveTOML(v interface{}, filename string) error

SaveTOML save interface to TOML file

func WriteToFile

func WriteToFile(c []byte, filename string) error

WriteToFile write []byte to file

Types

type Option

type Option func(*PostgresConfig)

Option ProxyOption options

func WithApplicationName

func WithApplicationName(name string) Option

func WithDatabase

func WithDatabase(dbname string) Option

WithDatabase with

func WithDebug

func WithDebug(l bool) Option

WithDebug debug

func WithHost

func WithHost(host string, port uint16) Option

WithHost new server port in string

func WithLogLevel

func WithLogLevel(level tracelog.LogLevel) Option

WithLogLevel new server port in string

func WithRuntimeParams

func WithRuntimeParams(r map[string]string) Option

WithRuntimeParams options

func WithUserPassword

func WithUserPassword(user, password string) Option

WithUserPassword options

type PostgresConfig

type PostgresConfig struct {
	ApplicationName string
	RuntimeParams   map[string]string
	Database        string
	User            string
	Password        string
	Host            string
	PoolConnections string
	LogLevel        tracelog.LogLevel
	Port            uint16
	Debug           bool
}

PostgresConfig postgres configuration

func Load

func Load(f string) (*PostgresConfig, error)

Load load

func Loading

func Loading() (*PostgresConfig, error)

Loading configuration

func New

func New(opts ...Option) *PostgresConfig

New postgres config

func (*PostgresConfig) SetLogLevel

func (p *PostgresConfig) SetLogLevel(level tracelog.LogLevel)

SetLogLevel set logger

Jump to

Keyboard shortcuts

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