registry

package
v0.15.7 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ServiceKind_name = map[int32]string{
		0: "UNDEFINED_DO_NOT_USE",
		1: "DATABROKER",
		2: "AUTHORIZE",
		3: "AUTHENTICATE",
		4: "PROXY",
		5: "REGISTRY",
		6: "CONSOLE",
		7: "PROMETHEUS_METRICS",
	}
	ServiceKind_value = map[string]int32{
		"UNDEFINED_DO_NOT_USE": 0,
		"DATABROKER":           1,
		"AUTHORIZE":            2,
		"AUTHENTICATE":         3,
		"PROXY":                4,
		"REGISTRY":             5,
		"CONSOLE":              6,
		"PROMETHEUS_METRICS":   7,
	}
)

Enum value maps for ServiceKind.

View Source
var File_registry_proto protoreflect.FileDescriptor

Functions

func RegisterRegistryServer

func RegisterRegistryServer(s *grpc.Server, srv RegistryServer)

Types

type ListRequest

type ListRequest struct {
	Kinds []ServiceKind `protobuf:"varint,1,rep,packed,name=kinds,proto3,enum=registry.ServiceKind" json:"kinds,omitempty"`
	// contains filtered or unexported fields
}

func (*ListRequest) Descriptor deprecated

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

Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.

func (*ListRequest) GetKinds

func (x *ListRequest) GetKinds() []ServiceKind

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) ProtoReflect

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

func (*ListRequest) Reset

func (x *ListRequest) Reset()

func (*ListRequest) String

func (x *ListRequest) String() string

func (*ListRequest) Validate

func (m *ListRequest) Validate() error

Validate checks the field values on ListRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type ListRequestValidationError

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

ListRequestValidationError is the validation error returned by ListRequest.Validate if the designated constraints aren't met.

func (ListRequestValidationError) Cause

Cause function returns cause value.

func (ListRequestValidationError) Error

Error satisfies the builtin error interface

func (ListRequestValidationError) ErrorName

func (e ListRequestValidationError) ErrorName() string

ErrorName returns error name.

func (ListRequestValidationError) Field

Field function returns field value.

func (ListRequestValidationError) Key

Key function returns key value.

func (ListRequestValidationError) Reason

Reason function returns reason value.

type RegisterRequest

type RegisterRequest struct {

	// services this deployment runs
	Services []*Service `protobuf:"bytes,1,rep,name=services,proto3" json:"services,omitempty"`
	// service may optionally provide certain metadata, such as
	// - build version
	// - startup time
	// - bootstrap configuration
	// - OS, OS version, OS hostname
	// - etc
	// this information is not distributed back to the inquiring nodes
	// and may also have a different storage and time to live
	Metadata map[string]*anypb.Any `` /* 157-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*RegisterRequest) Descriptor deprecated

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

Deprecated: Use RegisterRequest.ProtoReflect.Descriptor instead.

func (*RegisterRequest) GetMetadata

func (x *RegisterRequest) GetMetadata() map[string]*anypb.Any

func (*RegisterRequest) GetServices

func (x *RegisterRequest) GetServices() []*Service

func (*RegisterRequest) ProtoMessage

func (*RegisterRequest) ProtoMessage()

func (*RegisterRequest) ProtoReflect

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

func (*RegisterRequest) Reset

func (x *RegisterRequest) Reset()

func (*RegisterRequest) String

func (x *RegisterRequest) String() string

func (*RegisterRequest) Validate

func (m *RegisterRequest) Validate() error

Validate checks the field values on RegisterRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type RegisterRequestValidationError

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

RegisterRequestValidationError is the validation error returned by RegisterRequest.Validate if the designated constraints aren't met.

func (RegisterRequestValidationError) Cause

Cause function returns cause value.

func (RegisterRequestValidationError) Error

Error satisfies the builtin error interface

func (RegisterRequestValidationError) ErrorName

func (e RegisterRequestValidationError) ErrorName() string

ErrorName returns error name.

func (RegisterRequestValidationError) Field

Field function returns field value.

func (RegisterRequestValidationError) Key

Key function returns key value.

func (RegisterRequestValidationError) Reason

Reason function returns reason value.

type RegisterResponse

type RegisterResponse struct {

	// indicates when to report back again
	CallBackAfter *durationpb.Duration `protobuf:"bytes,2,opt,name=call_back_after,json=callBackAfter,proto3" json:"call_back_after,omitempty"`
	// contains filtered or unexported fields
}

func (*RegisterResponse) Descriptor deprecated

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

Deprecated: Use RegisterResponse.ProtoReflect.Descriptor instead.

func (*RegisterResponse) GetCallBackAfter

func (x *RegisterResponse) GetCallBackAfter() *durationpb.Duration

func (*RegisterResponse) ProtoMessage

func (*RegisterResponse) ProtoMessage()

func (*RegisterResponse) ProtoReflect

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

func (*RegisterResponse) Reset

func (x *RegisterResponse) Reset()

func (*RegisterResponse) String

func (x *RegisterResponse) String() string

func (*RegisterResponse) Validate

func (m *RegisterResponse) Validate() error

Validate checks the field values on RegisterResponse with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type RegisterResponseValidationError

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

RegisterResponseValidationError is the validation error returned by RegisterResponse.Validate if the designated constraints aren't met.

func (RegisterResponseValidationError) Cause

Cause function returns cause value.

func (RegisterResponseValidationError) Error

Error satisfies the builtin error interface

func (RegisterResponseValidationError) ErrorName

ErrorName returns error name.

func (RegisterResponseValidationError) Field

Field function returns field value.

func (RegisterResponseValidationError) Key

Key function returns key value.

func (RegisterResponseValidationError) Reason

Reason function returns reason value.

type RegistryClient

type RegistryClient interface {
	// Report is periodically sent by each service to confirm it is still serving
	// with the registry data is persisted with a certain TTL
	Report(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error)
	// List returns current snapshot of the services known to the registry
	List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ServiceList, error)
	// Watch returns a stream of updates
	// for the simplicity of consumer its delivered as full snapshots
	// and is only sent when change is detected
	Watch(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (Registry_WatchClient, error)
}

RegistryClient is the client API for Registry service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewRegistryClient

func NewRegistryClient(cc grpc.ClientConnInterface) RegistryClient

type RegistryServer

type RegistryServer interface {
	// Report is periodically sent by each service to confirm it is still serving
	// with the registry data is persisted with a certain TTL
	Report(context.Context, *RegisterRequest) (*RegisterResponse, error)
	// List returns current snapshot of the services known to the registry
	List(context.Context, *ListRequest) (*ServiceList, error)
	// Watch returns a stream of updates
	// for the simplicity of consumer its delivered as full snapshots
	// and is only sent when change is detected
	Watch(*ListRequest, Registry_WatchServer) error
}

RegistryServer is the server API for Registry service.

type Registry_WatchClient

type Registry_WatchClient interface {
	Recv() (*ServiceList, error)
	grpc.ClientStream
}

type Registry_WatchServer

type Registry_WatchServer interface {
	Send(*ServiceList) error
	grpc.ServerStream
}

type Service

type Service struct {

	// kind is service kind
	Kind ServiceKind `protobuf:"varint,1,opt,name=kind,proto3,enum=registry.ServiceKind" json:"kind,omitempty"`
	// network endpoints this service may be reachable at
	Endpoint string `protobuf:"bytes,3,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
	// contains filtered or unexported fields
}

func (*Service) Descriptor deprecated

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

Deprecated: Use Service.ProtoReflect.Descriptor instead.

func (*Service) GetEndpoint

func (x *Service) GetEndpoint() string

func (*Service) GetKind

func (x *Service) GetKind() ServiceKind

func (*Service) ProtoMessage

func (*Service) ProtoMessage()

func (*Service) ProtoReflect

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

func (*Service) Reset

func (x *Service) Reset()

func (*Service) String

func (x *Service) String() string

func (*Service) Validate

func (m *Service) Validate() error

Validate checks the field values on Service with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type ServiceKind

type ServiceKind int32
const (
	ServiceKind_UNDEFINED_DO_NOT_USE ServiceKind = 0
	// databroker grpc service
	ServiceKind_DATABROKER ServiceKind = 1
	// authorize grpc service
	ServiceKind_AUTHORIZE ServiceKind = 2
	// authentication http(s) service
	ServiceKind_AUTHENTICATE ServiceKind = 3
	// proxy service
	ServiceKind_PROXY ServiceKind = 4
	// registry service
	ServiceKind_REGISTRY ServiceKind = 5
	// console grpc service
	ServiceKind_CONSOLE ServiceKind = 6
	// prometheus metrics compatible http endpoint
	ServiceKind_PROMETHEUS_METRICS ServiceKind = 7
)

func (ServiceKind) Descriptor

func (ServiceKind) Enum

func (x ServiceKind) Enum() *ServiceKind

func (ServiceKind) EnumDescriptor deprecated

func (ServiceKind) EnumDescriptor() ([]byte, []int)

Deprecated: Use ServiceKind.Descriptor instead.

func (ServiceKind) Number

func (x ServiceKind) Number() protoreflect.EnumNumber

func (ServiceKind) String

func (x ServiceKind) String() string

func (ServiceKind) Type

type ServiceList

type ServiceList struct {
	Services []*Service `protobuf:"bytes,1,rep,name=services,proto3" json:"services,omitempty"`
	// contains filtered or unexported fields
}

RegistrationSnapshot represents the current state of the services

func (*ServiceList) Descriptor deprecated

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

Deprecated: Use ServiceList.ProtoReflect.Descriptor instead.

func (*ServiceList) GetServices

func (x *ServiceList) GetServices() []*Service

func (*ServiceList) ProtoMessage

func (*ServiceList) ProtoMessage()

func (*ServiceList) ProtoReflect

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

func (*ServiceList) Reset

func (x *ServiceList) Reset()

func (*ServiceList) String

func (x *ServiceList) String() string

func (*ServiceList) Validate

func (m *ServiceList) Validate() error

Validate checks the field values on ServiceList with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type ServiceListValidationError

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

ServiceListValidationError is the validation error returned by ServiceList.Validate if the designated constraints aren't met.

func (ServiceListValidationError) Cause

Cause function returns cause value.

func (ServiceListValidationError) Error

Error satisfies the builtin error interface

func (ServiceListValidationError) ErrorName

func (e ServiceListValidationError) ErrorName() string

ErrorName returns error name.

func (ServiceListValidationError) Field

Field function returns field value.

func (ServiceListValidationError) Key

Key function returns key value.

func (ServiceListValidationError) Reason

Reason function returns reason value.

type ServiceRegistration

type ServiceRegistration struct {
	Service   *Service               `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
	ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"`
	// contains filtered or unexported fields
}

func (*ServiceRegistration) Descriptor deprecated

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

Deprecated: Use ServiceRegistration.ProtoReflect.Descriptor instead.

func (*ServiceRegistration) GetExpiresAt

func (x *ServiceRegistration) GetExpiresAt() *timestamppb.Timestamp

func (*ServiceRegistration) GetService

func (x *ServiceRegistration) GetService() *Service

func (*ServiceRegistration) ProtoMessage

func (*ServiceRegistration) ProtoMessage()

func (*ServiceRegistration) ProtoReflect

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

func (*ServiceRegistration) Reset

func (x *ServiceRegistration) Reset()

func (*ServiceRegistration) String

func (x *ServiceRegistration) String() string

func (*ServiceRegistration) Validate

func (m *ServiceRegistration) Validate() error

Validate checks the field values on ServiceRegistration with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type ServiceRegistrationValidationError

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

ServiceRegistrationValidationError is the validation error returned by ServiceRegistration.Validate if the designated constraints aren't met.

func (ServiceRegistrationValidationError) Cause

Cause function returns cause value.

func (ServiceRegistrationValidationError) Error

Error satisfies the builtin error interface

func (ServiceRegistrationValidationError) ErrorName

ErrorName returns error name.

func (ServiceRegistrationValidationError) Field

Field function returns field value.

func (ServiceRegistrationValidationError) Key

Key function returns key value.

func (ServiceRegistrationValidationError) Reason

Reason function returns reason value.

type ServiceValidationError

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

ServiceValidationError is the validation error returned by Service.Validate if the designated constraints aren't met.

func (ServiceValidationError) Cause

func (e ServiceValidationError) Cause() error

Cause function returns cause value.

func (ServiceValidationError) Error

func (e ServiceValidationError) Error() string

Error satisfies the builtin error interface

func (ServiceValidationError) ErrorName

func (e ServiceValidationError) ErrorName() string

ErrorName returns error name.

func (ServiceValidationError) Field

func (e ServiceValidationError) Field() string

Field function returns field value.

func (ServiceValidationError) Key

func (e ServiceValidationError) Key() bool

Key function returns key value.

func (ServiceValidationError) Reason

func (e ServiceValidationError) Reason() string

Reason function returns reason value.

type UnimplementedRegistryServer

type UnimplementedRegistryServer struct {
}

UnimplementedRegistryServer can be embedded to have forward compatible implementations.

func (*UnimplementedRegistryServer) List

func (*UnimplementedRegistryServer) Report

func (*UnimplementedRegistryServer) Watch

Jump to

Keyboard shortcuts

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