conf

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_conf_conf_proto protoreflect.FileDescriptor
View Source
var ProviderSetConf = wire.NewSet(
	wire.FieldsOf(new(*Bootstrap), "Server"),
	wire.FieldsOf(new(*Bootstrap), "Data"),
	wire.FieldsOf(new(*Bootstrap), "Env"),
	wire.FieldsOf(new(*Bootstrap), "Log"),
	wire.FieldsOf(new(*Bootstrap), "ApiWhite"),
	wire.Bind(new(plog.Config), new(*Log)),
	LoadConfig,
)

ProviderSetConf is conf providers.

Functions

This section is empty.

Types

type ApiWhite

type ApiWhite struct {
	JwtApi  []string `protobuf:"bytes,1,rep,name=jwtApi,proto3" json:"jwtApi,omitempty"`
	RbacApi []string `protobuf:"bytes,2,rep,name=rbacApi,proto3" json:"rbacApi,omitempty"`
	All     []string `protobuf:"bytes,3,rep,name=all,proto3" json:"all,omitempty"`
	// contains filtered or unexported fields
}

func (*ApiWhite) Descriptor deprecated

func (*ApiWhite) Descriptor() ([]byte, []int)

Deprecated: Use ApiWhite.ProtoReflect.Descriptor instead.

func (*ApiWhite) GetAll

func (x *ApiWhite) GetAll() []string

func (*ApiWhite) GetJwtApi

func (x *ApiWhite) GetJwtApi() []string

func (*ApiWhite) GetRbacApi

func (x *ApiWhite) GetRbacApi() []string

func (*ApiWhite) ProtoMessage

func (*ApiWhite) ProtoMessage()

func (*ApiWhite) ProtoReflect

func (x *ApiWhite) ProtoReflect() protoreflect.Message

func (*ApiWhite) Reset

func (x *ApiWhite) Reset()

func (*ApiWhite) String

func (x *ApiWhite) String() string

type Before

type Before func(bc *Bootstrap) error

type Bootstrap

type Bootstrap struct {
	Server   *Server   `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"`
	Data     *Data     `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	Env      *Env      `protobuf:"bytes,3,opt,name=env,proto3" json:"env,omitempty"`
	Log      *Log      `protobuf:"bytes,4,opt,name=log,proto3" json:"log,omitempty"`
	ApiWhite *ApiWhite `protobuf:"bytes,5,opt,name=apiWhite,proto3" json:"apiWhite,omitempty"`
	Email    *Email    `protobuf:"bytes,6,opt,name=email,proto3" json:"email,omitempty"`
	Mq       *MQ       `protobuf:"bytes,7,opt,name=mq,proto3" json:"mq,omitempty"`
	// contains filtered or unexported fields
}

func LoadConfig

func LoadConfig(flagConf *string, before Before) (*Bootstrap, error)

func (*Bootstrap) Descriptor deprecated

func (*Bootstrap) Descriptor() ([]byte, []int)

Deprecated: Use Bootstrap.ProtoReflect.Descriptor instead.

func (*Bootstrap) GetApiWhite

func (x *Bootstrap) GetApiWhite() *ApiWhite

func (*Bootstrap) GetData

func (x *Bootstrap) GetData() *Data

func (*Bootstrap) GetEmail

func (x *Bootstrap) GetEmail() *Email

func (*Bootstrap) GetEnv

func (x *Bootstrap) GetEnv() *Env

func (*Bootstrap) GetLog

func (x *Bootstrap) GetLog() *Log

func (*Bootstrap) GetMq

func (x *Bootstrap) GetMq() *MQ

func (*Bootstrap) GetServer

func (x *Bootstrap) GetServer() *Server

func (*Bootstrap) ProtoMessage

func (*Bootstrap) ProtoMessage()

func (*Bootstrap) ProtoReflect

func (x *Bootstrap) ProtoReflect() protoreflect.Message

func (*Bootstrap) Reset

func (x *Bootstrap) Reset()

func (*Bootstrap) String

func (x *Bootstrap) String() string

type Data

type Data struct {
	Database *Data_Database `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"`
	Redis    *Data_Redis    `protobuf:"bytes,2,opt,name=redis,proto3" json:"redis,omitempty"`
	// contains filtered or unexported fields
}

func (*Data) Descriptor deprecated

func (*Data) Descriptor() ([]byte, []int)

Deprecated: Use Data.ProtoReflect.Descriptor instead.

func (*Data) GetDatabase

func (x *Data) GetDatabase() *Data_Database

func (*Data) GetRedis

func (x *Data) GetRedis() *Data_Redis

func (*Data) ProtoMessage

func (*Data) ProtoMessage()

func (*Data) ProtoReflect

func (x *Data) ProtoReflect() protoreflect.Message

func (*Data) Reset

func (x *Data) Reset()

func (*Data) String

func (x *Data) String() string

type Data_Database

type Data_Database struct {
	Driver string `protobuf:"bytes,1,opt,name=driver,proto3" json:"driver,omitempty"`
	Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"`
	Debug  bool   `protobuf:"varint,3,opt,name=debug,proto3" json:"debug,omitempty"`
	// contains filtered or unexported fields
}

func (*Data_Database) Descriptor deprecated

func (*Data_Database) Descriptor() ([]byte, []int)

Deprecated: Use Data_Database.ProtoReflect.Descriptor instead.

func (*Data_Database) GetDebug

func (x *Data_Database) GetDebug() bool

func (*Data_Database) GetDriver

func (x *Data_Database) GetDriver() string

func (*Data_Database) GetSource

func (x *Data_Database) GetSource() string

func (*Data_Database) ProtoMessage

func (*Data_Database) ProtoMessage()

func (*Data_Database) ProtoReflect

func (x *Data_Database) ProtoReflect() protoreflect.Message

func (*Data_Database) Reset

func (x *Data_Database) Reset()

func (*Data_Database) String

func (x *Data_Database) String() string

type Data_Redis

type Data_Redis struct {
	Network      string               `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"`
	Addr         string               `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"`
	ReadTimeout  *durationpb.Duration `protobuf:"bytes,3,opt,name=readTimeout,proto3" json:"readTimeout,omitempty"`
	WriteTimeout *durationpb.Duration `protobuf:"bytes,4,opt,name=writeTimeout,proto3" json:"writeTimeout,omitempty"`
	Db           uint32               `protobuf:"varint,5,opt,name=db,proto3" json:"db,omitempty"`
	Password     string               `protobuf:"bytes,6,opt,name=password,proto3" json:"password,omitempty"`
	DialTimeout  *durationpb.Duration `protobuf:"bytes,7,opt,name=dialTimeout,proto3" json:"dialTimeout,omitempty"`
	// contains filtered or unexported fields
}

func (*Data_Redis) Descriptor deprecated

func (*Data_Redis) Descriptor() ([]byte, []int)

Deprecated: Use Data_Redis.ProtoReflect.Descriptor instead.

func (*Data_Redis) GetAddr

func (x *Data_Redis) GetAddr() string

func (*Data_Redis) GetDb

func (x *Data_Redis) GetDb() uint32

func (*Data_Redis) GetDialTimeout

func (x *Data_Redis) GetDialTimeout() *durationpb.Duration

func (*Data_Redis) GetNetwork

func (x *Data_Redis) GetNetwork() string

func (*Data_Redis) GetPassword

func (x *Data_Redis) GetPassword() string

func (*Data_Redis) GetReadTimeout

func (x *Data_Redis) GetReadTimeout() *durationpb.Duration

func (*Data_Redis) GetWriteTimeout

func (x *Data_Redis) GetWriteTimeout() *durationpb.Duration

func (*Data_Redis) ProtoMessage

func (*Data_Redis) ProtoMessage()

func (*Data_Redis) ProtoReflect

func (x *Data_Redis) ProtoReflect() protoreflect.Message

func (*Data_Redis) Reset

func (x *Data_Redis) Reset()

func (*Data_Redis) String

func (x *Data_Redis) String() string

type Email

type Email struct {
	Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"`
	Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"`
	User string `protobuf:"bytes,3,opt,name=user,proto3" json:"user,omitempty"`
	Pass string `protobuf:"bytes,4,opt,name=pass,proto3" json:"pass,omitempty"`
	// contains filtered or unexported fields
}

func (*Email) Descriptor deprecated

func (*Email) Descriptor() ([]byte, []int)

Deprecated: Use Email.ProtoReflect.Descriptor instead.

func (*Email) GetHost

func (x *Email) GetHost() string

func (*Email) GetPass

func (x *Email) GetPass() string

func (*Email) GetPort

func (x *Email) GetPort() uint32

func (*Email) GetUser

func (x *Email) GetUser() string

func (*Email) ProtoMessage

func (*Email) ProtoMessage()

func (*Email) ProtoReflect

func (x *Email) ProtoReflect() protoreflect.Message

func (*Email) Reset

func (x *Email) Reset()

func (*Email) String

func (x *Email) String() string

type Env

type Env struct {
	Name      string            `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Metadata  map[string]string `` /* 157-byte string literal not displayed */
	Version   string            `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"`
	Namespace string            `protobuf:"bytes,4,opt,name=namespace,proto3" json:"namespace,omitempty"`
	Env       string            `protobuf:"bytes,5,opt,name=env,proto3" json:"env,omitempty"`
	// contains filtered or unexported fields
}

func (*Env) Descriptor deprecated

func (*Env) Descriptor() ([]byte, []int)

Deprecated: Use Env.ProtoReflect.Descriptor instead.

func (*Env) GetEnv

func (x *Env) GetEnv() string

func (*Env) GetMetadata

func (x *Env) GetMetadata() map[string]string

func (*Env) GetName

func (x *Env) GetName() string

func (*Env) GetNamespace

func (x *Env) GetNamespace() string

func (*Env) GetVersion

func (x *Env) GetVersion() string

func (*Env) ProtoMessage

func (*Env) ProtoMessage()

func (*Env) ProtoReflect

func (x *Env) ProtoReflect() protoreflect.Message

func (*Env) Reset

func (x *Env) Reset()

func (*Env) String

func (x *Env) String() string

type Kafka

type Kafka struct {
	Endpoints []string `protobuf:"bytes,1,rep,name=endpoints,proto3" json:"endpoints,omitempty"`
	GroupId   string   `protobuf:"bytes,2,opt,name=groupId,proto3" json:"groupId,omitempty"`
	// contains filtered or unexported fields
}

func (*Kafka) Descriptor deprecated

func (*Kafka) Descriptor() ([]byte, []int)

Deprecated: Use Kafka.ProtoReflect.Descriptor instead.

func (*Kafka) GetEndpoints

func (x *Kafka) GetEndpoints() []string

func (*Kafka) GetGroupId

func (x *Kafka) GetGroupId() string

func (*Kafka) ProtoMessage

func (*Kafka) ProtoMessage()

func (*Kafka) ProtoReflect

func (x *Kafka) ProtoReflect() protoreflect.Message

func (*Kafka) Reset

func (x *Kafka) Reset()

func (*Kafka) String

func (x *Kafka) String() string

type Log

type Log struct {

	// 默认: ./server.log
	Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"`
	// 日志最大体积MB, 默认: 100MB
	MaxSize int32 `protobuf:"varint,2,opt,name=maxSize,proto3" json:"maxSize,omitempty"`
	// 日志保留天数, 默认: 7
	MaxAge int32 `protobuf:"varint,3,opt,name=maxAge,proto3" json:"maxAge,omitempty"`
	// 日志保留个数, 默认: 10
	MaxBackups int32 `protobuf:"varint,4,opt,name=maxBackups,proto3" json:"maxBackups,omitempty"`
	// 是否压缩, 默认: true
	Compress bool `protobuf:"varint,5,opt,name=compress,proto3" json:"compress,omitempty"`
	// 是否使用本地时间戳, 默认: true
	LocalTime bool `protobuf:"varint,6,opt,name=localTime,proto3" json:"localTime,omitempty"`
	// 日志级别, 默认: info
	Level string `protobuf:"bytes,7,opt,name=level,proto3" json:"level,omitempty"`
	// Encoder 类型: console | json, 默认: console
	Encoder string `protobuf:"bytes,8,opt,name=encoder,proto3" json:"encoder,omitempty"`
	// contains filtered or unexported fields
}

func (*Log) Descriptor deprecated

func (*Log) Descriptor() ([]byte, []int)

Deprecated: Use Log.ProtoReflect.Descriptor instead.

func (*Log) GetCompress

func (x *Log) GetCompress() bool

func (*Log) GetEncoder

func (x *Log) GetEncoder() string

func (*Log) GetFilename

func (x *Log) GetFilename() string

func (*Log) GetLevel

func (x *Log) GetLevel() string

func (*Log) GetLocalTime

func (x *Log) GetLocalTime() bool

func (*Log) GetMaxAge

func (x *Log) GetMaxAge() int32

func (*Log) GetMaxBackups

func (x *Log) GetMaxBackups() int32

func (*Log) GetMaxSize

func (x *Log) GetMaxSize() int32

func (*Log) ProtoMessage

func (*Log) ProtoMessage()

func (*Log) ProtoReflect

func (x *Log) ProtoReflect() protoreflect.Message

func (*Log) Reset

func (x *Log) Reset()

func (*Log) String

func (x *Log) String() string

type MQ

type MQ struct {
	Kafka *Kafka `protobuf:"bytes,1,opt,name=kafka,proto3" json:"kafka,omitempty"`
	// contains filtered or unexported fields
}

func (*MQ) Descriptor deprecated

func (*MQ) Descriptor() ([]byte, []int)

Deprecated: Use MQ.ProtoReflect.Descriptor instead.

func (*MQ) GetKafka

func (x *MQ) GetKafka() *Kafka

func (*MQ) ProtoMessage

func (*MQ) ProtoMessage()

func (*MQ) ProtoReflect

func (x *MQ) ProtoReflect() protoreflect.Message

func (*MQ) Reset

func (x *MQ) Reset()

func (*MQ) String

func (x *MQ) String() string

type Server

type Server struct {
	Http *Server_HTTP `protobuf:"bytes,1,opt,name=http,proto3" json:"http,omitempty"`
	Grpc *Server_GRPC `protobuf:"bytes,2,opt,name=grpc,proto3" json:"grpc,omitempty"`
	Ws   *Server_WS   `protobuf:"bytes,3,opt,name=ws,proto3" json:"ws,omitempty"`
	// contains filtered or unexported fields
}

func (*Server) Descriptor deprecated

func (*Server) Descriptor() ([]byte, []int)

Deprecated: Use Server.ProtoReflect.Descriptor instead.

func (*Server) GetGrpc

func (x *Server) GetGrpc() *Server_GRPC

func (*Server) GetHttp

func (x *Server) GetHttp() *Server_HTTP

func (*Server) GetWs

func (x *Server) GetWs() *Server_WS

func (*Server) ProtoMessage

func (*Server) ProtoMessage()

func (*Server) ProtoReflect

func (x *Server) ProtoReflect() protoreflect.Message

func (*Server) Reset

func (x *Server) Reset()

func (*Server) String

func (x *Server) String() string

type Server_GRPC

type Server_GRPC struct {
	Network string               `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"`
	Addr    string               `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"`
	Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"`
	// contains filtered or unexported fields
}

func (*Server_GRPC) Descriptor deprecated

func (*Server_GRPC) Descriptor() ([]byte, []int)

Deprecated: Use Server_GRPC.ProtoReflect.Descriptor instead.

func (*Server_GRPC) GetAddr

func (x *Server_GRPC) GetAddr() string

func (*Server_GRPC) GetNetwork

func (x *Server_GRPC) GetNetwork() string

func (*Server_GRPC) GetTimeout

func (x *Server_GRPC) GetTimeout() *durationpb.Duration

func (*Server_GRPC) ProtoMessage

func (*Server_GRPC) ProtoMessage()

func (*Server_GRPC) ProtoReflect

func (x *Server_GRPC) ProtoReflect() protoreflect.Message

func (*Server_GRPC) Reset

func (x *Server_GRPC) Reset()

func (*Server_GRPC) String

func (x *Server_GRPC) String() string

type Server_HTTP

type Server_HTTP struct {
	Network string               `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"`
	Addr    string               `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"`
	Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"`
	// contains filtered or unexported fields
}

func (*Server_HTTP) Descriptor deprecated

func (*Server_HTTP) Descriptor() ([]byte, []int)

Deprecated: Use Server_HTTP.ProtoReflect.Descriptor instead.

func (*Server_HTTP) GetAddr

func (x *Server_HTTP) GetAddr() string

func (*Server_HTTP) GetNetwork

func (x *Server_HTTP) GetNetwork() string

func (*Server_HTTP) GetTimeout

func (x *Server_HTTP) GetTimeout() *durationpb.Duration

func (*Server_HTTP) ProtoMessage

func (*Server_HTTP) ProtoMessage()

func (*Server_HTTP) ProtoReflect

func (x *Server_HTTP) ProtoReflect() protoreflect.Message

func (*Server_HTTP) Reset

func (x *Server_HTTP) Reset()

func (*Server_HTTP) String

func (x *Server_HTTP) String() string

type Server_WS

type Server_WS struct {
	Network string               `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"`
	Addr    string               `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"`
	Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"`
	// contains filtered or unexported fields
}

func (*Server_WS) Descriptor deprecated

func (*Server_WS) Descriptor() ([]byte, []int)

Deprecated: Use Server_WS.ProtoReflect.Descriptor instead.

func (*Server_WS) GetAddr

func (x *Server_WS) GetAddr() string

func (*Server_WS) GetNetwork

func (x *Server_WS) GetNetwork() string

func (*Server_WS) GetTimeout

func (x *Server_WS) GetTimeout() *durationpb.Duration

func (*Server_WS) ProtoMessage

func (*Server_WS) ProtoMessage()

func (*Server_WS) ProtoReflect

func (x *Server_WS) ProtoReflect() protoreflect.Message

func (*Server_WS) Reset

func (x *Server_WS) Reset()

func (*Server_WS) String

func (x *Server_WS) String() string

Jump to

Keyboard shortcuts

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