Documentation
¶
Index ¶
- Variables
- type Bootstrap
- func (*Bootstrap) Descriptor() ([]byte, []int)deprecated
- func (x *Bootstrap) GetClients() []*Client
- func (x *Bootstrap) GetDiscoveries() map[string]*v11.Discovery
- func (x *Bootstrap) GetRegistrationDiscoveryName() string
- func (x *Bootstrap) GetServers() []*Server
- func (*Bootstrap) ProtoMessage()
- func (x *Bootstrap) ProtoReflect() protoreflect.Message
- func (x *Bootstrap) Reset()
- func (x *Bootstrap) String() string
- type Client
- func (*Client) Descriptor() ([]byte, []int)deprecated
- func (x *Client) GetClientName() string
- func (x *Client) GetDiscoveries() []*v11.Discovery
- func (x *Client) GetMiddlewares() []*v12.Middleware
- func (*Client) ProtoMessage()
- func (x *Client) ProtoReflect() protoreflect.Message
- func (x *Client) Reset()
- func (x *Client) String() string
- type Server
- func (*Server) Descriptor() ([]byte, []int)deprecated
- func (x *Server) GetConfig() isServer_Config
- func (x *Server) GetGrpc() *v1.GrpcServerConfig
- func (x *Server) GetHttp() *v1.HttpServerConfig
- func (x *Server) GetName() string
- func (*Server) ProtoMessage()
- func (x *Server) ProtoReflect() protoreflect.Message
- func (x *Server) Reset()
- func (x *Server) String() string
- type Server_Grpc
- type Server_Http
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
}
- 构造顶层的 Bootstrap "蓝图" 这是最终的房子,它完全由上面组合好的部件构成。
func (*Bootstrap) Descriptor
deprecated
func (*Bootstrap) GetClients ¶
func (*Bootstrap) GetRegistrationDiscoveryName ¶
func (*Bootstrap) GetServers ¶
func (*Bootstrap) ProtoMessage ¶
func (*Bootstrap) ProtoMessage()
func (*Bootstrap) ProtoReflect ¶
func (x *Bootstrap) ProtoReflect() protoreflect.Message
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
}
- 在图纸内部,定义如何组合 "客户端" 砖头 这个 Client 消息也是此应用专属的,它解决了 "不同client需要不同Middleware" 的问题。
func (*Client) Descriptor
deprecated
func (*Client) GetClientName ¶
func (*Client) GetDiscoveries ¶
func (*Client) GetMiddlewares ¶
func (x *Client) GetMiddlewares() []*v12.Middleware
func (*Client) ProtoMessage ¶
func (*Client) ProtoMessage()
func (*Client) ProtoReflect ¶
func (x *Client) ProtoReflect() protoreflect.Message
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
}
- 在图纸内部,定义如何组合 "服务器" 砖头 这个 Server 消息是此应用专属的,它解决了 "transport不分" 的问题。
func (*Server) Descriptor
deprecated
func (*Server) GetGrpc ¶
func (x *Server) GetGrpc() *v1.GrpcServerConfig
func (*Server) GetHttp ¶
func (x *Server) GetHttp() *v1.HttpServerConfig
func (*Server) ProtoMessage ¶
func (*Server) ProtoMessage()
func (*Server) ProtoReflect ¶
func (x *Server) ProtoReflect() protoreflect.Message
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"`
}
Click to show internal directories.
Click to hide internal directories.