configs

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_test_integration_app_proto_bootstrap_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Bootstrap

type Bootstrap struct {

	// 服务发现配置池。
	Discoveries map[string]*v11.Discovery `` /* 149-byte string literal not displayed */
	// 用于服务注册的发现配置名称。
	RegistrationDiscoveryName string `` /* 138-byte string literal not displayed */
	// 使用我们组合好的 `Server` 部件,构造一个统一的服务器列表。
	Servers []*Server `protobuf:"bytes,3,rep,name=servers,proto3" json:"servers,omitempty"`
	// 使用我们组合好的 `Client` 部件,构造一个客户端列表,每个客户端都有其专属配置。
	Clients []*Client `protobuf:"bytes,4,rep,name=clients,proto3" json:"clients,omitempty"`
	// contains filtered or unexported fields
}
  1. 构造顶层的 Bootstrap "蓝图" 这是最终的房子,它完全由上面组合好的部件构成。

func (*Bootstrap) Descriptor deprecated

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

Deprecated: Use Bootstrap.ProtoReflect.Descriptor instead.

func (*Bootstrap) GetClients

func (x *Bootstrap) GetClients() []*Client

func (*Bootstrap) GetDiscoveries

func (x *Bootstrap) GetDiscoveries() map[string]*v11.Discovery

func (*Bootstrap) GetRegistrationDiscoveryName

func (x *Bootstrap) GetRegistrationDiscoveryName() string

func (*Bootstrap) GetServers

func (x *Bootstrap) GetServers() []*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 Client

type Client struct {

	// 客户端名称,用于在应用中唯一标识这个客户端。
	ClientName string `protobuf:"bytes,1,opt,name=client_name,json=clientName,proto3" json:"client_name,omitempty"`
	// 使用框架的 "客户端发现" 砖头。
	Discoveries []*v11.Discovery `protobuf:"bytes,2,rep,name=discoveries,proto3" json:"discoveries,omitempty"`
	// 将 "中间件" 砖头与上面的 "客户端发现" 砖头绑定在一起。
	Middlewares []*v12.Middleware `protobuf:"bytes,3,rep,name=middlewares,proto3" json:"middlewares,omitempty"`
	// contains filtered or unexported fields
}
  1. 在图纸内部,定义如何组合 "客户端" 砖头 这个 Client 消息也是此应用专属的,它解决了 "不同client需要不同Middleware" 的问题。

func (*Client) Descriptor deprecated

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

Deprecated: Use Client.ProtoReflect.Descriptor instead.

func (*Client) GetClientName

func (x *Client) GetClientName() string

func (*Client) GetDiscoveries

func (x *Client) GetDiscoveries() []*v11.Discovery

func (*Client) GetMiddlewares

func (x *Client) GetMiddlewares() []*v12.Middleware

func (*Client) ProtoMessage

func (*Client) ProtoMessage()

func (*Client) ProtoReflect

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

func (*Client) Reset

func (x *Client) Reset()

func (*Client) String

func (x *Client) String() string

type Server

type Server struct {

	// 为这个服务器端点起一个名字, e.g., "private-grpc", "public-http".
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// 使用 oneof 将框架的 GRPC 和 HTTP "砖头" 组合在一起。
	//
	// Types that are valid to be assigned to Config:
	//
	//	*Server_Grpc
	//	*Server_Http
	Config isServer_Config `protobuf_oneof:"config"`
	// contains filtered or unexported fields
}
  1. 在图纸内部,定义如何组合 "服务器" 砖头 这个 Server 消息是此应用专属的,它解决了 "transport不分" 的问题。

func (*Server) Descriptor deprecated

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

Deprecated: Use Server.ProtoReflect.Descriptor instead.

func (*Server) GetConfig

func (x *Server) GetConfig() isServer_Config

func (*Server) GetGrpc

func (x *Server) GetGrpc() *v1.GrpcServerConfig

func (*Server) GetHttp

func (x *Server) GetHttp() *v1.HttpServerConfig

func (*Server) GetName

func (x *Server) GetName() string

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 {
	Grpc *v1.GrpcServerConfig `protobuf:"bytes,2,opt,name=grpc,proto3,oneof"`
}

type Server_Http

type Server_Http struct {
	Http *v1.HttpServerConfig `protobuf:"bytes,3,opt,name=http,proto3,oneof"`
}

Jump to

Keyboard shortcuts

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