singleton

package module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option added in v1.0.1

type Option func(*Singleton) error

func WithPGSQL added in v1.0.4

func WithPGSQL(options PGSQLOptions) Option

func WithRedisClient added in v1.0.1

func WithRedisClient(options *redis.Options) Option

func WithViper added in v1.0.3

func WithViper(options ViperOptions) Option

type PGSQLOptions added in v1.0.4

type PGSQLOptions struct {
	Source          string
	MaxConns        int32
	MaxConnIdleTime time.Duration
}

type Singleton added in v1.0.1

type Singleton struct {
	Redis  *redis.Client
	Viper  *viper.Viper
	PGPool *pgxpool.Pool
}

func (*Singleton) AddPlugin added in v1.0.2

func (s *Singleton) AddPlugin(opts ...Option) (err error)

type ViperOptions added in v1.0.3

type ViperOptions struct {
	Path     string // path to look for the config file in, absolute path start with / and relative path start with .
	FileName string // name of config file (without extension)
	FileType string // REQUIRED if the config file does not have the extension in the name
	EnvName  string // Env to read from the config file
	Target   any
}

Jump to

Keyboard shortcuts

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