Documentation
¶
Index ¶
- Variables
- type Client
- func (*Client) Descriptor() ([]byte, []int)deprecated
- func (x *Client) GetCustomConfig() *structpb.Struct
- func (x *Client) GetGrpc() *GrpcClientConfig
- func (x *Client) GetHttp() *HttpClientConfig
- func (x *Client) GetName() string
- func (x *Client) GetProtocol() string
- func (*Client) ProtoMessage()
- func (x *Client) ProtoReflect() protoreflect.Message
- func (x *Client) Reset()
- func (x *Client) String() string
- func (m *Client) Validate() error
- func (m *Client) ValidateAll() error
- type ClientMultiError
- type ClientValidationError
- type Clients
- func (*Clients) Descriptor() ([]byte, []int)deprecated
- func (x *Clients) GetClients() []*Client
- func (*Clients) ProtoMessage()
- func (x *Clients) ProtoReflect() protoreflect.Message
- func (x *Clients) Reset()
- func (x *Clients) String() string
- func (m *Clients) Validate() error
- func (m *Clients) ValidateAll() error
- type ClientsMultiError
- type ClientsValidationError
- type GrpcClientConfig
- func (*GrpcClientConfig) Descriptor() ([]byte, []int)deprecated
- func (x *GrpcClientConfig) GetDiscoveryName() string
- func (x *GrpcClientConfig) GetEndpoint() string
- func (x *GrpcClientConfig) GetMiddlewares() []string
- func (x *GrpcClientConfig) GetSelector() *SelectorConfig
- func (x *GrpcClientConfig) GetTimeout() *durationpb.Duration
- func (x *GrpcClientConfig) GetTlsConfig() *v1.TLSConfig
- func (*GrpcClientConfig) ProtoMessage()
- func (x *GrpcClientConfig) ProtoReflect() protoreflect.Message
- func (x *GrpcClientConfig) Reset()
- func (x *GrpcClientConfig) String() string
- func (m *GrpcClientConfig) Validate() error
- func (m *GrpcClientConfig) ValidateAll() error
- type GrpcClientConfigMultiError
- type GrpcClientConfigValidationError
- func (e GrpcClientConfigValidationError) Cause() error
- func (e GrpcClientConfigValidationError) Error() string
- func (e GrpcClientConfigValidationError) ErrorName() string
- func (e GrpcClientConfigValidationError) Field() string
- func (e GrpcClientConfigValidationError) Key() bool
- func (e GrpcClientConfigValidationError) Reason() string
- type GrpcServerConfig
- func (*GrpcServerConfig) Descriptor() ([]byte, []int)deprecated
- func (x *GrpcServerConfig) GetAddr() string
- func (x *GrpcServerConfig) GetMiddlewares() []string
- func (x *GrpcServerConfig) GetNetwork() string
- func (x *GrpcServerConfig) GetTimeout() *durationpb.Duration
- func (x *GrpcServerConfig) GetTlsConfig() *v1.TLSConfig
- func (*GrpcServerConfig) ProtoMessage()
- func (x *GrpcServerConfig) ProtoReflect() protoreflect.Message
- func (x *GrpcServerConfig) Reset()
- func (x *GrpcServerConfig) String() string
- func (m *GrpcServerConfig) Validate() error
- func (m *GrpcServerConfig) ValidateAll() error
- type GrpcServerConfigMultiError
- type GrpcServerConfigValidationError
- func (e GrpcServerConfigValidationError) Cause() error
- func (e GrpcServerConfigValidationError) Error() string
- func (e GrpcServerConfigValidationError) ErrorName() string
- func (e GrpcServerConfigValidationError) Field() string
- func (e GrpcServerConfigValidationError) Key() bool
- func (e GrpcServerConfigValidationError) Reason() string
- type HttpClientConfig
- func (*HttpClientConfig) Descriptor() ([]byte, []int)deprecated
- func (x *HttpClientConfig) GetDialTimeout() *durationpb.Duration
- func (x *HttpClientConfig) GetDiscoveryName() string
- func (x *HttpClientConfig) GetEndpoint() string
- func (x *HttpClientConfig) GetMiddlewares() []string
- func (x *HttpClientConfig) GetSelector() *SelectorConfig
- func (x *HttpClientConfig) GetTimeout() *durationpb.Duration
- func (x *HttpClientConfig) GetTlsConfig() *v1.TLSConfig
- func (*HttpClientConfig) ProtoMessage()
- func (x *HttpClientConfig) ProtoReflect() protoreflect.Message
- func (x *HttpClientConfig) Reset()
- func (x *HttpClientConfig) String() string
- func (m *HttpClientConfig) Validate() error
- func (m *HttpClientConfig) ValidateAll() error
- type HttpClientConfigMultiError
- type HttpClientConfigValidationError
- func (e HttpClientConfigValidationError) Cause() error
- func (e HttpClientConfigValidationError) Error() string
- func (e HttpClientConfigValidationError) ErrorName() string
- func (e HttpClientConfigValidationError) Field() string
- func (e HttpClientConfigValidationError) Key() bool
- func (e HttpClientConfigValidationError) Reason() string
- type HttpServerConfig
- func (*HttpServerConfig) Descriptor() ([]byte, []int)deprecated
- func (x *HttpServerConfig) GetAddr() string
- func (x *HttpServerConfig) GetCors() *cors.Cors
- func (x *HttpServerConfig) GetEnablePprof() bool
- func (x *HttpServerConfig) GetMiddlewares() []string
- func (x *HttpServerConfig) GetNetwork() string
- func (x *HttpServerConfig) GetTimeout() *durationpb.Duration
- func (x *HttpServerConfig) GetTlsConfig() *v1.TLSConfig
- func (*HttpServerConfig) ProtoMessage()
- func (x *HttpServerConfig) ProtoReflect() protoreflect.Message
- func (x *HttpServerConfig) Reset()
- func (x *HttpServerConfig) String() string
- func (m *HttpServerConfig) Validate() error
- func (m *HttpServerConfig) ValidateAll() error
- type HttpServerConfigMultiError
- type HttpServerConfigValidationError
- func (e HttpServerConfigValidationError) Cause() error
- func (e HttpServerConfigValidationError) Error() string
- func (e HttpServerConfigValidationError) ErrorName() string
- func (e HttpServerConfigValidationError) Field() string
- func (e HttpServerConfigValidationError) Key() bool
- func (e HttpServerConfigValidationError) Reason() string
- type SelectorConfig
- func (*SelectorConfig) Descriptor() ([]byte, []int)deprecated
- func (x *SelectorConfig) GetVersion() string
- func (*SelectorConfig) ProtoMessage()
- func (x *SelectorConfig) ProtoReflect() protoreflect.Message
- func (x *SelectorConfig) Reset()
- func (x *SelectorConfig) String() string
- func (m *SelectorConfig) Validate() error
- func (m *SelectorConfig) ValidateAll() error
- type SelectorConfigMultiError
- type SelectorConfigValidationError
- func (e SelectorConfigValidationError) Cause() error
- func (e SelectorConfigValidationError) Error() string
- func (e SelectorConfigValidationError) ErrorName() string
- func (e SelectorConfigValidationError) Field() string
- func (e SelectorConfigValidationError) Key() bool
- func (e SelectorConfigValidationError) Reason() string
- type Server
- func (*Server) Descriptor() ([]byte, []int)deprecated
- func (x *Server) GetCustomConfig() *structpb.Struct
- func (x *Server) GetGrpc() *GrpcServerConfig
- func (x *Server) GetHttp() *HttpServerConfig
- func (x *Server) GetName() string
- func (x *Server) GetProtocol() string
- func (*Server) ProtoMessage()
- func (x *Server) ProtoReflect() protoreflect.Message
- func (x *Server) Reset()
- func (x *Server) String() string
- func (m *Server) Validate() error
- func (m *Server) ValidateAll() error
- type ServerMultiError
- type ServerValidationError
- type Servers
- func (*Servers) Descriptor() ([]byte, []int)deprecated
- func (x *Servers) GetServers() []*Server
- func (*Servers) ProtoMessage()
- func (x *Servers) ProtoReflect() protoreflect.Message
- func (x *Servers) Reset()
- func (x *Servers) String() string
- func (m *Servers) Validate() error
- func (m *Servers) ValidateAll() error
- type ServersMultiError
- type ServersValidationError
Constants ¶
This section is empty.
Variables ¶
var File_runtime_transport_v1_grpc_proto protoreflect.FileDescriptor
var File_runtime_transport_v1_http_proto protoreflect.FileDescriptor
var File_runtime_transport_v1_selector_proto protoreflect.FileDescriptor
var File_runtime_transport_v1_transport_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// name is the logical name for this client configuration.
// It is used to uniquely identify this client dependency in the application.
// If empty, the protocol name may be used as a default identifier.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// protocol is the name of the transport protocol to use.
// e.g., "grpc", "http". This name is used to look up a registered ProtocolFactory.
Protocol string `protobuf:"bytes,2,opt,name=protocol,proto3" json:"protocol,omitempty"`
// gRPC client configuration.
Grpc *GrpcClientConfig `protobuf:"bytes,3,opt,name=grpc,proto3,oneof" json:"grpc,omitempty"`
// HTTP client configuration.
Http *HttpClientConfig `protobuf:"bytes,4,opt,name=http,proto3,oneof" json:"http,omitempty"`
// custom_config is used for non-standard or user-defined transport protocols.
CustomConfig *structpb.Struct `protobuf:"bytes,5,opt,name=custom_config,json=customConfig,proto3,oneof" json:"custom_config,omitempty"`
// contains filtered or unexported fields
}
Client is a generic container for various client-side transport configurations.
func (*Client) Descriptor
deprecated
func (*Client) GetCustomConfig ¶
func (*Client) GetGrpc ¶
func (x *Client) GetGrpc() *GrpcClientConfig
func (*Client) GetHttp ¶
func (x *Client) GetHttp() *HttpClientConfig
func (*Client) GetProtocol ¶
func (*Client) ProtoMessage ¶
func (*Client) ProtoMessage()
func (*Client) ProtoReflect ¶
func (x *Client) ProtoReflect() protoreflect.Message
func (*Client) Validate ¶
Validate checks the field values on Client with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*Client) ValidateAll ¶
ValidateAll checks the field values on Client with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ClientMultiError, or nil if none found.
type ClientMultiError ¶
type ClientMultiError []error
ClientMultiError is an error wrapping multiple validation errors returned by Client.ValidateAll() if the designated constraints aren't met.
func (ClientMultiError) AllErrors ¶
func (m ClientMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ClientMultiError) Error ¶
func (m ClientMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ClientValidationError ¶
type ClientValidationError struct {
// contains filtered or unexported fields
}
ClientValidationError is the validation error returned by Client.Validate if the designated constraints aren't met.
func (ClientValidationError) Cause ¶
func (e ClientValidationError) Cause() error
Cause function returns cause value.
func (ClientValidationError) Error ¶
func (e ClientValidationError) Error() string
Error satisfies the builtin error interface
func (ClientValidationError) ErrorName ¶
func (e ClientValidationError) ErrorName() string
ErrorName returns error name.
func (ClientValidationError) Field ¶
func (e ClientValidationError) Field() string
Field function returns field value.
func (ClientValidationError) Key ¶
func (e ClientValidationError) Key() bool
Key function returns key value.
func (ClientValidationError) Reason ¶
func (e ClientValidationError) Reason() string
Reason function returns reason value.
type Clients ¶ added in v0.2.7
type Clients struct {
// clients is a list of client configurations for services that this service depends on.
// This list will be converted into a map in the application's bootstrap logic,
// using the 'name' field from each Client message as the key.
Clients []*Client `protobuf:"bytes,1,rep,name=clients,proto3" json:"clients,omitempty"`
// contains filtered or unexported fields
}
Clients defines a list of client configurations for services that this service depends on. This list will be converted into a map in the application's bootstrap logic, using the 'name' field from each Client message as the key.
func (*Clients) Descriptor
deprecated
added in
v0.2.7
func (*Clients) GetClients ¶ added in v0.2.7
func (*Clients) ProtoMessage ¶ added in v0.2.7
func (*Clients) ProtoMessage()
func (*Clients) ProtoReflect ¶ added in v0.2.7
func (x *Clients) ProtoReflect() protoreflect.Message
func (*Clients) Validate ¶ added in v0.2.7
Validate checks the field values on Clients with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*Clients) ValidateAll ¶ added in v0.2.7
ValidateAll checks the field values on Clients with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ClientsMultiError, or nil if none found.
type ClientsMultiError ¶ added in v0.2.7
type ClientsMultiError []error
ClientsMultiError is an error wrapping multiple validation errors returned by Clients.ValidateAll() if the designated constraints aren't met.
func (ClientsMultiError) AllErrors ¶ added in v0.2.7
func (m ClientsMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ClientsMultiError) Error ¶ added in v0.2.7
func (m ClientsMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ClientsValidationError ¶ added in v0.2.7
type ClientsValidationError struct {
// contains filtered or unexported fields
}
ClientsValidationError is the validation error returned by Clients.Validate if the designated constraints aren't met.
func (ClientsValidationError) Cause ¶ added in v0.2.7
func (e ClientsValidationError) Cause() error
Cause function returns cause value.
func (ClientsValidationError) Error ¶ added in v0.2.7
func (e ClientsValidationError) Error() string
Error satisfies the builtin error interface
func (ClientsValidationError) ErrorName ¶ added in v0.2.7
func (e ClientsValidationError) ErrorName() string
ErrorName returns error name.
func (ClientsValidationError) Field ¶ added in v0.2.7
func (e ClientsValidationError) Field() string
Field function returns field value.
func (ClientsValidationError) Key ¶ added in v0.2.7
func (e ClientsValidationError) Key() bool
Key function returns key value.
func (ClientsValidationError) Reason ¶ added in v0.2.7
func (e ClientsValidationError) Reason() string
Reason function returns reason value.
type GrpcClientConfig ¶
type GrpcClientConfig struct {
// endpoint is the target to connect to.
// It can be a direct address or a discovery service URI.
// e.g., "direct://127.0.0.1:9000" or "discovery:///your-service-name"
Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
// timeout is the request timeout for a single RPC call.
Timeout *durationpb.Duration `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout,omitempty"`
// middlewares is a list of middleware names to be applied to the client.
Middlewares []string `protobuf:"bytes,3,rep,name=middlewares,proto3" json:"middlewares,omitempty"`
// selector defines the node selection strategy for the client.
Selector *SelectorConfig `protobuf:"bytes,4,opt,name=selector,proto3" json:"selector,omitempty"`
// discovery_name specifies the name of the discovery client to use from the application container.
// If empty, and multiple discovery clients are available, an error will be returned.
DiscoveryName *string `protobuf:"bytes,5,opt,name=discovery_name,json=discoveryName,proto3,oneof" json:"discovery_name,omitempty"`
// tls_config defines the TLS settings for the gRPC client.
TlsConfig *v1.TLSConfig `protobuf:"bytes,6,opt,name=tls_config,json=tlsConfig,proto3,oneof" json:"tls_config,omitempty"`
// contains filtered or unexported fields
}
GrpcClientConfig defines the core configuration for creating a Kratos gRPC client.
func (*GrpcClientConfig) Descriptor
deprecated
func (*GrpcClientConfig) Descriptor() ([]byte, []int)
Deprecated: Use GrpcClientConfig.ProtoReflect.Descriptor instead.
func (*GrpcClientConfig) GetDiscoveryName ¶
func (x *GrpcClientConfig) GetDiscoveryName() string
func (*GrpcClientConfig) GetEndpoint ¶
func (x *GrpcClientConfig) GetEndpoint() string
func (*GrpcClientConfig) GetMiddlewares ¶
func (x *GrpcClientConfig) GetMiddlewares() []string
func (*GrpcClientConfig) GetSelector ¶
func (x *GrpcClientConfig) GetSelector() *SelectorConfig
func (*GrpcClientConfig) GetTimeout ¶
func (x *GrpcClientConfig) GetTimeout() *durationpb.Duration
func (*GrpcClientConfig) GetTlsConfig ¶
func (x *GrpcClientConfig) GetTlsConfig() *v1.TLSConfig
func (*GrpcClientConfig) ProtoMessage ¶
func (*GrpcClientConfig) ProtoMessage()
func (*GrpcClientConfig) ProtoReflect ¶
func (x *GrpcClientConfig) ProtoReflect() protoreflect.Message
func (*GrpcClientConfig) Reset ¶
func (x *GrpcClientConfig) Reset()
func (*GrpcClientConfig) String ¶
func (x *GrpcClientConfig) String() string
func (*GrpcClientConfig) Validate ¶
func (m *GrpcClientConfig) Validate() error
Validate checks the field values on GrpcClientConfig with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*GrpcClientConfig) ValidateAll ¶
func (m *GrpcClientConfig) ValidateAll() error
ValidateAll checks the field values on GrpcClientConfig with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in GrpcClientConfigMultiError, or nil if none found.
type GrpcClientConfigMultiError ¶
type GrpcClientConfigMultiError []error
GrpcClientConfigMultiError is an error wrapping multiple validation errors returned by GrpcClientConfig.ValidateAll() if the designated constraints aren't met.
func (GrpcClientConfigMultiError) AllErrors ¶
func (m GrpcClientConfigMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (GrpcClientConfigMultiError) Error ¶
func (m GrpcClientConfigMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type GrpcClientConfigValidationError ¶
type GrpcClientConfigValidationError struct {
// contains filtered or unexported fields
}
GrpcClientConfigValidationError is the validation error returned by GrpcClientConfig.Validate if the designated constraints aren't met.
func (GrpcClientConfigValidationError) Cause ¶
func (e GrpcClientConfigValidationError) Cause() error
Cause function returns cause value.
func (GrpcClientConfigValidationError) Error ¶
func (e GrpcClientConfigValidationError) Error() string
Error satisfies the builtin error interface
func (GrpcClientConfigValidationError) ErrorName ¶
func (e GrpcClientConfigValidationError) ErrorName() string
ErrorName returns error name.
func (GrpcClientConfigValidationError) Field ¶
func (e GrpcClientConfigValidationError) Field() string
Field function returns field value.
func (GrpcClientConfigValidationError) Key ¶
func (e GrpcClientConfigValidationError) Key() bool
Key function returns key value.
func (GrpcClientConfigValidationError) Reason ¶
func (e GrpcClientConfigValidationError) Reason() string
Reason function returns reason value.
type GrpcServerConfig ¶
type GrpcServerConfig struct {
// network is the network type for the server to listen on.
// e.g., "tcp", "unix"
Network string `protobuf:"bytes,1,opt,name=network,proto3" json:"network,omitempty"`
// addr is the address for the server to listen on.
// e.g., "0.0.0.0:9000"
Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"`
// timeout is the request handling timeout.
Timeout *durationpb.Duration `protobuf:"bytes,3,opt,name=timeout,proto3" json:"timeout,omitempty"`
// middlewares is a list of middleware names to be applied to the server.
// The framework will look up these names in a middleware provider.
Middlewares []string `protobuf:"bytes,4,rep,name=middlewares,proto3" json:"middlewares,omitempty"`
// tls_config defines the TLS settings for the gRPC server.
TlsConfig *v1.TLSConfig `protobuf:"bytes,5,opt,name=tls_config,json=tlsConfig,proto3,oneof" json:"tls_config,omitempty"`
// contains filtered or unexported fields
}
GrpcServerConfig defines the core configuration for a Kratos gRPC server.
func (*GrpcServerConfig) Descriptor
deprecated
func (*GrpcServerConfig) Descriptor() ([]byte, []int)
Deprecated: Use GrpcServerConfig.ProtoReflect.Descriptor instead.
func (*GrpcServerConfig) GetAddr ¶
func (x *GrpcServerConfig) GetAddr() string
func (*GrpcServerConfig) GetMiddlewares ¶
func (x *GrpcServerConfig) GetMiddlewares() []string
func (*GrpcServerConfig) GetNetwork ¶
func (x *GrpcServerConfig) GetNetwork() string
func (*GrpcServerConfig) GetTimeout ¶
func (x *GrpcServerConfig) GetTimeout() *durationpb.Duration
func (*GrpcServerConfig) GetTlsConfig ¶
func (x *GrpcServerConfig) GetTlsConfig() *v1.TLSConfig
func (*GrpcServerConfig) ProtoMessage ¶
func (*GrpcServerConfig) ProtoMessage()
func (*GrpcServerConfig) ProtoReflect ¶
func (x *GrpcServerConfig) ProtoReflect() protoreflect.Message
func (*GrpcServerConfig) Reset ¶
func (x *GrpcServerConfig) Reset()
func (*GrpcServerConfig) String ¶
func (x *GrpcServerConfig) String() string
func (*GrpcServerConfig) Validate ¶
func (m *GrpcServerConfig) Validate() error
Validate checks the field values on GrpcServerConfig with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*GrpcServerConfig) ValidateAll ¶
func (m *GrpcServerConfig) ValidateAll() error
ValidateAll checks the field values on GrpcServerConfig with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in GrpcServerConfigMultiError, or nil if none found.
type GrpcServerConfigMultiError ¶
type GrpcServerConfigMultiError []error
GrpcServerConfigMultiError is an error wrapping multiple validation errors returned by GrpcServerConfig.ValidateAll() if the designated constraints aren't met.
func (GrpcServerConfigMultiError) AllErrors ¶
func (m GrpcServerConfigMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (GrpcServerConfigMultiError) Error ¶
func (m GrpcServerConfigMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type GrpcServerConfigValidationError ¶
type GrpcServerConfigValidationError struct {
// contains filtered or unexported fields
}
GrpcServerConfigValidationError is the validation error returned by GrpcServerConfig.Validate if the designated constraints aren't met.
func (GrpcServerConfigValidationError) Cause ¶
func (e GrpcServerConfigValidationError) Cause() error
Cause function returns cause value.
func (GrpcServerConfigValidationError) Error ¶
func (e GrpcServerConfigValidationError) Error() string
Error satisfies the builtin error interface
func (GrpcServerConfigValidationError) ErrorName ¶
func (e GrpcServerConfigValidationError) ErrorName() string
ErrorName returns error name.
func (GrpcServerConfigValidationError) Field ¶
func (e GrpcServerConfigValidationError) Field() string
Field function returns field value.
func (GrpcServerConfigValidationError) Key ¶
func (e GrpcServerConfigValidationError) Key() bool
Key function returns key value.
func (GrpcServerConfigValidationError) Reason ¶
func (e GrpcServerConfigValidationError) Reason() string
Reason function returns reason value.
type HttpClientConfig ¶
type HttpClientConfig struct {
// endpoint is the target to connect to.
// It can be a direct address or a discovery service URI.
// e.g., "http://127.0.0.1:8000" or "discovery:///your-service-name"
Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
// timeout is the request timeout for a single HTTP call.
Timeout *durationpb.Duration `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout,omitempty"`
// middlewares is a list of middleware names to be applied to the client.
Middlewares []string `protobuf:"bytes,3,rep,name=middlewares,proto3" json:"middlewares,omitempty"`
// selector defines the node selection strategy for the client.
Selector *SelectorConfig `protobuf:"bytes,4,opt,name=selector,proto3" json:"selector,omitempty"`
// discovery_name is the name of the discovery client to use for service discovery.
// This is used when the endpoint is a discovery service URI.
DiscoveryName string `protobuf:"bytes,5,opt,name=discovery_name,json=discoveryName,proto3" json:"discovery_name,omitempty"`
// tls_config defines the TLS settings for the HTTP client.
TlsConfig *v1.TLSConfig `protobuf:"bytes,6,opt,name=tls_config,json=tlsConfig,proto3,oneof" json:"tls_config,omitempty"`
// dial_timeout is the timeout for establishing a connection.
DialTimeout *durationpb.Duration `protobuf:"bytes,7,opt,name=dial_timeout,json=dialTimeout,proto3,oneof" json:"dial_timeout,omitempty"`
// contains filtered or unexported fields
}
HttpClientConfig defines the core configuration for creating a Kratos HTTP client.
func (*HttpClientConfig) Descriptor
deprecated
func (*HttpClientConfig) Descriptor() ([]byte, []int)
Deprecated: Use HttpClientConfig.ProtoReflect.Descriptor instead.
func (*HttpClientConfig) GetDialTimeout ¶
func (x *HttpClientConfig) GetDialTimeout() *durationpb.Duration
func (*HttpClientConfig) GetDiscoveryName ¶
func (x *HttpClientConfig) GetDiscoveryName() string
func (*HttpClientConfig) GetEndpoint ¶
func (x *HttpClientConfig) GetEndpoint() string
func (*HttpClientConfig) GetMiddlewares ¶
func (x *HttpClientConfig) GetMiddlewares() []string
func (*HttpClientConfig) GetSelector ¶
func (x *HttpClientConfig) GetSelector() *SelectorConfig
func (*HttpClientConfig) GetTimeout ¶
func (x *HttpClientConfig) GetTimeout() *durationpb.Duration
func (*HttpClientConfig) GetTlsConfig ¶
func (x *HttpClientConfig) GetTlsConfig() *v1.TLSConfig
func (*HttpClientConfig) ProtoMessage ¶
func (*HttpClientConfig) ProtoMessage()
func (*HttpClientConfig) ProtoReflect ¶
func (x *HttpClientConfig) ProtoReflect() protoreflect.Message
func (*HttpClientConfig) Reset ¶
func (x *HttpClientConfig) Reset()
func (*HttpClientConfig) String ¶
func (x *HttpClientConfig) String() string
func (*HttpClientConfig) Validate ¶
func (m *HttpClientConfig) Validate() error
Validate checks the field values on HttpClientConfig with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*HttpClientConfig) ValidateAll ¶
func (m *HttpClientConfig) ValidateAll() error
ValidateAll checks the field values on HttpClientConfig with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in HttpClientConfigMultiError, or nil if none found.
type HttpClientConfigMultiError ¶
type HttpClientConfigMultiError []error
HttpClientConfigMultiError is an error wrapping multiple validation errors returned by HttpClientConfig.ValidateAll() if the designated constraints aren't met.
func (HttpClientConfigMultiError) AllErrors ¶
func (m HttpClientConfigMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (HttpClientConfigMultiError) Error ¶
func (m HttpClientConfigMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type HttpClientConfigValidationError ¶
type HttpClientConfigValidationError struct {
// contains filtered or unexported fields
}
HttpClientConfigValidationError is the validation error returned by HttpClientConfig.Validate if the designated constraints aren't met.
func (HttpClientConfigValidationError) Cause ¶
func (e HttpClientConfigValidationError) Cause() error
Cause function returns cause value.
func (HttpClientConfigValidationError) Error ¶
func (e HttpClientConfigValidationError) Error() string
Error satisfies the builtin error interface
func (HttpClientConfigValidationError) ErrorName ¶
func (e HttpClientConfigValidationError) ErrorName() string
ErrorName returns error name.
func (HttpClientConfigValidationError) Field ¶
func (e HttpClientConfigValidationError) Field() string
Field function returns field value.
func (HttpClientConfigValidationError) Key ¶
func (e HttpClientConfigValidationError) Key() bool
Key function returns key value.
func (HttpClientConfigValidationError) Reason ¶
func (e HttpClientConfigValidationError) Reason() string
Reason function returns reason value.
type HttpServerConfig ¶
type HttpServerConfig struct {
// addr is the address for the server to listen on.
// e.g., "0.0.0.0:8000"
Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"`
// timeout is the request handling timeout.
Timeout *durationpb.Duration `protobuf:"bytes,2,opt,name=timeout,proto3" json:"timeout,omitempty"`
// middlewares is a list of middleware names to be applied to the server.
// The framework will look up these names in a middleware provider.
Middlewares []string `protobuf:"bytes,3,rep,name=middlewares,proto3" json:"middlewares,omitempty"`
// tls_config defines the TLS settings for the HTTP server.
TlsConfig *v1.TLSConfig `protobuf:"bytes,4,opt,name=tls_config,json=tlsConfig,proto3,oneof" json:"tls_config,omitempty"`
// network specifies the network type, e.g., "tcp", "tcp4", "tcp6".
Network string `protobuf:"bytes,5,opt,name=network,proto3" json:"network,omitempty"`
// cors configuration for the HTTP server
Cors *cors.Cors `protobuf:"bytes,6,opt,name=cors,proto3,oneof" json:"cors,omitempty"`
// enable_pprof indicates whether to enable pprof debugging endpoints.
EnablePprof bool `protobuf:"varint,7,opt,name=enable_pprof,json=enablePprof,proto3" json:"enable_pprof,omitempty"`
// contains filtered or unexported fields
}
HttpServerConfig defines the core configuration for a Kratos HTTP server.
func (*HttpServerConfig) Descriptor
deprecated
func (*HttpServerConfig) Descriptor() ([]byte, []int)
Deprecated: Use HttpServerConfig.ProtoReflect.Descriptor instead.
func (*HttpServerConfig) GetAddr ¶
func (x *HttpServerConfig) GetAddr() string
func (*HttpServerConfig) GetCors ¶
func (x *HttpServerConfig) GetCors() *cors.Cors
func (*HttpServerConfig) GetEnablePprof ¶
func (x *HttpServerConfig) GetEnablePprof() bool
func (*HttpServerConfig) GetMiddlewares ¶
func (x *HttpServerConfig) GetMiddlewares() []string
func (*HttpServerConfig) GetNetwork ¶
func (x *HttpServerConfig) GetNetwork() string
func (*HttpServerConfig) GetTimeout ¶
func (x *HttpServerConfig) GetTimeout() *durationpb.Duration
func (*HttpServerConfig) GetTlsConfig ¶
func (x *HttpServerConfig) GetTlsConfig() *v1.TLSConfig
func (*HttpServerConfig) ProtoMessage ¶
func (*HttpServerConfig) ProtoMessage()
func (*HttpServerConfig) ProtoReflect ¶
func (x *HttpServerConfig) ProtoReflect() protoreflect.Message
func (*HttpServerConfig) Reset ¶
func (x *HttpServerConfig) Reset()
func (*HttpServerConfig) String ¶
func (x *HttpServerConfig) String() string
func (*HttpServerConfig) Validate ¶
func (m *HttpServerConfig) Validate() error
Validate checks the field values on HttpServerConfig with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*HttpServerConfig) ValidateAll ¶
func (m *HttpServerConfig) ValidateAll() error
ValidateAll checks the field values on HttpServerConfig with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in HttpServerConfigMultiError, or nil if none found.
type HttpServerConfigMultiError ¶
type HttpServerConfigMultiError []error
HttpServerConfigMultiError is an error wrapping multiple validation errors returned by HttpServerConfig.ValidateAll() if the designated constraints aren't met.
func (HttpServerConfigMultiError) AllErrors ¶
func (m HttpServerConfigMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (HttpServerConfigMultiError) Error ¶
func (m HttpServerConfigMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type HttpServerConfigValidationError ¶
type HttpServerConfigValidationError struct {
// contains filtered or unexported fields
}
HttpServerConfigValidationError is the validation error returned by HttpServerConfig.Validate if the designated constraints aren't met.
func (HttpServerConfigValidationError) Cause ¶
func (e HttpServerConfigValidationError) Cause() error
Cause function returns cause value.
func (HttpServerConfigValidationError) Error ¶
func (e HttpServerConfigValidationError) Error() string
Error satisfies the builtin error interface
func (HttpServerConfigValidationError) ErrorName ¶
func (e HttpServerConfigValidationError) ErrorName() string
ErrorName returns error name.
func (HttpServerConfigValidationError) Field ¶
func (e HttpServerConfigValidationError) Field() string
Field function returns field value.
func (HttpServerConfigValidationError) Key ¶
func (e HttpServerConfigValidationError) Key() bool
Key function returns key value.
func (HttpServerConfigValidationError) Reason ¶
func (e HttpServerConfigValidationError) Reason() string
Reason function returns reason value.
type SelectorConfig ¶
type SelectorConfig struct {
// version is a filter for the service version.
// e.g., "v1.0.0"
Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
// contains filtered or unexported fields
}
SelectorConfig defines the client-side node selection strategy.
func (*SelectorConfig) Descriptor
deprecated
func (*SelectorConfig) Descriptor() ([]byte, []int)
Deprecated: Use SelectorConfig.ProtoReflect.Descriptor instead.
func (*SelectorConfig) GetVersion ¶
func (x *SelectorConfig) GetVersion() string
func (*SelectorConfig) ProtoMessage ¶
func (*SelectorConfig) ProtoMessage()
func (*SelectorConfig) ProtoReflect ¶
func (x *SelectorConfig) ProtoReflect() protoreflect.Message
func (*SelectorConfig) Reset ¶
func (x *SelectorConfig) Reset()
func (*SelectorConfig) String ¶
func (x *SelectorConfig) String() string
func (*SelectorConfig) Validate ¶
func (m *SelectorConfig) Validate() error
Validate checks the field values on SelectorConfig with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*SelectorConfig) ValidateAll ¶
func (m *SelectorConfig) ValidateAll() error
ValidateAll checks the field values on SelectorConfig with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in SelectorConfigMultiError, or nil if none found.
type SelectorConfigMultiError ¶
type SelectorConfigMultiError []error
SelectorConfigMultiError is an error wrapping multiple validation errors returned by SelectorConfig.ValidateAll() if the designated constraints aren't met.
func (SelectorConfigMultiError) AllErrors ¶
func (m SelectorConfigMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (SelectorConfigMultiError) Error ¶
func (m SelectorConfigMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type SelectorConfigValidationError ¶
type SelectorConfigValidationError struct {
// contains filtered or unexported fields
}
SelectorConfigValidationError is the validation error returned by SelectorConfig.Validate if the designated constraints aren't met.
func (SelectorConfigValidationError) Cause ¶
func (e SelectorConfigValidationError) Cause() error
Cause function returns cause value.
func (SelectorConfigValidationError) Error ¶
func (e SelectorConfigValidationError) Error() string
Error satisfies the builtin error interface
func (SelectorConfigValidationError) ErrorName ¶
func (e SelectorConfigValidationError) ErrorName() string
ErrorName returns error name.
func (SelectorConfigValidationError) Field ¶
func (e SelectorConfigValidationError) Field() string
Field function returns field value.
func (SelectorConfigValidationError) Key ¶
func (e SelectorConfigValidationError) Key() bool
Key function returns key value.
func (SelectorConfigValidationError) Reason ¶
func (e SelectorConfigValidationError) Reason() string
Reason function returns reason value.
type Server ¶
type Server struct {
// name is the logical name for this server configuration.
// It is used to identify this server in the application's configuration.
// If empty, the protocol name may be used as a default identifier.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// protocol is the name of the transport protocol to use.
// e.g., "grpc", "http". This name is used to look up a registered ProtocolFactory.
Protocol string `protobuf:"bytes,2,opt,name=protocol,proto3" json:"protocol,omitempty"`
// gRPC server configuration.
Grpc *GrpcServerConfig `protobuf:"bytes,3,opt,name=grpc,proto3,oneof" json:"grpc,omitempty"`
// HTTP server configuration.
Http *HttpServerConfig `protobuf:"bytes,4,opt,name=http,proto3,oneof" json:"http,omitempty"`
// custom_config is used for non-standard or user-defined transport protocols.
// It allows for flexible configuration without modifying this core proto file.
CustomConfig *structpb.Struct `protobuf:"bytes,5,opt,name=custom_config,json=customConfig,proto3,oneof" json:"custom_config,omitempty"`
// contains filtered or unexported fields
}
Server is a generic container for various server-side transport configurations.
func (*Server) Descriptor
deprecated
func (*Server) GetCustomConfig ¶
func (*Server) GetGrpc ¶
func (x *Server) GetGrpc() *GrpcServerConfig
func (*Server) GetHttp ¶
func (x *Server) GetHttp() *HttpServerConfig
func (*Server) GetProtocol ¶
func (*Server) ProtoMessage ¶
func (*Server) ProtoMessage()
func (*Server) ProtoReflect ¶
func (x *Server) ProtoReflect() protoreflect.Message
func (*Server) Validate ¶
Validate checks the field values on Server with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*Server) ValidateAll ¶
ValidateAll checks the field values on Server with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ServerMultiError, or nil if none found.
type ServerMultiError ¶
type ServerMultiError []error
ServerMultiError is an error wrapping multiple validation errors returned by Server.ValidateAll() if the designated constraints aren't met.
func (ServerMultiError) AllErrors ¶
func (m ServerMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ServerMultiError) Error ¶
func (m ServerMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ServerValidationError ¶
type ServerValidationError struct {
// contains filtered or unexported fields
}
ServerValidationError is the validation error returned by Server.Validate if the designated constraints aren't met.
func (ServerValidationError) Cause ¶
func (e ServerValidationError) Cause() error
Cause function returns cause value.
func (ServerValidationError) Error ¶
func (e ServerValidationError) Error() string
Error satisfies the builtin error interface
func (ServerValidationError) ErrorName ¶
func (e ServerValidationError) ErrorName() string
ErrorName returns error name.
func (ServerValidationError) Field ¶
func (e ServerValidationError) Field() string
Field function returns field value.
func (ServerValidationError) Key ¶
func (e ServerValidationError) Key() bool
Key function returns key value.
func (ServerValidationError) Reason ¶
func (e ServerValidationError) Reason() string
Reason function returns reason value.
type Servers ¶ added in v0.2.7
type Servers struct {
// servers is a list of server endpoints that this service will expose.
// A service can listen on multiple protocols simultaneously, e.g., both gRPC and HTTP.
Servers []*Server `protobuf:"bytes,1,rep,name=servers,proto3" json:"servers,omitempty"`
// contains filtered or unexported fields
}
Servers defines a complete microservice unit. It encapsulates the service's identity, its server endpoints, its client dependencies, and its middleware configurations.
func (*Servers) Descriptor
deprecated
added in
v0.2.7
func (*Servers) GetServers ¶ added in v0.2.7
func (*Servers) ProtoMessage ¶ added in v0.2.7
func (*Servers) ProtoMessage()
func (*Servers) ProtoReflect ¶ added in v0.2.7
func (x *Servers) ProtoReflect() protoreflect.Message
func (*Servers) Validate ¶ added in v0.2.7
Validate checks the field values on Servers with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*Servers) ValidateAll ¶ added in v0.2.7
ValidateAll checks the field values on Servers with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ServersMultiError, or nil if none found.
type ServersMultiError ¶ added in v0.2.7
type ServersMultiError []error
ServersMultiError is an error wrapping multiple validation errors returned by Servers.ValidateAll() if the designated constraints aren't met.
func (ServersMultiError) AllErrors ¶ added in v0.2.7
func (m ServersMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ServersMultiError) Error ¶ added in v0.2.7
func (m ServersMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ServersValidationError ¶ added in v0.2.7
type ServersValidationError struct {
// contains filtered or unexported fields
}
ServersValidationError is the validation error returned by Servers.Validate if the designated constraints aren't met.
func (ServersValidationError) Cause ¶ added in v0.2.7
func (e ServersValidationError) Cause() error
Cause function returns cause value.
func (ServersValidationError) Error ¶ added in v0.2.7
func (e ServersValidationError) Error() string
Error satisfies the builtin error interface
func (ServersValidationError) ErrorName ¶ added in v0.2.7
func (e ServersValidationError) ErrorName() string
ErrorName returns error name.
func (ServersValidationError) Field ¶ added in v0.2.7
func (e ServersValidationError) Field() string
Field function returns field value.
func (ServersValidationError) Key ¶ added in v0.2.7
func (e ServersValidationError) Key() bool
Key function returns key value.
func (ServersValidationError) Reason ¶ added in v0.2.7
func (e ServersValidationError) Reason() string
Reason function returns reason value.