bootstrap

package
v0.0.0-...-1a384c3 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: Unlicense Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Chatset             = "utf8mb4"
	DefaultDialTimeout  = 1000
	DefaultReadTimeout  = 3000
	DefaultWriteTimeout = 3000
	DefaultMaxIdleConns = 50
	DefaultMaxOpenConns = 100
	DefaultMaxLifeTime  = 3600000
)

Variables

This section is empty.

Functions

func NewDiscovery

func NewDiscovery(conf *conf.Registry) registry.Discovery

func NewGORM

func NewGORM(conf *conf.Bootstrap) *gorm.DB

func NewGRPCServer

func NewGRPCServer(c *conf.Server, logger log.Logger, ms ...middleware.Middleware) *grpc.Server

NewGRPCServer new a gRPC server.

func NewLogger

func NewLogger(psm, id, version string, config *conf.Bootstrap) log.Logger

func NewLogrusHook

func NewLogrusHook(psm string) logrus.Hook

func NewLogrusLogger

func NewLogrusLogger(psm string, config *conf.Bootstrap) log.Logger

func NewMetric

func NewMetric() *metrics.Metrics

func NewRedisClient

func NewRedisClient(conf *conf.Bootstrap) *redis.Client

func NewRegistrar

func NewRegistrar(conf *conf.Registry) registry.Registrar

func NewSQLClient

func NewSQLClient(conf *conf.Bootstrap) (*sql.DB, func(), error)

func NewTrace

func NewTrace(bc *conf.Bootstrap) *tracing.Tracer

Types

type LogrusHook

type LogrusHook struct {
	Id string
	Ip string
	// contains filtered or unexported fields
}

func (LogrusHook) Fire

func (l LogrusHook) Fire(entry *logrus.Entry) error

func (LogrusHook) Levels

func (l LogrusHook) Levels() []logrus.Level

Jump to

Keyboard shortcuts

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