def

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Log_LogLevelEnum_name = map[int32]string{
		0: "LOG_LEVEL_UNSPECIFIED",
		1: "DEBUG",
		2: "INFO",
		3: "WARN",
		4: "ERROR",
		5: "FATAL",
	}
	Log_LogLevelEnum_value = map[string]int32{
		"LOG_LEVEL_UNSPECIFIED": 0,
		"DEBUG":                 1,
		"INFO":                  2,
		"WARN":                  3,
		"ERROR":                 4,
		"FATAL":                 5,
	}
)

Enum value maps for Log_LogLevelEnum.

View Source
var File_config_def_default_v1_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Server       *Server  `conf_path:"/basic/config"`               // 服务的地址配置,包括监听的地址,端口等
	Registry     Registry `conf_path:"/basic/online"`               // 其他在线服务
	Profile      Profile  `conf_path:"/basic/profile/config"`       // 性能分析配置
	Log          Log      `conf_path:"/middleware/log/config"`      // 服务的日志配置
	Redis        Redis    `conf_path:"/middleware/redis/config"`    // Redis 配置
	Mongo        Mongo    `conf_path:"/middleware/mongodb/config"`  // MongoDB 配置
	Database     Database `conf_path:"/middleware/database/config"` // MySQL 配置
	MessageQueue RabbitMQ `conf_path:"/middleware/rabbitmq/config"` // RabbitMQ 配置
	Tracing      Tracing  `conf_path:"/middleware/tracing/config"`  // 链路跟踪配置
}

func NewConfiguration

func NewConfiguration(config config.ConfigureWatcherRepo) (*Configuration, error)

NewConfiguration 创建一个新的配置实例,该实例支持热更新等能力, 为了保证全局统一,该实例为单例模式 注意:一般情况下业务系统会在基础配置上再添加自定义的配置

type ConsumeConfig

type ConsumeConfig struct {
	Name             string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`                                                    // 消费者的名称
	AutoAck          bool   `protobuf:"varint,2,opt,name=auto_ack,json=autoAck,proto3" json:"auto_ack,omitempty"`                              // 是否自动提交 ACK
	NoWait           bool   `protobuf:"varint,3,opt,name=no_wait,json=noWait,proto3" json:"no_wait,omitempty"`                                 // 是否不等待连接完成, 一般设置为 false
	QosPrefetchSize  int32  `protobuf:"varint,4,opt,name=qos_prefetch_size,json=qosPrefetchSize,proto3" json:"qos_prefetch_size,omitempty"`    // 允许缓冲在内存的消息数,默认为 0, 只有在存在大量消息需要消费时使用,用于提高吞吐量
	QosPrefetchCount int32  `protobuf:"varint,5,opt,name=qos_prefetch_count,json=qosPrefetchCount,proto3" json:"qos_prefetch_count,omitempty"` // 允许缓冲在内存的字节数,默认为 0,一般不做配置
	// contains filtered or unexported fields
}

func (*ConsumeConfig) Descriptor deprecated

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

Deprecated: Use ConsumeConfig.ProtoReflect.Descriptor instead.

func (*ConsumeConfig) GetAutoAck

func (x *ConsumeConfig) GetAutoAck() bool

func (*ConsumeConfig) GetName

func (x *ConsumeConfig) GetName() string

func (*ConsumeConfig) GetNoWait

func (x *ConsumeConfig) GetNoWait() bool

func (*ConsumeConfig) GetQosPrefetchCount

func (x *ConsumeConfig) GetQosPrefetchCount() int32

func (*ConsumeConfig) GetQosPrefetchSize

func (x *ConsumeConfig) GetQosPrefetchSize() int32

func (*ConsumeConfig) ProtoMessage

func (*ConsumeConfig) ProtoMessage()

func (*ConsumeConfig) ProtoReflect

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

func (*ConsumeConfig) Reset

func (x *ConsumeConfig) Reset()

func (*ConsumeConfig) String

func (x *ConsumeConfig) String() string

type Data

type Data struct {
	Database *Database `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"`
	Redis    *Redis    `protobuf:"bytes,2,opt,name=redis,proto3" json:"redis,omitempty"`
	Mongodb  *Mongo    `protobuf:"bytes,3,opt,name=mongodb,proto3" json:"mongodb,omitempty"`
	RabbitMq *RabbitMQ `protobuf:"bytes,4,opt,name=rabbitMq,proto3" json:"rabbitMq,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() *Database

func (*Data) GetMongodb

func (x *Data) GetMongodb() *Mongo

func (*Data) GetRabbitMq

func (x *Data) GetRabbitMq() *RabbitMQ

func (*Data) GetRedis

func (x *Data) GetRedis() *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 Database

type Database struct {
	Enable          bool                 `protobuf:"varint,9,opt,name=enable,proto3" json:"enable,omitempty"`
	Driver          string               `protobuf:"bytes,10,opt,name=driver,proto3" json:"driver,omitempty"` // 数据库的驱动,用于支持不同的数据库引擎, 如 mysql/sqlite/pgx
	Addr            string               `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"`      // 数据库链接地址, 包含了地址/用户名/密码及数据库
	Database        string               `protobuf:"bytes,2,opt,name=database,proto3" json:"database,omitempty"`
	MaxPoolIdleSize uint64               `protobuf:"varint,4,opt,name=max_pool_idle_size,json=maxPoolIdleSize,proto3" json:"max_pool_idle_size,omitempty"` // 最大空闲连接
	MaxConnection   uint64               `protobuf:"varint,6,opt,name=max_connection,json=maxConnection,proto3" json:"max_connection,omitempty"`           // 最大连接数
	ConnMaxLifetime *durationpb.Duration `protobuf:"bytes,7,opt,name=conn_max_lifetime,json=connMaxLifetime,proto3" json:"conn_max_lifetime,omitempty"`
	ConnMaxIdleTime *durationpb.Duration `protobuf:"bytes,8,opt,name=conn_max_idle_time,json=connMaxIdleTime,proto3" json:"conn_max_idle_time,omitempty"`
	// contains filtered or unexported fields
}

func (*Database) Descriptor deprecated

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

Deprecated: Use Database.ProtoReflect.Descriptor instead.

func (*Database) GetAddr

func (x *Database) GetAddr() string

func (*Database) GetConnMaxIdleTime

func (x *Database) GetConnMaxIdleTime() *durationpb.Duration

func (*Database) GetConnMaxLifetime

func (x *Database) GetConnMaxLifetime() *durationpb.Duration

func (*Database) GetDatabase

func (x *Database) GetDatabase() string

func (*Database) GetDriver

func (x *Database) GetDriver() string

func (*Database) GetEnable

func (x *Database) GetEnable() bool

func (*Database) GetMaxConnection

func (x *Database) GetMaxConnection() uint64

func (*Database) GetMaxPoolIdleSize

func (x *Database) GetMaxPoolIdleSize() uint64

func (*Database) ProtoMessage

func (*Database) ProtoMessage()

func (*Database) ProtoReflect

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

func (*Database) Reset

func (x *Database) Reset()

func (*Database) String

func (x *Database) String() string

type ExchangeConfig

type ExchangeConfig struct {
	Name       string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`                                // 交换机名称
	Kind       string `protobuf:"bytes,2,opt,name=kind,proto3" json:"kind,omitempty"`                                // 交换机类型,direct/fanout/topic/header , 一般只需要用到前三者
	Durable    bool   `protobuf:"varint,3,opt,name=durable,proto3" json:"durable,omitempty"`                         // 交换机是否持久化, 持久化的交换机在重启后不会丢失
	AutoDelete bool   `protobuf:"varint,4,opt,name=auto_delete,json=autoDelete,proto3" json:"auto_delete,omitempty"` // 交换机的是否会在消费后自动删除, 设置为 false 的话能够更好的保存数据,并在全局层面进行管理
	// contains filtered or unexported fields
}

func (*ExchangeConfig) Descriptor deprecated

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

Deprecated: Use ExchangeConfig.ProtoReflect.Descriptor instead.

func (*ExchangeConfig) GetAutoDelete

func (x *ExchangeConfig) GetAutoDelete() bool

func (*ExchangeConfig) GetDurable

func (x *ExchangeConfig) GetDurable() bool

func (*ExchangeConfig) GetKind

func (x *ExchangeConfig) GetKind() string

func (*ExchangeConfig) GetName

func (x *ExchangeConfig) GetName() string

func (*ExchangeConfig) ProtoMessage

func (*ExchangeConfig) ProtoMessage()

func (*ExchangeConfig) ProtoReflect

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

func (*ExchangeConfig) Reset

func (x *ExchangeConfig) Reset()

func (*ExchangeConfig) String

func (x *ExchangeConfig) String() string

type Log

type Log struct {

	// Console 输出到控制台
	Console *Log_Console `protobuf:"bytes,1,opt,name=console,proto3" json:"console,omitempty"`
	// Graylog 输出到文件
	Graylog *Log_Graylog `protobuf:"bytes,2,opt,name=graylog,proto3" json:"graylog,omitempty"`
	// File 输出到文件
	File *Log_File `protobuf:"bytes,3,opt,name=file,proto3" json:"file,omitempty"`
	// contains filtered or unexported fields
}

Log 日志

func (*Log) Descriptor deprecated

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

Deprecated: Use Log.ProtoReflect.Descriptor instead.

func (*Log) GetConsole

func (x *Log) GetConsole() *Log_Console

func (*Log) GetFile

func (x *Log) GetFile() *Log_File

func (*Log) GetGraylog

func (x *Log) GetGraylog() *Log_Graylog

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 Log_Console

type Log_Console struct {

	// enable 是否启用
	Enable         bool   `protobuf:"varint,1,opt,name=enable,proto3" json:"enable,omitempty"`
	Level          string `protobuf:"bytes,2,opt,name=level,proto3" json:"level,omitempty"`
	UseJsonEncoder bool   `protobuf:"varint,3,opt,name=use_json_encoder,json=useJsonEncoder,proto3" json:"use_json_encoder,omitempty"`
	// contains filtered or unexported fields
}

Console 输出到控制台

func (*Log_Console) Descriptor deprecated

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

Deprecated: Use Log_Console.ProtoReflect.Descriptor instead.

func (*Log_Console) GetEnable

func (x *Log_Console) GetEnable() bool

func (*Log_Console) GetLevel

func (x *Log_Console) GetLevel() string

func (*Log_Console) GetUseJsonEncoder

func (x *Log_Console) GetUseJsonEncoder() bool

func (*Log_Console) ProtoMessage

func (*Log_Console) ProtoMessage()

func (*Log_Console) ProtoReflect

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

func (*Log_Console) Reset

func (x *Log_Console) Reset()

func (*Log_Console) String

func (x *Log_Console) String() string

type Log_File

type Log_File struct {

	// enable 是否启用
	Enable bool   `protobuf:"varint,1,opt,name=enable,proto3" json:"enable,omitempty"`
	Level  string `protobuf:"bytes,2,opt,name=level,proto3" json:"level,omitempty"`
	// dir 存储目录
	Dir string `protobuf:"bytes,3,opt,name=dir,proto3" json:"dir,omitempty"`
	// filename 文件名(默认:${filename}_app.%Y%m%d%H%M%S.log)
	Filename string `protobuf:"bytes,4,opt,name=filename,proto3" json:"filename,omitempty"`
	// rotate_time 轮询规则:n久(默认:86400s # 86400s = 1天)
	// 轮询规则:默认为:rotate_time
	RotateTime *durationpb.Duration `protobuf:"bytes,5,opt,name=rotate_time,json=rotateTime,proto3" json:"rotate_time,omitempty"`
	// rotate_size 轮询规则:按文件大小(默认:52428800 # 50<<20 = 50M)
	// 轮询规则:默认为:rotate_time
	RotateSize int64 `protobuf:"varint,6,opt,name=rotate_size,json=rotateSize,proto3" json:"rotate_size,omitempty"`
	// storage_age 存储n久(默认:2592000s = 30天)
	// 存储规则:默认为:storage_age
	StorageAge *durationpb.Duration `protobuf:"bytes,8,opt,name=storage_age,json=storageAge,proto3" json:"storage_age,omitempty"`
	// storage_counter 存储:n个 或 有效期storage_age(默认:2592000s = 30天)
	// 存储规则:默认为:storage_age
	StorageCounter uint32 `protobuf:"varint,7,opt,name=storage_counter,json=storageCounter,proto3" json:"storage_counter,omitempty"`
	// contains filtered or unexported fields
}

File 输出到文件

func (*Log_File) Descriptor deprecated

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

Deprecated: Use Log_File.ProtoReflect.Descriptor instead.

func (*Log_File) GetDir

func (x *Log_File) GetDir() string

func (*Log_File) GetEnable

func (x *Log_File) GetEnable() bool

func (*Log_File) GetFilename

func (x *Log_File) GetFilename() string

func (*Log_File) GetLevel

func (x *Log_File) GetLevel() string

func (*Log_File) GetRotateSize

func (x *Log_File) GetRotateSize() int64

func (*Log_File) GetRotateTime

func (x *Log_File) GetRotateTime() *durationpb.Duration

func (*Log_File) GetStorageAge

func (x *Log_File) GetStorageAge() *durationpb.Duration

func (*Log_File) GetStorageCounter

func (x *Log_File) GetStorageCounter() uint32

func (*Log_File) ProtoMessage

func (*Log_File) ProtoMessage()

func (*Log_File) ProtoReflect

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

func (*Log_File) Reset

func (x *Log_File) Reset()

func (*Log_File) String

func (x *Log_File) String() string

type Log_Graylog

type Log_Graylog struct {
	Enable        bool   `protobuf:"varint,1,opt,name=enable,proto3" json:"enable,omitempty"`
	Level         string `protobuf:"bytes,2,opt,name=level,proto3" json:"level,omitempty"`
	Proto         string `protobuf:"bytes,3,opt,name=proto,proto3" json:"proto,omitempty"`
	Addr          string `protobuf:"bytes,4,opt,name=addr,proto3" json:"addr,omitempty"`
	Facility      string `protobuf:"bytes,5,opt,name=facility,proto3" json:"facility,omitempty"`
	AsyncPoolSize int32  `protobuf:"varint,6,opt,name=async_pool_size,json=asyncPoolSize,proto3" json:"async_pool_size,omitempty"`
	// contains filtered or unexported fields
}

Graylog ...

func (*Log_Graylog) Descriptor deprecated

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

Deprecated: Use Log_Graylog.ProtoReflect.Descriptor instead.

func (*Log_Graylog) GetAddr

func (x *Log_Graylog) GetAddr() string

func (*Log_Graylog) GetAsyncPoolSize

func (x *Log_Graylog) GetAsyncPoolSize() int32

func (*Log_Graylog) GetEnable

func (x *Log_Graylog) GetEnable() bool

func (*Log_Graylog) GetFacility

func (x *Log_Graylog) GetFacility() string

func (*Log_Graylog) GetLevel

func (x *Log_Graylog) GetLevel() string

func (*Log_Graylog) GetProto

func (x *Log_Graylog) GetProto() string

func (*Log_Graylog) ProtoMessage

func (*Log_Graylog) ProtoMessage()

func (*Log_Graylog) ProtoReflect

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

func (*Log_Graylog) Reset

func (x *Log_Graylog) Reset()

func (*Log_Graylog) String

func (x *Log_Graylog) String() string

type Log_LogLevelEnum

type Log_LogLevelEnum int32
const (
	Log_LOG_LEVEL_UNSPECIFIED Log_LogLevelEnum = 0
	Log_DEBUG                 Log_LogLevelEnum = 1
	Log_INFO                  Log_LogLevelEnum = 2
	Log_WARN                  Log_LogLevelEnum = 3
	Log_ERROR                 Log_LogLevelEnum = 4
	Log_FATAL                 Log_LogLevelEnum = 5
)

func (Log_LogLevelEnum) Descriptor

func (Log_LogLevelEnum) Enum

func (Log_LogLevelEnum) EnumDescriptor deprecated

func (Log_LogLevelEnum) EnumDescriptor() ([]byte, []int)

Deprecated: Use Log_LogLevelEnum.Descriptor instead.

func (Log_LogLevelEnum) Number

func (Log_LogLevelEnum) String

func (x Log_LogLevelEnum) String() string

func (Log_LogLevelEnum) Type

type Mongo

type Mongo struct {
	Enable            bool                 `protobuf:"varint,14,opt,name=enable,proto3" json:"enable,omitempty"`
	Address           string               `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`                                              // MongoDB 的连接字符串,支持集群的形式
	Hosts             []string             `protobuf:"bytes,3,rep,name=hosts,proto3" json:"hosts,omitempty"`                                                  // MongoDB 的集群地址列表
	Database          string               `protobuf:"bytes,4,opt,name=database,proto3" json:"database,omitempty"`                                            // 数据库名称
	MaxPoolSize       uint64               `protobuf:"varint,5,opt,name=max_pool_size,json=maxPoolSize,proto3" json:"max_pool_size,omitempty"`                // 最大空闲连接
	MinPoolSize       uint64               `protobuf:"varint,6,opt,name=min_pool_size,json=minPoolSize,proto3" json:"min_pool_size,omitempty"`                // 最小空闲连接
	MaxConnection     uint64               `protobuf:"varint,7,opt,name=max_connection,json=maxConnection,proto3" json:"max_connection,omitempty"`            // 最大连接数
	ConnectTimeout    *durationpb.Duration `protobuf:"bytes,8,opt,name=connect_timeout,json=connectTimeout,proto3" json:"connect_timeout,omitempty"`          // 连接超时时间
	HeartbeatInterval *durationpb.Duration `protobuf:"bytes,9,opt,name=heartbeat_interval,json=heartbeatInterval,proto3" json:"heartbeat_interval,omitempty"` // 心跳间隔
	MaxConnIdleTime   *durationpb.Duration `protobuf:"bytes,10,opt,name=max_conn_idle_time,json=maxConnIdleTime,proto3" json:"max_conn_idle_time,omitempty"`
	Timeout           *durationpb.Duration `protobuf:"bytes,11,opt,name=timeout,proto3" json:"timeout,omitempty"`
	Debug             bool                 `protobuf:"varint,12,opt,name=debug,proto3" json:"debug,omitempty"` // 是否开启调试模式
	// contains filtered or unexported fields
}

func (*Mongo) Descriptor deprecated

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

Deprecated: Use Mongo.ProtoReflect.Descriptor instead.

func (*Mongo) GetAddress

func (x *Mongo) GetAddress() string

func (*Mongo) GetConnectTimeout

func (x *Mongo) GetConnectTimeout() *durationpb.Duration

func (*Mongo) GetDatabase

func (x *Mongo) GetDatabase() string

func (*Mongo) GetDebug

func (x *Mongo) GetDebug() bool

func (*Mongo) GetEnable

func (x *Mongo) GetEnable() bool

func (*Mongo) GetHeartbeatInterval

func (x *Mongo) GetHeartbeatInterval() *durationpb.Duration

func (*Mongo) GetHosts

func (x *Mongo) GetHosts() []string

func (*Mongo) GetMaxConnIdleTime

func (x *Mongo) GetMaxConnIdleTime() *durationpb.Duration

func (*Mongo) GetMaxConnection

func (x *Mongo) GetMaxConnection() uint64

func (*Mongo) GetMaxPoolSize

func (x *Mongo) GetMaxPoolSize() uint64

func (*Mongo) GetMinPoolSize

func (x *Mongo) GetMinPoolSize() uint64

func (*Mongo) GetTimeout

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

func (*Mongo) ProtoMessage

func (*Mongo) ProtoMessage()

func (*Mongo) ProtoReflect

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

func (*Mongo) Reset

func (x *Mongo) Reset()

func (*Mongo) String

func (x *Mongo) String() string

type Profile

type Profile struct {
	EnableCpu bool   `protobuf:"varint,1,opt,name=enable_cpu,json=enableCpu,proto3" json:"enable_cpu,omitempty"` // 是否启用 CPU Profile
	EnableMem bool   `protobuf:"varint,2,opt,name=enable_mem,json=enableMem,proto3" json:"enable_mem,omitempty"` // 是否启用 Mem Profile
	CpuFile   string `protobuf:"bytes,3,opt,name=cpu_file,json=cpuFile,proto3" json:"cpu_file,omitempty"`        // CPU Profile 文件的保存地址
	MemFile   string `protobuf:"bytes,4,opt,name=mem_file,json=memFile,proto3" json:"mem_file,omitempty"`        // MEM Profile 文件的保存地址
	// contains filtered or unexported fields
}

func (*Profile) Descriptor deprecated

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

Deprecated: Use Profile.ProtoReflect.Descriptor instead.

func (*Profile) GetCpuFile

func (x *Profile) GetCpuFile() string

func (*Profile) GetEnableCpu

func (x *Profile) GetEnableCpu() bool

func (*Profile) GetEnableMem

func (x *Profile) GetEnableMem() bool

func (*Profile) GetMemFile

func (x *Profile) GetMemFile() string

func (*Profile) ProtoMessage

func (*Profile) ProtoMessage()

func (*Profile) ProtoReflect

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

func (*Profile) Reset

func (x *Profile) Reset()

func (*Profile) String

func (x *Profile) String() string

type QueueConfig

type QueueConfig struct {
	Name         string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`                                     // 消息名称
	ExchangeName string `protobuf:"bytes,2,opt,name=exchange_name,json=exchangeName,proto3" json:"exchange_name,omitempty"` // 使用的交换机名称, 一般可保持与消息名一致
	Durable      bool   `protobuf:"varint,3,opt,name=durable,proto3" json:"durable,omitempty"`                              // 队列是否持久化,持久化的队列在重启后不会消失
	AutoDelete   bool   `protobuf:"varint,4,opt,name=auto_delete,json=autoDelete,proto3" json:"auto_delete,omitempty"`      // 队列的是否会在消费后自动删除, 设置为 false 的话能够更好的保存数据,并在全局层面进行管理
	RoutingKey   string `protobuf:"bytes,5,opt,name=routing_key,json=routingKey,proto3" json:"routing_key,omitempty"`       // 队列的路由字段,通过该字段与交换机建立绑定,后续交换机收到消息时会将消息送给匹配路由的队列
	// contains filtered or unexported fields
}

func (*QueueConfig) Descriptor deprecated

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

Deprecated: Use QueueConfig.ProtoReflect.Descriptor instead.

func (*QueueConfig) GetAutoDelete

func (x *QueueConfig) GetAutoDelete() bool

func (*QueueConfig) GetDurable

func (x *QueueConfig) GetDurable() bool

func (*QueueConfig) GetExchangeName

func (x *QueueConfig) GetExchangeName() string

func (*QueueConfig) GetName

func (x *QueueConfig) GetName() string

func (*QueueConfig) GetRoutingKey

func (x *QueueConfig) GetRoutingKey() string

func (*QueueConfig) ProtoMessage

func (*QueueConfig) ProtoMessage()

func (*QueueConfig) ProtoReflect

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

func (*QueueConfig) Reset

func (x *QueueConfig) Reset()

func (*QueueConfig) String

func (x *QueueConfig) String() string

type RabbitMQ

type RabbitMQ struct {
	Addresses  string               `protobuf:"bytes,1,opt,name=addresses,proto3" json:"addresses,omitempty"`                     // 服务的连接地址
	Vhost      string               `protobuf:"bytes,2,opt,name=vhost,proto3" json:"vhost,omitempty"`                             // 虚拟主机名,后期可用于做隔离
	Retry      int32                `protobuf:"varint,3,opt,name=retry,proto3" json:"retry,omitempty"`                            // 连接的重试次数
	ClientName string               `protobuf:"bytes,4,opt,name=client_name,json=clientName,proto3" json:"client_name,omitempty"` // 客户端标识符
	Heartbeat  *durationpb.Duration `protobuf:"bytes,5,opt,name=heartbeat,proto3" json:"heartbeat,omitempty"`                     // 连接心跳检测间隔
	Enable     bool                 `protobuf:"varint,6,opt,name=enable,proto3" json:"enable,omitempty"`                          // 是否启用 MQ 功能
	// contains filtered or unexported fields
}

func (*RabbitMQ) Descriptor deprecated

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

Deprecated: Use RabbitMQ.ProtoReflect.Descriptor instead.

func (*RabbitMQ) GetAddresses

func (x *RabbitMQ) GetAddresses() string

func (*RabbitMQ) GetClientName

func (x *RabbitMQ) GetClientName() string

func (*RabbitMQ) GetEnable added in v0.0.2

func (x *RabbitMQ) GetEnable() bool

func (*RabbitMQ) GetHeartbeat

func (x *RabbitMQ) GetHeartbeat() *durationpb.Duration

func (*RabbitMQ) GetRetry

func (x *RabbitMQ) GetRetry() int32

func (*RabbitMQ) GetVhost

func (x *RabbitMQ) GetVhost() string

func (*RabbitMQ) ProtoMessage

func (*RabbitMQ) ProtoMessage()

func (*RabbitMQ) ProtoReflect

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

func (*RabbitMQ) Reset

func (x *RabbitMQ) Reset()

func (*RabbitMQ) String

func (x *RabbitMQ) String() string

type Redis

type Redis struct {
	Enable          bool                 `protobuf:"varint,111,opt,name=enable,proto3" json:"enable,omitempty"`
	Addresses       []string             `protobuf:"bytes,1,rep,name=addresses,proto3" json:"addresses,omitempty"`                                          // Redis 节点地址
	Db              int32                `protobuf:"varint,2,opt,name=db,proto3" json:"db,omitempty"`                                                       // 使用的数据库
	Username        string               `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"`                                            // 用户名
	Password        string               `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"`                                            // 密码
	ReadTimeout     *durationpb.Duration `protobuf:"bytes,5,opt,name=read_timeout,json=readTimeout,proto3" json:"read_timeout,omitempty"`                   // 读取超时时间
	WriteTimeout    *durationpb.Duration `protobuf:"bytes,6,opt,name=write_timeout,json=writeTimeout,proto3" json:"write_timeout,omitempty"`                // 写入超时时间
	DialTimeout     *durationpb.Duration `protobuf:"bytes,7,opt,name=dial_timeout,json=dialTimeout,proto3" json:"dial_timeout,omitempty"`                   // 连接超时时间
	MaxPoolSize     uint64               `protobuf:"varint,8,opt,name=max_pool_size,json=maxPoolSize,proto3" json:"max_pool_size,omitempty"`                // 最大的连接池数
	MaxPoolIdleSize uint64               `protobuf:"varint,9,opt,name=max_pool_idle_size,json=maxPoolIdleSize,proto3" json:"max_pool_idle_size,omitempty"`  // 最大连接数
	MinPoolIdleSize uint64               `protobuf:"varint,10,opt,name=min_pool_idle_size,json=minPoolIdleSize,proto3" json:"min_pool_idle_size,omitempty"` // 最小空闲链接
	MaxRetries      uint64               `protobuf:"varint,11,opt,name=max_retries,json=maxRetries,proto3" json:"max_retries,omitempty"`                    // 最大重试次数
	// contains filtered or unexported fields
}

func (*Redis) Descriptor deprecated

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

Deprecated: Use Redis.ProtoReflect.Descriptor instead.

func (*Redis) GetAddresses

func (x *Redis) GetAddresses() []string

func (*Redis) GetDb

func (x *Redis) GetDb() int32

func (*Redis) GetDialTimeout

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

func (*Redis) GetEnable

func (x *Redis) GetEnable() bool

func (*Redis) GetMaxPoolIdleSize

func (x *Redis) GetMaxPoolIdleSize() uint64

func (*Redis) GetMaxPoolSize

func (x *Redis) GetMaxPoolSize() uint64

func (*Redis) GetMaxRetries

func (x *Redis) GetMaxRetries() uint64

func (*Redis) GetMinPoolIdleSize

func (x *Redis) GetMinPoolIdleSize() uint64

func (*Redis) GetPassword

func (x *Redis) GetPassword() string

func (*Redis) GetReadTimeout

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

func (*Redis) GetUsername

func (x *Redis) GetUsername() string

func (*Redis) GetWriteTimeout

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

func (*Redis) ProtoMessage

func (*Redis) ProtoMessage()

func (*Redis) ProtoReflect

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

func (*Redis) Reset

func (x *Redis) Reset()

func (*Redis) String

func (x *Redis) String() string

type Registry

type Registry struct {
	Enable  bool                 `protobuf:"varint,6,opt,name=enable,proto3" json:"enable,omitempty"`  // 是否启用该 Service
	Name    string               `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`       // 服务名
	Version string               `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // 服务版本
	Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` // 该服务的超时时间
	Address string               `protobuf:"bytes,4,opt,name=address,proto3" json:"address,omitempty"` // 服务地址 - 一般为域名,服务发现能力由运维环境提供,如果需要私有化部署可配置为服务 IP
	Type    string               `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"`       // 服务类型, grpc/http
	// contains filtered or unexported fields
}

func (*Registry) Descriptor deprecated

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

Deprecated: Use Registry.ProtoReflect.Descriptor instead.

func (*Registry) GetAddress

func (x *Registry) GetAddress() string

func (*Registry) GetEnable

func (x *Registry) GetEnable() bool

func (*Registry) GetName

func (x *Registry) GetName() string

func (*Registry) GetTimeout

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

func (*Registry) GetType

func (x *Registry) GetType() string

func (*Registry) GetVersion

func (x *Registry) GetVersion() string

func (*Registry) ProtoMessage

func (*Registry) ProtoMessage()

func (*Registry) ProtoReflect

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

func (*Registry) Reset

func (x *Registry) Reset()

func (*Registry) String

func (x *Registry) String() string

type Server

type Server struct {

	// http http服务配置
	Http *Registry `protobuf:"bytes,1,opt,name=http,proto3" json:"http,omitempty"`
	// grpc grpc服务配置
	Grpc *Registry `protobuf:"bytes,2,opt,name=grpc,proto3" json:"grpc,omitempty"`
	// contains filtered or unexported fields
}

Server 服务

func (*Server) Descriptor deprecated

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

Deprecated: Use Server.ProtoReflect.Descriptor instead.

func (*Server) GetGrpc

func (x *Server) GetGrpc() *Registry

func (*Server) GetHttp

func (x *Server) GetHttp() *Registry

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 Tracing

type Tracing struct {
	Enable       bool    `protobuf:"varint,1,opt,name=enable,proto3" json:"enable,omitempty"`                                   // 是否启用链路跟踪
	Endpoint     string  `protobuf:"bytes,2,opt,name=endpoint,proto3" json:"endpoint,omitempty"`                                // 链路跟踪的 collector 服务地址, 默认为 127.0.0.1:4318
	UrlPath      string  `protobuf:"bytes,3,opt,name=url_path,json=urlPath,proto3" json:"url_path,omitempty"`                   // 链路跟踪接口 collector 接口路径 , 默认为 /api/traces
	SimpleRate   float64 `protobuf:"fixed64,4,opt,name=simple_rate,json=simpleRate,proto3" json:"simple_rate,omitempty"`        // 日志采样比例
	Type         string  `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"`                                        // 链路跟踪类型,不启用时使用 memory, 启用时为 jaeger
	MaxBatchSize int32   `protobuf:"varint,6,opt,name=max_batch_size,json=maxBatchSize,proto3" json:"max_batch_size,omitempty"` // 最大的批量提交数
	MaxQueueSize int32   `protobuf:"varint,7,opt,name=max_queue_size,json=maxQueueSize,proto3" json:"max_queue_size,omitempty"` // 最大的缓存队列大小
	// contains filtered or unexported fields
}

func (*Tracing) Descriptor deprecated

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

Deprecated: Use Tracing.ProtoReflect.Descriptor instead.

func (*Tracing) GetEnable

func (x *Tracing) GetEnable() bool

func (*Tracing) GetEndpoint

func (x *Tracing) GetEndpoint() string

func (*Tracing) GetMaxBatchSize

func (x *Tracing) GetMaxBatchSize() int32

func (*Tracing) GetMaxQueueSize

func (x *Tracing) GetMaxQueueSize() int32

func (*Tracing) GetSimpleRate

func (x *Tracing) GetSimpleRate() float64

func (*Tracing) GetType

func (x *Tracing) GetType() string

func (*Tracing) GetUrlPath

func (x *Tracing) GetUrlPath() string

func (*Tracing) ProtoMessage

func (*Tracing) ProtoMessage()

func (*Tracing) ProtoReflect

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

func (*Tracing) Reset

func (x *Tracing) Reset()

func (*Tracing) String

func (x *Tracing) String() string

Jump to

Keyboard shortcuts

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