registry

package
v0.0.0-...-c438d58 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_registry_proto protoreflect.FileDescriptor

Functions

func RegisterServiceRegistryServer

func RegisterServiceRegistryServer(s *grpc.Server, srv ServiceRegistryServer)

Types

type NamedPort

type NamedPort struct {

	// The actual numerical listening port
	Port int32 `protobuf:"varint,1,opt,name=port,proto3" json:"port,omitempty"`
	// The name of the port, e.g. "https"
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*NamedPort) Descriptor deprecated

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

Deprecated: Use NamedPort.ProtoReflect.Descriptor instead.

func (*NamedPort) GetName

func (x *NamedPort) GetName() string

func (*NamedPort) GetPort

func (x *NamedPort) GetPort() int32

func (*NamedPort) ProtoMessage

func (*NamedPort) ProtoMessage()

func (*NamedPort) ProtoReflect

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

func (*NamedPort) Reset

func (x *NamedPort) Reset()

func (*NamedPort) String

func (x *NamedPort) String() string

type RegistrationResult

type RegistrationResult struct {

	// namespace the service is registered in
	Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
	// name of the service
	ServiceName string `protobuf:"bytes,2,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"`
	// IP address of that specific host name
	Ipaddress string `protobuf:"bytes,3,opt,name=ipaddress,proto3" json:"ipaddress,omitempty"`
	// Array of named ports for the service
	Ports []*NamedPort `protobuf:"bytes,4,rep,name=ports,proto3" json:"ports,omitempty"`
	// Status code of the operation
	// We will reuse the HTTP status code, e.g. a 201 will signal that the entry
	// has been successfully created.
	Status uint32 `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"`
	// Details message explaining the status
	StatusDetails string `protobuf:"bytes,6,opt,name=status_details,json=statusDetails,proto3" json:"status_details,omitempty"`
	// contains filtered or unexported fields
}

The response message containing the result of the registration In case of a successful registration, the input will be in the response. If the registration failed, all values except for the status code and a reason will be empty.

func (*RegistrationResult) Descriptor deprecated

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

Deprecated: Use RegistrationResult.ProtoReflect.Descriptor instead.

func (*RegistrationResult) GetIpaddress

func (x *RegistrationResult) GetIpaddress() string

func (*RegistrationResult) GetNamespace

func (x *RegistrationResult) GetNamespace() string

func (*RegistrationResult) GetPorts

func (x *RegistrationResult) GetPorts() []*NamedPort

func (*RegistrationResult) GetServiceName

func (x *RegistrationResult) GetServiceName() string

func (*RegistrationResult) GetStatus

func (x *RegistrationResult) GetStatus() uint32

func (*RegistrationResult) GetStatusDetails

func (x *RegistrationResult) GetStatusDetails() string

func (*RegistrationResult) ProtoMessage

func (*RegistrationResult) ProtoMessage()

func (*RegistrationResult) ProtoReflect

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

func (*RegistrationResult) Reset

func (x *RegistrationResult) Reset()

func (*RegistrationResult) String

func (x *RegistrationResult) String() string

type ServiceInfo

type ServiceInfo struct {

	// namespace the service is registered in
	Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
	// name of the service - this determines which namespace this service uses
	ServiceName string `protobuf:"bytes,2,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"`
	// DNS name of the service host not including subdomain or domain and no dots
	HostName string `protobuf:"bytes,3,opt,name=host_name,json=hostName,proto3" json:"host_name,omitempty"`
	// IP address of that specific host name
	Ipaddress string `protobuf:"bytes,4,opt,name=ipaddress,proto3" json:"ipaddress,omitempty"`
	// Physical node name where the service instance is running.
	// For bare metal or VM services, this may the the FQN of the service including the host_name
	NodeName string `protobuf:"bytes,5,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"`
	// Array of named ports for the service
	Ports []*NamedPort `protobuf:"bytes,6,rep,name=ports,proto3" json:"ports,omitempty"`
	// A weight this service instance should be given
	// NOTE: this information may not be utilized by the consumer of this information
	Weight float32 `protobuf:"fixed32,7,opt,name=weight,proto3" json:"weight,omitempty"`
	// contains filtered or unexported fields
}

The request message with the service info.

func (*ServiceInfo) Descriptor deprecated

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

Deprecated: Use ServiceInfo.ProtoReflect.Descriptor instead.

func (*ServiceInfo) GetHostName

func (x *ServiceInfo) GetHostName() string

func (*ServiceInfo) GetIpaddress

func (x *ServiceInfo) GetIpaddress() string

func (*ServiceInfo) GetNamespace

func (x *ServiceInfo) GetNamespace() string

func (*ServiceInfo) GetNodeName

func (x *ServiceInfo) GetNodeName() string

func (*ServiceInfo) GetPorts

func (x *ServiceInfo) GetPorts() []*NamedPort

func (*ServiceInfo) GetServiceName

func (x *ServiceInfo) GetServiceName() string

func (*ServiceInfo) GetWeight

func (x *ServiceInfo) GetWeight() float32

func (*ServiceInfo) ProtoMessage

func (*ServiceInfo) ProtoMessage()

func (*ServiceInfo) ProtoReflect

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

func (*ServiceInfo) Reset

func (x *ServiceInfo) Reset()

func (*ServiceInfo) String

func (x *ServiceInfo) String() string

type ServiceRegistryClient

type ServiceRegistryClient interface {
	// Registers a service
	Register(ctx context.Context, in *ServiceInfo, opts ...grpc.CallOption) (*RegistrationResult, error)
	// unregisters a service
	UnRegister(ctx context.Context, in *ServiceInfo, opts ...grpc.CallOption) (*RegistrationResult, error)
}

ServiceRegistryClient is the client API for ServiceRegistry service.

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

type ServiceRegistryServer

type ServiceRegistryServer interface {
	// Registers a service
	Register(context.Context, *ServiceInfo) (*RegistrationResult, error)
	// unregisters a service
	UnRegister(context.Context, *ServiceInfo) (*RegistrationResult, error)
}

ServiceRegistryServer is the server API for ServiceRegistry service.

type UnimplementedServiceRegistryServer

type UnimplementedServiceRegistryServer struct {
}

UnimplementedServiceRegistryServer can be embedded to have forward compatible implementations.

func (*UnimplementedServiceRegistryServer) Register

func (*UnimplementedServiceRegistryServer) UnRegister

Jump to

Keyboard shortcuts

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