Documentation ¶
Index ¶
- Constants
- Variables
- func Create(c *Conf) (Registrar, Discovery, error)
- func Register(name string, factory Factory)
- type Conf
- func (*Conf) Descriptor() ([]byte, []int)deprecated
- func (x *Conf) GetCacheDir() string
- func (x *Conf) GetDialTimeout() *durationpb.Duration
- func (x *Conf) GetEnableHealthCheck() bool
- func (x *Conf) GetEndpoints() []string
- func (x *Conf) GetLogDir() string
- func (x *Conf) GetNamespace() string
- func (x *Conf) GetProviderType() ProviderType
- func (*Conf) ProtoMessage()
- func (x *Conf) ProtoReflect() protoreflect.Message
- func (x *Conf) Reset()
- func (x *Conf) String() string
- func (m *Conf) Validate() error
- func (m *Conf) ValidateAll() error
- type ConfMultiError
- type ConfValidationError
- type Discovery
- type Factory
- type ProviderType
- func (ProviderType) Descriptor() protoreflect.EnumDescriptor
- func (x ProviderType) Enum() *ProviderType
- func (ProviderType) EnumDescriptor() ([]byte, []int)deprecated
- func (x ProviderType) Number() protoreflect.EnumNumber
- func (x ProviderType) String() string
- func (ProviderType) Type() protoreflect.EnumType
- type Registrar
- type Registry
- type ServiceInstance
- type Watcher
Constants ¶
const ( MetaID = "id" // MetaRegion meta region MetaRegion = "region" // MetaZone meta region MetaZone = "zone" // MetaHostname meta hostname MetaHostname = "hostname" // MetaWeight meta weight MetaWeight = "weight" // MetaOffline meta offline MetaOffline = "offline" // MetaAddrs meta public ip addrs MetaAddrs = "addrs" // MetaIPCount meta ip count MetaIPCount = "ip_count" // MetaConnCount meta conn count MetaConnCount = "conn_count" // MetaTcpEndpoint meta conn count MetaTcpEndpoint = "tcp" // MetaWsEndpoint meta conn count MetaWsEndpoint = "ws" // MetaWssEndpoint meta conn count MetaWssEndpoint = "wss" // MetaLastTS meta LastTs MetaLastTS = "LastTs" // PlatformWeb platform web PlatformWeb = "web" )
Variables ¶
var ( ProviderType_name = map[int32]string{ 0: "Unkown", 1: "Etcd", 2: "Consul", 3: "Kube", 4: "Nacos", } ProviderType_value = map[string]int32{ "Unkown": 0, "Etcd": 1, "Consul": 2, "Kube": 3, "Nacos": 4, } )
Enum value maps for ProviderType.
var File_registry_conf_proto protoreflect.FileDescriptor
Functions ¶
Types ¶
type Conf ¶
type Conf struct { ProviderType ProviderType `protobuf:"varint,1,opt,name=providerType,proto3,enum=registry.ProviderType" json:"providerType,omitempty"` Endpoints []string `protobuf:"bytes,2,rep,name=endpoints,proto3" json:"endpoints,omitempty"` DialTimeout *durationpb.Duration `protobuf:"bytes,3,opt,name=dialTimeout,proto3" json:"dialTimeout,omitempty"` EnableHealthCheck bool `protobuf:"varint,4,opt,name=enableHealthCheck,proto3" json:"enableHealthCheck,omitempty"` Namespace string `protobuf:"bytes,5,opt,name=namespace,proto3" json:"namespace,omitempty"` LogDir string `protobuf:"bytes,6,opt,name=logDir,proto3" json:"logDir,omitempty"` CacheDir string `protobuf:"bytes,7,opt,name=cacheDir,proto3" json:"cacheDir,omitempty"` // contains filtered or unexported fields }
func (*Conf) Descriptor
deprecated
func (*Conf) GetCacheDir ¶ added in v0.0.36
func (*Conf) GetDialTimeout ¶ added in v0.0.36
func (x *Conf) GetDialTimeout() *durationpb.Duration
func (*Conf) GetEnableHealthCheck ¶ added in v0.0.36
func (*Conf) GetEndpoints ¶ added in v0.0.36
func (*Conf) GetNamespace ¶ added in v0.0.36
func (*Conf) GetProviderType ¶ added in v0.0.36
func (x *Conf) GetProviderType() ProviderType
func (*Conf) ProtoMessage ¶
func (*Conf) ProtoMessage()
func (*Conf) ProtoReflect ¶
func (x *Conf) ProtoReflect() protoreflect.Message
func (*Conf) Validate ¶
Validate checks the field values on Conf 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 (*Conf) ValidateAll ¶ added in v0.0.8
ValidateAll checks the field values on Conf 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 ConfMultiError, or nil if none found.
type ConfMultiError ¶ added in v0.0.8
type ConfMultiError []error
ConfMultiError is an error wrapping multiple validation errors returned by Conf.ValidateAll() if the designated constraints aren't met.
func (ConfMultiError) AllErrors ¶ added in v0.0.8
func (m ConfMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ConfMultiError) Error ¶ added in v0.0.8
func (m ConfMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ConfValidationError ¶
type ConfValidationError struct {
// contains filtered or unexported fields
}
ConfValidationError is the validation error returned by Conf.Validate if the designated constraints aren't met.
func (ConfValidationError) Cause ¶
func (e ConfValidationError) Cause() error
Cause function returns cause value.
func (ConfValidationError) Error ¶
func (e ConfValidationError) Error() string
Error satisfies the builtin error interface
func (ConfValidationError) ErrorName ¶
func (e ConfValidationError) ErrorName() string
ErrorName returns error name.
func (ConfValidationError) Field ¶
func (e ConfValidationError) Field() string
Field function returns field value.
func (ConfValidationError) Key ¶
func (e ConfValidationError) Key() bool
Key function returns key value.
func (ConfValidationError) Reason ¶
func (e ConfValidationError) Reason() string
Reason function returns reason value.
type ProviderType ¶ added in v0.0.36
type ProviderType int32
const ( ProviderType_Unkown ProviderType = 0 ProviderType_Etcd ProviderType = 1 ProviderType_Consul ProviderType = 2 ProviderType_Kube ProviderType = 3 ProviderType_Nacos ProviderType = 4 )
func (ProviderType) Descriptor ¶ added in v0.0.36
func (ProviderType) Descriptor() protoreflect.EnumDescriptor
func (ProviderType) Enum ¶ added in v0.0.36
func (x ProviderType) Enum() *ProviderType
func (ProviderType) EnumDescriptor
deprecated
added in
v0.0.36
func (ProviderType) EnumDescriptor() ([]byte, []int)
Deprecated: Use ProviderType.Descriptor instead.
func (ProviderType) Number ¶ added in v0.0.36
func (x ProviderType) Number() protoreflect.EnumNumber
func (ProviderType) String ¶ added in v0.0.36
func (x ProviderType) String() string
func (ProviderType) Type ¶ added in v0.0.36
func (ProviderType) Type() protoreflect.EnumType
type Registrar ¶ added in v0.0.36
type Registrar interface { kreg.Registrar // Update the registration. Update(ctx context.Context, service *kreg.ServiceInstance) error }
Registrar is service registrar.
type Registry ¶ added in v0.0.36
type Registry interface { Register(name string, factory Factory) Create(c *Conf) (Registrar, Discovery, error) }
Registry is the interface for callers to get registered middleware.
func NewRegistry ¶ added in v0.0.36
func NewRegistry() Registry
NewRegistry returns a new middleware registry.
type ServiceInstance ¶ added in v0.0.36
type ServiceInstance = kreg.ServiceInstance
Directories ¶
Path | Synopsis |
---|---|
Package kuberegistry registry simply implements the Kubernetes-based Registry
|
Package kuberegistry registry simply implements the Kubernetes-based Registry |