registry

package
v0.0.0-...-bc15ebc Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceRegistryService_RegisterService_FullMethodName = "/convers.registry.v1.ServiceRegistryService/RegisterService"
	ServiceRegistryService_DiscoverService_FullMethodName = "/convers.registry.v1.ServiceRegistryService/DiscoverService"
	ServiceRegistryService_Heartbeat_FullMethodName       = "/convers.registry.v1.ServiceRegistryService/Heartbeat"
)

Variables

View Source
var File_registry_proto protoreflect.FileDescriptor
View Source
var ServiceRegistryService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "convers.registry.v1.ServiceRegistryService",
	HandlerType: (*ServiceRegistryServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "RegisterService",
			Handler:    _ServiceRegistryService_RegisterService_Handler,
		},
		{
			MethodName: "DiscoverService",
			Handler:    _ServiceRegistryService_DiscoverService_Handler,
		},
		{
			MethodName: "Heartbeat",
			Handler:    _ServiceRegistryService_Heartbeat_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "registry.proto",
}

ServiceRegistryService_ServiceDesc is the grpc.ServiceDesc for ServiceRegistryService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterServiceRegistryServiceServer

func RegisterServiceRegistryServiceServer(s grpc.ServiceRegistrar, srv ServiceRegistryServiceServer)

Types

type DiscoverServiceRequest

type DiscoverServiceRequest struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Name of the service to discover
	// contains filtered or unexported fields
}

Request to find a service

func (*DiscoverServiceRequest) Descriptor deprecated

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

Deprecated: Use DiscoverServiceRequest.ProtoReflect.Descriptor instead.

func (*DiscoverServiceRequest) GetName

func (x *DiscoverServiceRequest) GetName() string

func (*DiscoverServiceRequest) ProtoMessage

func (*DiscoverServiceRequest) ProtoMessage()

func (*DiscoverServiceRequest) ProtoReflect

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

func (*DiscoverServiceRequest) Reset

func (x *DiscoverServiceRequest) Reset()

func (*DiscoverServiceRequest) String

func (x *DiscoverServiceRequest) String() string

func (*DiscoverServiceRequest) Validate

func (m *DiscoverServiceRequest) Validate() error

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

type DiscoverServiceRequestValidationError

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

DiscoverServiceRequestValidationError is the validation error returned by DiscoverServiceRequest.Validate if the designated constraints aren't met.

func (DiscoverServiceRequestValidationError) Cause

Cause function returns cause value.

func (DiscoverServiceRequestValidationError) Error

Error satisfies the builtin error interface

func (DiscoverServiceRequestValidationError) ErrorName

ErrorName returns error name.

func (DiscoverServiceRequestValidationError) Field

Field function returns field value.

func (DiscoverServiceRequestValidationError) Key

Key function returns key value.

func (DiscoverServiceRequestValidationError) Reason

Reason function returns reason value.

type DiscoverServiceResponse

type DiscoverServiceResponse struct {
	Services []*RegisterServiceRequest `protobuf:"bytes,1,rep,name=services,proto3" json:"services,omitempty"` // List of service instances
	// contains filtered or unexported fields
}

Response from the discovery process

func (*DiscoverServiceResponse) Descriptor deprecated

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

Deprecated: Use DiscoverServiceResponse.ProtoReflect.Descriptor instead.

func (*DiscoverServiceResponse) GetServices

func (x *DiscoverServiceResponse) GetServices() []*RegisterServiceRequest

func (*DiscoverServiceResponse) ProtoMessage

func (*DiscoverServiceResponse) ProtoMessage()

func (*DiscoverServiceResponse) ProtoReflect

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

func (*DiscoverServiceResponse) Reset

func (x *DiscoverServiceResponse) Reset()

func (*DiscoverServiceResponse) String

func (x *DiscoverServiceResponse) String() string

func (*DiscoverServiceResponse) Validate

func (m *DiscoverServiceResponse) Validate() error

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

type DiscoverServiceResponseValidationError

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

DiscoverServiceResponseValidationError is the validation error returned by DiscoverServiceResponse.Validate if the designated constraints aren't met.

func (DiscoverServiceResponseValidationError) Cause

Cause function returns cause value.

func (DiscoverServiceResponseValidationError) Error

Error satisfies the builtin error interface

func (DiscoverServiceResponseValidationError) ErrorName

ErrorName returns error name.

func (DiscoverServiceResponseValidationError) Field

Field function returns field value.

func (DiscoverServiceResponseValidationError) Key

Key function returns key value.

func (DiscoverServiceResponseValidationError) Reason

Reason function returns reason value.

type HeartbeatRequest

type HeartbeatRequest struct {
	Name    string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`       // Service name
	Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // IP address or hostname
	Port    int32  `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"`      // Service port
	// contains filtered or unexported fields
}

func (*HeartbeatRequest) Descriptor deprecated

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

Deprecated: Use HeartbeatRequest.ProtoReflect.Descriptor instead.

func (*HeartbeatRequest) GetAddress

func (x *HeartbeatRequest) GetAddress() string

func (*HeartbeatRequest) GetName

func (x *HeartbeatRequest) GetName() string

func (*HeartbeatRequest) GetPort

func (x *HeartbeatRequest) GetPort() int32

func (*HeartbeatRequest) ProtoMessage

func (*HeartbeatRequest) ProtoMessage()

func (*HeartbeatRequest) ProtoReflect

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

func (*HeartbeatRequest) Reset

func (x *HeartbeatRequest) Reset()

func (*HeartbeatRequest) String

func (x *HeartbeatRequest) String() string

func (*HeartbeatRequest) Validate

func (m *HeartbeatRequest) Validate() error

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

type HeartbeatRequestValidationError

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

HeartbeatRequestValidationError is the validation error returned by HeartbeatRequest.Validate if the designated constraints aren't met.

func (HeartbeatRequestValidationError) Cause

Cause function returns cause value.

func (HeartbeatRequestValidationError) Error

Error satisfies the builtin error interface

func (HeartbeatRequestValidationError) ErrorName

ErrorName returns error name.

func (HeartbeatRequestValidationError) Field

Field function returns field value.

func (HeartbeatRequestValidationError) Key

Key function returns key value.

func (HeartbeatRequestValidationError) Reason

Reason function returns reason value.

type HeartbeatResponse

type HeartbeatResponse struct {
	Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // Heartbeat status
	// contains filtered or unexported fields
}

Heartbeat response

func (*HeartbeatResponse) Descriptor deprecated

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

Deprecated: Use HeartbeatResponse.ProtoReflect.Descriptor instead.

func (*HeartbeatResponse) GetSuccess

func (x *HeartbeatResponse) GetSuccess() bool

func (*HeartbeatResponse) ProtoMessage

func (*HeartbeatResponse) ProtoMessage()

func (*HeartbeatResponse) ProtoReflect

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

func (*HeartbeatResponse) Reset

func (x *HeartbeatResponse) Reset()

func (*HeartbeatResponse) String

func (x *HeartbeatResponse) String() string

func (*HeartbeatResponse) Validate

func (m *HeartbeatResponse) Validate() error

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

type HeartbeatResponseValidationError

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

HeartbeatResponseValidationError is the validation error returned by HeartbeatResponse.Validate if the designated constraints aren't met.

func (HeartbeatResponseValidationError) Cause

Cause function returns cause value.

func (HeartbeatResponseValidationError) Error

Error satisfies the builtin error interface

func (HeartbeatResponseValidationError) ErrorName

ErrorName returns error name.

func (HeartbeatResponseValidationError) Field

Field function returns field value.

func (HeartbeatResponseValidationError) Key

Key function returns key value.

func (HeartbeatResponseValidationError) Reason

Reason function returns reason value.

type RegisterServiceRequest

type RegisterServiceRequest struct {
	Name    string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`       // Service name
	Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` // IP address or hostname
	Port    int32  `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"`      // Service port
	// contains filtered or unexported fields
}

Detailed service information

func (*RegisterServiceRequest) Descriptor deprecated

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

Deprecated: Use RegisterServiceRequest.ProtoReflect.Descriptor instead.

func (*RegisterServiceRequest) GetAddress

func (x *RegisterServiceRequest) GetAddress() string

func (*RegisterServiceRequest) GetName

func (x *RegisterServiceRequest) GetName() string

func (*RegisterServiceRequest) GetPort

func (x *RegisterServiceRequest) GetPort() int32

func (*RegisterServiceRequest) ProtoMessage

func (*RegisterServiceRequest) ProtoMessage()

func (*RegisterServiceRequest) ProtoReflect

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

func (*RegisterServiceRequest) Reset

func (x *RegisterServiceRequest) Reset()

func (*RegisterServiceRequest) String

func (x *RegisterServiceRequest) String() string

func (*RegisterServiceRequest) Validate

func (m *RegisterServiceRequest) Validate() error

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

type RegisterServiceRequestValidationError

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

RegisterServiceRequestValidationError is the validation error returned by RegisterServiceRequest.Validate if the designated constraints aren't met.

func (RegisterServiceRequestValidationError) Cause

Cause function returns cause value.

func (RegisterServiceRequestValidationError) Error

Error satisfies the builtin error interface

func (RegisterServiceRequestValidationError) ErrorName

ErrorName returns error name.

func (RegisterServiceRequestValidationError) Field

Field function returns field value.

func (RegisterServiceRequestValidationError) Key

Key function returns key value.

func (RegisterServiceRequestValidationError) Reason

Reason function returns reason value.

type RegisterServiceResponse

type RegisterServiceResponse struct {
	Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // Result message
	// contains filtered or unexported fields
}

Service registration response

func (*RegisterServiceResponse) Descriptor deprecated

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

Deprecated: Use RegisterServiceResponse.ProtoReflect.Descriptor instead.

func (*RegisterServiceResponse) GetMessage

func (x *RegisterServiceResponse) GetMessage() string

func (*RegisterServiceResponse) ProtoMessage

func (*RegisterServiceResponse) ProtoMessage()

func (*RegisterServiceResponse) ProtoReflect

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

func (*RegisterServiceResponse) Reset

func (x *RegisterServiceResponse) Reset()

func (*RegisterServiceResponse) String

func (x *RegisterServiceResponse) String() string

func (*RegisterServiceResponse) Validate

func (m *RegisterServiceResponse) Validate() error

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

type RegisterServiceResponseValidationError

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

RegisterServiceResponseValidationError is the validation error returned by RegisterServiceResponse.Validate if the designated constraints aren't met.

func (RegisterServiceResponseValidationError) Cause

Cause function returns cause value.

func (RegisterServiceResponseValidationError) Error

Error satisfies the builtin error interface

func (RegisterServiceResponseValidationError) ErrorName

ErrorName returns error name.

func (RegisterServiceResponseValidationError) Field

Field function returns field value.

func (RegisterServiceResponseValidationError) Key

Key function returns key value.

func (RegisterServiceResponseValidationError) Reason

Reason function returns reason value.

type ServiceRegistryServiceClient

type ServiceRegistryServiceClient interface {
	// Register a new service
	RegisterService(ctx context.Context, in *RegisterServiceRequest, opts ...grpc.CallOption) (*RegisterServiceResponse, error)
	// Discover a service by name
	DiscoverService(ctx context.Context, in *DiscoverServiceRequest, opts ...grpc.CallOption) (*DiscoverServiceResponse, error)
	// Health check to maintain service status
	Heartbeat(ctx context.Context, in *HeartbeatRequest, opts ...grpc.CallOption) (*HeartbeatResponse, error)
}

ServiceRegistryServiceClient is the client API for ServiceRegistryService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

Define the service registry

type ServiceRegistryServiceServer

type ServiceRegistryServiceServer interface {
	// Register a new service
	RegisterService(context.Context, *RegisterServiceRequest) (*RegisterServiceResponse, error)
	// Discover a service by name
	DiscoverService(context.Context, *DiscoverServiceRequest) (*DiscoverServiceResponse, error)
	// Health check to maintain service status
	Heartbeat(context.Context, *HeartbeatRequest) (*HeartbeatResponse, error)
	// contains filtered or unexported methods
}

ServiceRegistryServiceServer is the server API for ServiceRegistryService service. All implementations must embed UnimplementedServiceRegistryServiceServer for forward compatibility.

Define the service registry

type UnimplementedServiceRegistryServiceServer

type UnimplementedServiceRegistryServiceServer struct{}

UnimplementedServiceRegistryServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedServiceRegistryServiceServer) DiscoverService

func (UnimplementedServiceRegistryServiceServer) Heartbeat

func (UnimplementedServiceRegistryServiceServer) RegisterService

type UnsafeServiceRegistryServiceServer

type UnsafeServiceRegistryServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeServiceRegistryServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ServiceRegistryServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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