pkg

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetConfig

func SetConfig(config Config)

Types

type Config

type Config struct {
	Env     Env           `json:"env" yaml:"env"`
	Logger  logger.Config `json:"logger" yaml:"logger"`
	MQ      MQ            `json:"rabbitmq" yaml:"rabbitmq"`
	Trace   Trace         `json:"trace" yaml:"trace"`
	Oss     oss.Oss       `json:"oss" yaml:"oss"`
	Jwt     jwt.Jwt       `json:"jwt" yaml:"jwt"`
	Wechat  wechat.Config `json:"wechat" yaml:"wechat"`
	TopScrm ScrmTop       `json:"scrmTop" yaml:"scrmTop"`
}

func GetConfig

func GetConfig() Config

type Data

type Data struct {
	Db     mysql.DB    `json:"db" yaml:"db"`
	Retail mysql.DB    `json:"retail" yaml:"retail"`
	Redis  redis.Redis `json:"redis" yaml:"redis"`
}

type Env

type Env struct {
	AppId      string `json:"appId" yaml:"appId"`
	AppName    string `json:"appName" yaml:"appName"`
	AppVersion string `json:"appVersion" yaml:"appVersion"`
	AppEnv     string `json:"appEnv" yaml:"appEnv"`
}

type Jaeger

type Jaeger struct {
	EndPoint string `json:"endPoint" yaml:"endPoint"`
}

type MQ

type MQ struct {
	RabbitMQ rabbitmq.Config `json:"rabbitMQ"`
	RedisMQ  redis.MQConfig  `json:"redisMQ"`
}

type Option

type Option func(*Pkg)

func WithJwt

func WithJwt() Option

WithJwt 返回Jwt的实例

func WithMiniApp

func WithMiniApp() Option

WithMiniApp 返回小程序的实例

func WithOss

func WithOss() Option

WithOss 返回OSS的实例

type Pkg

type Pkg struct {
	Jwt     *jwt.Instance
	Oss     *oss.AliYunOss
	MiniApp *wechat.MiniApp
	// contains filtered or unexported fields
}

func NewPkg

func NewPkg(opt ...Option) *Pkg

NewPkg Pkg实例

type ScrmTop

type ScrmTop struct {
	AppKey          string `json:"appKey" yaml:"appKey"`
	AppSecret       string `json:"appSecret" yaml:"appSecret"`
	ServerUrl       string `json:"serverUrl" yaml:"serverUrl"`
	ConnectTimeount int64  `json:"connectTimeount" yaml:"connectTimeount"`
	ReadTimeout     int64  `json:"readTimeout" yaml:"readTimeout"`
}

type Trace

type Trace struct {
	Jaeger Jaeger `json:"jaeger" yaml:"jaeger"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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