v1

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_config_v1_config_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Broker

type Broker struct {
	Disable   bool       `protobuf:"varint,1,opt,name=disable,proto3" json:"disable,omitempty"`    // disable tracing
	Name      string     `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`           // broker name, eg: kafka, nsq
	Addrs     []string   `protobuf:"bytes,3,rep,name=addrs,proto3" json:"addrs,omitempty"`         // broker address
	Publish   *Publish   `protobuf:"bytes,4,opt,name=publish,proto3" json:"publish,omitempty"`     // broker publish config
	Subscribe *Subscribe `protobuf:"bytes,5,opt,name=subscribe,proto3" json:"subscribe,omitempty"` // broker subscribe config
	// contains filtered or unexported fields
}

Broker config

func (*Broker) Descriptor deprecated

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

Deprecated: Use Broker.ProtoReflect.Descriptor instead.

func (*Broker) GetAddrs

func (x *Broker) GetAddrs() []string

func (*Broker) GetDisable added in v1.0.10

func (x *Broker) GetDisable() bool

func (*Broker) GetName

func (x *Broker) GetName() string

func (*Broker) GetPublish

func (x *Broker) GetPublish() *Publish

func (*Broker) GetSubscribe

func (x *Broker) GetSubscribe() *Subscribe

func (*Broker) ProtoMessage

func (*Broker) ProtoMessage()

func (*Broker) ProtoReflect

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

func (*Broker) Reset

func (x *Broker) Reset()

func (*Broker) String

func (x *Broker) String() string

type GRPCClient

type GRPCClient struct {
	Endpoint    string               `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // http client endpoint
	Timeout     *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"`
	Middlewares []*Middleware        `protobuf:"bytes,4,rep,name=middlewares,proto3" json:"middlewares,omitempty"`
	// contains filtered or unexported fields
}

grpc client config

func (*GRPCClient) Descriptor deprecated

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

Deprecated: Use GRPCClient.ProtoReflect.Descriptor instead.

func (*GRPCClient) GetEndpoint

func (x *GRPCClient) GetEndpoint() string

func (*GRPCClient) GetMiddlewares

func (x *GRPCClient) GetMiddlewares() []*Middleware

func (*GRPCClient) GetTimeout

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

func (*GRPCClient) ProtoMessage

func (*GRPCClient) ProtoMessage()

func (*GRPCClient) ProtoReflect

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

func (*GRPCClient) Reset

func (x *GRPCClient) Reset()

func (*GRPCClient) String

func (x *GRPCClient) String() string

type GRPCServer

type GRPCServer 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"`
	Middlewares []*Middleware        `protobuf:"bytes,4,rep,name=middlewares,proto3" json:"middlewares,omitempty"`
	// contains filtered or unexported fields
}

grpc server config

func (*GRPCServer) Descriptor deprecated

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

Deprecated: Use GRPCServer.ProtoReflect.Descriptor instead.

func (*GRPCServer) GetAddr

func (x *GRPCServer) GetAddr() string

func (*GRPCServer) GetMiddlewares

func (x *GRPCServer) GetMiddlewares() []*Middleware

func (*GRPCServer) GetNetwork

func (x *GRPCServer) GetNetwork() string

func (*GRPCServer) GetTimeout

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

func (*GRPCServer) ProtoMessage

func (*GRPCServer) ProtoMessage()

func (*GRPCServer) ProtoReflect

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

func (*GRPCServer) Reset

func (x *GRPCServer) Reset()

func (*GRPCServer) String

func (x *GRPCServer) String() string

type HTTPClient

type HTTPClient struct {
	Endpoint    string               `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // http client endpoint
	Timeout     *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"`
	Middlewares []*Middleware        `protobuf:"bytes,4,rep,name=middlewares,proto3" json:"middlewares,omitempty"`
	// contains filtered or unexported fields
}

http client config

func (*HTTPClient) Descriptor deprecated

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

Deprecated: Use HTTPClient.ProtoReflect.Descriptor instead.

func (*HTTPClient) GetEndpoint

func (x *HTTPClient) GetEndpoint() string

func (*HTTPClient) GetMiddlewares

func (x *HTTPClient) GetMiddlewares() []*Middleware

func (*HTTPClient) GetTimeout

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

func (*HTTPClient) ProtoMessage

func (*HTTPClient) ProtoMessage()

func (*HTTPClient) ProtoReflect

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

func (*HTTPClient) Reset

func (x *HTTPClient) Reset()

func (*HTTPClient) String

func (x *HTTPClient) String() string

type HTTPServer

type HTTPServer 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"`
	Middlewares []*Middleware        `protobuf:"bytes,4,rep,name=middlewares,proto3" json:"middlewares,omitempty"`
	// contains filtered or unexported fields
}

http server config

func (*HTTPServer) Descriptor deprecated

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

Deprecated: Use HTTPServer.ProtoReflect.Descriptor instead.

func (*HTTPServer) GetAddr

func (x *HTTPServer) GetAddr() string

func (*HTTPServer) GetMiddlewares

func (x *HTTPServer) GetMiddlewares() []*Middleware

func (*HTTPServer) GetNetwork

func (x *HTTPServer) GetNetwork() string

func (*HTTPServer) GetTimeout

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

func (*HTTPServer) ProtoMessage

func (*HTTPServer) ProtoMessage()

func (*HTTPServer) ProtoReflect

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

func (*HTTPServer) Reset

func (x *HTTPServer) Reset()

func (*HTTPServer) String

func (x *HTTPServer) String() string

type Logger

type Logger struct {
	FileName   string            `protobuf:"bytes,1,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"`        // 日志文件名,默认按照日志级别命名
	Path       string            `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`                                // 设置日志路径,默认为 /data/logs/${项目名}/projlogs
	Level      string            `protobuf:"bytes,3,opt,name=level,proto3" json:"level,omitempty"`                              // 用于过滤日志的日志级别。默认为 info
	Console    bool              `protobuf:"varint,4,opt,name=console,proto3" json:"console,omitempty"`                         // 是否输出到控制台,默认为 true
	File       bool              `protobuf:"varint,5,opt,name=file,proto3" json:"file,omitempty"`                               // 模式将日志写到 Path 指定目录的文件中
	Compress   bool              `protobuf:"varint,6,opt,name=compress,proto3" json:"compress,omitempty"`                       // 是否压缩日志文件,只在 file 模式下工作
	KeepDays   int32             `protobuf:"varint,7,opt,name=keep_days,json=keepDays,proto3" json:"keep_days,omitempty"`       // 日志文件被保留多少天,在给定的天数之后,过期的文件将被自动删除。对 console 模式没有影响
	KeepHours  int32             `protobuf:"varint,8,opt,name=keep_hours,json=keepHours,proto3" json:"keep_hours,omitempty"`    // 日志文件被保留多少小时,在给定的小时数之后,过期的文件将被自动删除。对 console 模式没有影响
	MaxBackups int32             `protobuf:"varint,9,opt,name=max_backups,json=maxBackups,proto3" json:"max_backups,omitempty"` // 多少个日志文件备份将被保存。0代表所有备份都被保存。当Rotation被设置为size时才会起作用。注意:KeepDays选项的优先级会比MaxBackups高,即使MaxBackups被设置为0,当达到KeepDays上限时备份文件同样会被删除。
	MaxSize    int32             `protobuf:"varint,10,opt,name=max_size,json=maxSize,proto3" json:"max_size,omitempty"`         // 当前被写入的日志文件最大可占用多少空间。0代表没有上限。单位为MB。当Rotation被设置为size时才会起作用
	Rotation   string            `protobuf:"bytes,11,opt,name=rotation,proto3" json:"rotation,omitempty"`                       // 日志轮转策略类型。默认为daily(按天轮转),可选值为: daily 按天轮转、size 按日志大小轮转、hour 按小时轮转
	Metadata   map[string]string ``                                                                                             // 日志元数据
	/* 158-byte string literal not displayed */
	// contains filtered or unexported fields
}

logger config

func (*Logger) Descriptor deprecated

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

Deprecated: Use Logger.ProtoReflect.Descriptor instead.

func (*Logger) GetCompress added in v1.0.19

func (x *Logger) GetCompress() bool

func (*Logger) GetConsole

func (x *Logger) GetConsole() bool

func (*Logger) GetFile

func (x *Logger) GetFile() bool

func (*Logger) GetFileName added in v1.0.19

func (x *Logger) GetFileName() string

func (*Logger) GetKeepDays added in v1.0.19

func (x *Logger) GetKeepDays() int32

func (*Logger) GetKeepHours added in v1.0.19

func (x *Logger) GetKeepHours() int32

func (*Logger) GetLevel

func (x *Logger) GetLevel() string

func (*Logger) GetMaxBackups added in v1.0.19

func (x *Logger) GetMaxBackups() int32

func (*Logger) GetMaxSize added in v1.0.19

func (x *Logger) GetMaxSize() int32

func (*Logger) GetMetadata

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

func (*Logger) GetPath

func (x *Logger) GetPath() string

func (*Logger) GetRotation added in v1.0.19

func (x *Logger) GetRotation() string

func (*Logger) ProtoMessage

func (*Logger) ProtoMessage()

func (*Logger) ProtoReflect

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

func (*Logger) Reset

func (x *Logger) Reset()

func (*Logger) String

func (x *Logger) String() string

type Middleware

type Middleware struct {
	Name    string     `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Options *anypb.Any `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"`
	// contains filtered or unexported fields
}

middleware config

func (*Middleware) Descriptor deprecated

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

Deprecated: Use Middleware.ProtoReflect.Descriptor instead.

func (*Middleware) GetName

func (x *Middleware) GetName() string

func (*Middleware) GetOptions

func (x *Middleware) GetOptions() *anypb.Any

func (*Middleware) ProtoMessage

func (*Middleware) ProtoMessage()

func (*Middleware) ProtoReflect

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

func (*Middleware) Reset

func (x *Middleware) Reset()

func (*Middleware) String

func (x *Middleware) String() string

type Nacos

type Nacos struct {

	// nacos server address
	Address []string `protobuf:"bytes,1,rep,name=address,proto3" json:"address,omitempty"`
	// nacos config data id
	DataId string `protobuf:"bytes,2,opt,name=data_id,json=dataId,proto3" json:"data_id,omitempty"`
	// nacos config group
	Group string `protobuf:"bytes,3,opt,name=group,proto3" json:"group,omitempty"`
	// nacos config namespace
	Namespace string `protobuf:"bytes,4,opt,name=namespace,proto3" json:"namespace,omitempty"`
	// nacos config username
	Username string `protobuf:"bytes,5,opt,name=username,proto3" json:"username,omitempty"`
	// nacos config password
	Password string `protobuf:"bytes,6,opt,name=password,proto3" json:"password,omitempty"`
	// the nacos server contextpath,default=/nacos,this is not required in 2.0
	ContextPath string `protobuf:"bytes,7,opt,name=context_path,json=contextPath,proto3" json:"context_path,omitempty"`
	// nacos config log dir
	LogDir string `protobuf:"bytes,8,opt,name=log_dir,json=logDir,proto3" json:"log_dir,omitempty"`
	// nacos config cache dir
	CacheDir string `protobuf:"bytes,9,opt,name=cache_dir,json=cacheDir,proto3" json:"cache_dir,omitempty"`
	// nacos timeout(ms). default 5000
	Timeout *durationpb.Duration `protobuf:"bytes,10,opt,name=timeout,proto3" json:"timeout,omitempty"`
	// nacos logger level. default info
	LogLevel string `protobuf:"bytes,11,opt,name=log_level,json=logLevel,proto3" json:"log_level,omitempty"`
	// nacos format, default=yaml
	Format string `protobuf:"bytes,12,opt,name=format,proto3" json:"format,omitempty"`
	// not load cache at
	NotLoadCacheAtStart bool `` /* 126-byte string literal not displayed */
	// contains filtered or unexported fields
}

nacos config

func (*Nacos) Descriptor deprecated

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

Deprecated: Use Nacos.ProtoReflect.Descriptor instead.

func (*Nacos) GetAddress

func (x *Nacos) GetAddress() []string

func (*Nacos) GetCacheDir

func (x *Nacos) GetCacheDir() string

func (*Nacos) GetContextPath added in v1.0.15

func (x *Nacos) GetContextPath() string

func (*Nacos) GetDataId

func (x *Nacos) GetDataId() string

func (*Nacos) GetFormat added in v1.0.16

func (x *Nacos) GetFormat() string

func (*Nacos) GetGroup

func (x *Nacos) GetGroup() string

func (*Nacos) GetLogDir

func (x *Nacos) GetLogDir() string

func (*Nacos) GetLogLevel

func (x *Nacos) GetLogLevel() string

func (*Nacos) GetNamespace added in v1.0.16

func (x *Nacos) GetNamespace() string

func (*Nacos) GetNotLoadCacheAtStart added in v1.0.17

func (x *Nacos) GetNotLoadCacheAtStart() bool

func (*Nacos) GetPassword

func (x *Nacos) GetPassword() string

func (*Nacos) GetTimeout

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

func (*Nacos) GetUsername

func (x *Nacos) GetUsername() string

func (*Nacos) ProtoMessage

func (*Nacos) ProtoMessage()

func (*Nacos) ProtoReflect

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

func (*Nacos) Reset

func (x *Nacos) Reset()

func (*Nacos) String

func (x *Nacos) String() string

type Next

type Next struct {

	// service id
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// service name
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// service version
	Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"`
	// service metadata
	Metadata map[string]string `` /* 157-byte string literal not displayed */
	// registry config
	Registry *Registry `protobuf:"bytes,5,opt,name=registry,proto3" json:"registry,omitempty"`
	// server config
	Server *Server `protobuf:"bytes,6,opt,name=server,proto3" json:"server,omitempty"`
	// logger config
	Logger *Logger `protobuf:"bytes,10,opt,name=logger,proto3" json:"logger,omitempty"`
	// telemetry config
	Telemetry *Telemetry `protobuf:"bytes,11,opt,name=telemetry,proto3" json:"telemetry,omitempty"`
	// nacos config
	Nacos *Nacos `protobuf:"bytes,12,opt,name=nacos,proto3" json:"nacos,omitempty"`
	// broker config
	Broker *Broker `protobuf:"bytes,13,opt,name=broker,proto3" json:"broker,omitempty"`
	// contains filtered or unexported fields
}

next micro global config

func (*Next) Descriptor deprecated

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

Deprecated: Use Next.ProtoReflect.Descriptor instead.

func (*Next) GetBroker

func (x *Next) GetBroker() *Broker

func (*Next) GetId

func (x *Next) GetId() string

func (*Next) GetLogger

func (x *Next) GetLogger() *Logger

func (*Next) GetMetadata

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

func (*Next) GetNacos

func (x *Next) GetNacos() *Nacos

func (*Next) GetName

func (x *Next) GetName() string

func (*Next) GetRegistry

func (x *Next) GetRegistry() *Registry

func (*Next) GetServer

func (x *Next) GetServer() *Server

func (*Next) GetTelemetry added in v1.0.5

func (x *Next) GetTelemetry() *Telemetry

func (*Next) GetVersion

func (x *Next) GetVersion() string

func (*Next) ProtoMessage

func (*Next) ProtoMessage()

func (*Next) ProtoReflect

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

func (*Next) Reset

func (x *Next) Reset()

func (*Next) String

func (x *Next) String() string

type Publish

type Publish struct {
	// contains filtered or unexported fields
}

broker publish config

func (*Publish) Descriptor deprecated

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

Deprecated: Use Publish.ProtoReflect.Descriptor instead.

func (*Publish) ProtoMessage

func (*Publish) ProtoMessage()

func (*Publish) ProtoReflect

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

func (*Publish) Reset

func (x *Publish) Reset()

func (*Publish) String

func (x *Publish) String() string

type Registry

type Registry struct {
	Name    string               `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`       // registry name, eg: nacos, etcd, consul
	Addrs   string               `protobuf:"bytes,2,opt,name=addrs,proto3" json:"addrs,omitempty"`     // registry address
	Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"` // registry timeout
	// contains filtered or unexported fields
}

Registry config

func (*Registry) Descriptor deprecated

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

Deprecated: Use Registry.ProtoReflect.Descriptor instead.

func (*Registry) GetAddrs

func (x *Registry) GetAddrs() string

func (*Registry) GetName

func (x *Registry) GetName() string

func (*Registry) GetTimeout

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

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 *HTTPServer `protobuf:"bytes,1,opt,name=http,proto3" json:"http,omitempty"`
	Grpc *GRPCServer `protobuf:"bytes,2,opt,name=grpc,proto3" json:"grpc,omitempty"`
	// contains filtered or unexported fields
}

server config

func (*Server) Descriptor deprecated

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

Deprecated: Use Server.ProtoReflect.Descriptor instead.

func (*Server) GetGrpc

func (x *Server) GetGrpc() *GRPCServer

func (*Server) GetHttp

func (x *Server) GetHttp() *HTTPServer

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 Subscribe

type Subscribe struct {
	Queue   string `protobuf:"bytes,1,opt,name=queue,proto3" json:"queue,omitempty"`                     // queue name
	AutoAck bool   `protobuf:"varint,2,opt,name=auto_ack,json=autoAck,proto3" json:"auto_ack,omitempty"` // auto ack
	// contains filtered or unexported fields
}

broker subscribe config

func (*Subscribe) Descriptor deprecated

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

Deprecated: Use Subscribe.ProtoReflect.Descriptor instead.

func (*Subscribe) GetAutoAck

func (x *Subscribe) GetAutoAck() bool

func (*Subscribe) GetQueue

func (x *Subscribe) GetQueue() string

func (*Subscribe) ProtoMessage

func (*Subscribe) ProtoMessage()

func (*Subscribe) ProtoReflect

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

func (*Subscribe) Reset

func (x *Subscribe) Reset()

func (*Subscribe) String

func (x *Subscribe) String() string

type Telemetry added in v1.0.5

type Telemetry struct {
	Disable  bool              `protobuf:"varint,1,opt,name=disable,proto3" json:"disable,omitempty"`  // disable tracing
	Exporter string            `protobuf:"bytes,2,opt,name=exporter,proto3" json:"exporter,omitempty"` // tracing exporter, eg: otlphttp, otlpgrpc, stdout, zipkin, file, noop
	Endpoint string            `protobuf:"bytes,3,opt,name=endpoint,proto3" json:"endpoint,omitempty"` // tracing endpoint
	Sampler  float64           `protobuf:"fixed64,4,opt,name=sampler,proto3" json:"sampler,omitempty"` // tracing sampler: 0-1, 1 means full sampling, 0 means no sampling
	Headers  map[string]string ``                                                                      // otlp headers
	/* 155-byte string literal not displayed */
	HttpPath string `protobuf:"bytes,6,opt,name=http_path,json=httpPath,proto3" json:"http_path,omitempty"` // otlp http path
	// contains filtered or unexported fields
}

Telemetry config

func (*Telemetry) Descriptor deprecated added in v1.0.5

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

Deprecated: Use Telemetry.ProtoReflect.Descriptor instead.

func (*Telemetry) GetDisable added in v1.0.5

func (x *Telemetry) GetDisable() bool

func (*Telemetry) GetEndpoint added in v1.0.5

func (x *Telemetry) GetEndpoint() string

func (*Telemetry) GetExporter added in v1.0.5

func (x *Telemetry) GetExporter() string

func (*Telemetry) GetHeaders added in v1.0.10

func (x *Telemetry) GetHeaders() map[string]string

func (*Telemetry) GetHttpPath added in v1.0.10

func (x *Telemetry) GetHttpPath() string

func (*Telemetry) GetSampler added in v1.0.5

func (x *Telemetry) GetSampler() float64

func (*Telemetry) ProtoMessage added in v1.0.5

func (*Telemetry) ProtoMessage()

func (*Telemetry) ProtoReflect added in v1.0.5

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

func (*Telemetry) Reset added in v1.0.5

func (x *Telemetry) Reset()

func (*Telemetry) String added in v1.0.5

func (x *Telemetry) String() string

Jump to

Keyboard shortcuts

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