infras

package
v0.0.0-...-e9f4405 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MinIODefaultOpt = &MinIOOption{
	Endpoint:        configs.MinioHost,
	AccessKeyId:     configs.AccessKeyId,
	SecretAccessKey: configs.SecretAccessKey,
}
View Source
var MysqlDefaultOption = &MysqlOption{
	MaxConn:     2,
	MaxLifetime: 1 * time.Minute,
}

Functions

func NewMinioClient

func NewMinioClient() (*minio.Client, error)

func NewMinioClientWithOptions

func NewMinioClientWithOptions(optFns ...MinIOOptFunction) (*minio.Client, error)

func WithDSN

func WithDSN(dsn string) optionFn

func WithLifetime

func WithLifetime(minus time.Duration) optionFn

func WithMaxConn

func WithMaxConn(conns int) optionFn

Types

type MinIOOptFunction

type MinIOOptFunction func(opt *MinIOOption) *MinIOOption

func WithAccessKeyId

func WithAccessKeyId(accessKeyId string) MinIOOptFunction

func WithEndPoint

func WithEndPoint(endPoint string) MinIOOptFunction

func WithSecretAccessKey

func WithSecretAccessKey(secretAccessKey string) MinIOOptFunction

func WithUseSSL

func WithUseSSL(useSSL bool) MinIOOptFunction

type MinIOOption

type MinIOOption struct {
	Endpoint        string
	AccessKeyId     string
	SecretAccessKey string
	UseSSL          bool
}

type MysqlConnector

type MysqlConnector struct {
	Client *gorm.DB
}

func MysqlConnectionBuilder

func MysqlConnectionBuilder(fns ...optionFn) *MysqlConnector

func NewMysqlConnector

func NewMysqlConnector() *MysqlConnector

type MysqlOption

type MysqlOption struct {
	DSN         string
	MaxConn     int
	MaxLifetime time.Duration
}

Jump to

Keyboard shortcuts

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