registry

package
v0.0.0-...-a4f6240 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_registry_proto protoreflect.FileDescriptor
View Source
var Registry_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "registry.Registry",
	HandlerType: (*RegistryServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Register",
			Handler:    _Registry_Register_Handler,
		},
		{
			MethodName: "Unregister",
			Handler:    _Registry_Unregister_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Subscribe",
			Handler:       _Registry_Subscribe_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "registry.proto",
}

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

Functions

func RegisterRegistryServer

func RegisterRegistryServer(s grpc.ServiceRegistrar, srv RegistryServer)

Types

type Empty

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

func (*Empty) Descriptor deprecated

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

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

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

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

type EndpointRequest

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

func (*EndpointRequest) Descriptor deprecated

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

Deprecated: Use EndpointRequest.ProtoReflect.Descriptor instead.

func (*EndpointRequest) GetName

func (x *EndpointRequest) GetName() string

func (*EndpointRequest) ProtoMessage

func (*EndpointRequest) ProtoMessage()

func (*EndpointRequest) ProtoReflect

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

func (*EndpointRequest) Reset

func (x *EndpointRequest) Reset()

func (*EndpointRequest) String

func (x *EndpointRequest) String() string

type EndpointResponse

type EndpointResponse struct {
	RegistrationInfo []*RegistrationInfo `protobuf:"bytes,1,rep,name=registration_info,json=registrationInfo,proto3" json:"registration_info,omitempty"`
	// contains filtered or unexported fields
}

func (*EndpointResponse) Descriptor deprecated

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

Deprecated: Use EndpointResponse.ProtoReflect.Descriptor instead.

func (*EndpointResponse) GetRegistrationInfo

func (x *EndpointResponse) GetRegistrationInfo() []*RegistrationInfo

func (*EndpointResponse) ProtoMessage

func (*EndpointResponse) ProtoMessage()

func (*EndpointResponse) ProtoReflect

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

func (*EndpointResponse) Reset

func (x *EndpointResponse) Reset()

func (*EndpointResponse) String

func (x *EndpointResponse) String() string

type HealthCheck

type HealthCheck struct {
	Endpoint         string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
	Interval         int32  `protobuf:"varint,2,opt,name=interval,proto3" json:"interval,omitempty"`
	HealthyThreshold int32  `protobuf:"varint,3,opt,name=healthy_threshold,json=healthyThreshold,proto3" json:"healthy_threshold,omitempty"`
	HealthyStatus    int32  `protobuf:"varint,4,opt,name=healthy_status,json=healthyStatus,proto3" json:"healthy_status,omitempty"`
	// contains filtered or unexported fields
}

func (*HealthCheck) Descriptor deprecated

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

Deprecated: Use HealthCheck.ProtoReflect.Descriptor instead.

func (*HealthCheck) GetEndpoint

func (x *HealthCheck) GetEndpoint() string

func (*HealthCheck) GetHealthyStatus

func (x *HealthCheck) GetHealthyStatus() int32

func (*HealthCheck) GetHealthyThreshold

func (x *HealthCheck) GetHealthyThreshold() int32

func (*HealthCheck) GetInterval

func (x *HealthCheck) GetInterval() int32

func (*HealthCheck) ProtoMessage

func (*HealthCheck) ProtoMessage()

func (*HealthCheck) ProtoReflect

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

func (*HealthCheck) Reset

func (x *HealthCheck) Reset()

func (*HealthCheck) String

func (x *HealthCheck) String() string

type RegistrationInfo

type RegistrationInfo struct {
	Id             string       `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name           string       `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Version        string       `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"`
	Url            string       `protobuf:"bytes,4,opt,name=url,proto3" json:"url,omitempty"`
	HealthCheck    *HealthCheck `protobuf:"bytes,5,opt,name=health_check,json=healthCheck,proto3" json:"health_check,omitempty"`
	DeploymentType string       `protobuf:"bytes,6,opt,name=deployment_type,json=deploymentType,proto3" json:"deployment_type,omitempty"`
	// contains filtered or unexported fields
}

func (*RegistrationInfo) Descriptor deprecated

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

Deprecated: Use RegistrationInfo.ProtoReflect.Descriptor instead.

func (*RegistrationInfo) GetDeploymentType

func (x *RegistrationInfo) GetDeploymentType() string

func (*RegistrationInfo) GetHealthCheck

func (x *RegistrationInfo) GetHealthCheck() *HealthCheck

func (*RegistrationInfo) GetId

func (x *RegistrationInfo) GetId() string

func (*RegistrationInfo) GetName

func (x *RegistrationInfo) GetName() string

func (*RegistrationInfo) GetUrl

func (x *RegistrationInfo) GetUrl() string

func (*RegistrationInfo) GetVersion

func (x *RegistrationInfo) GetVersion() string

func (*RegistrationInfo) ProtoMessage

func (*RegistrationInfo) ProtoMessage()

func (*RegistrationInfo) ProtoReflect

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

func (*RegistrationInfo) Reset

func (x *RegistrationInfo) Reset()

func (*RegistrationInfo) String

func (x *RegistrationInfo) String() string

type RegistrationResponse

type RegistrationResponse struct {
	Id    string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"`
	// contains filtered or unexported fields
}

func (*RegistrationResponse) Descriptor deprecated

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

Deprecated: Use RegistrationResponse.ProtoReflect.Descriptor instead.

func (*RegistrationResponse) GetId

func (x *RegistrationResponse) GetId() string

func (*RegistrationResponse) GetToken

func (x *RegistrationResponse) GetToken() string

func (*RegistrationResponse) ProtoMessage

func (*RegistrationResponse) ProtoMessage()

func (*RegistrationResponse) ProtoReflect

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

func (*RegistrationResponse) Reset

func (x *RegistrationResponse) Reset()

func (*RegistrationResponse) String

func (x *RegistrationResponse) String() string

type RegistryClient

type RegistryClient interface {
	Register(ctx context.Context, in *RegistrationInfo, opts ...grpc.CallOption) (*RegistrationResponse, error)
	Unregister(ctx context.Context, in *RegistrationResponse, opts ...grpc.CallOption) (*Empty, error)
	Subscribe(ctx context.Context, in *EndpointRequest, opts ...grpc.CallOption) (Registry_SubscribeClient, error)
}

RegistryClient is the client API for Registry 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.

func NewRegistryClient

func NewRegistryClient(cc grpc.ClientConnInterface) RegistryClient

type RegistryServer

type RegistryServer interface {
	Register(context.Context, *RegistrationInfo) (*RegistrationResponse, error)
	Unregister(context.Context, *RegistrationResponse) (*Empty, error)
	Subscribe(*EndpointRequest, Registry_SubscribeServer) error
	// contains filtered or unexported methods
}

RegistryServer is the server API for Registry service. All implementations must embed UnimplementedRegistryServer for forward compatibility

func NewRegistryServer

func NewRegistryServer(
	store core.KeyValueStore[string, *RegistrationInfo],
	index core.KeyValueStore[string, core.List[string]],
	registerChan chan<- *RegistrationInfo,
	unregisterChan chan<- *RegistrationInfo,
) RegistryServer

type Registry_SubscribeClient

type Registry_SubscribeClient interface {
	Recv() (*EndpointResponse, error)
	grpc.ClientStream
}

type Registry_SubscribeServer

type Registry_SubscribeServer interface {
	Send(*EndpointResponse) error
	grpc.ServerStream
}

type UnimplementedRegistryServer

type UnimplementedRegistryServer struct {
}

UnimplementedRegistryServer must be embedded to have forward compatible implementations.

func (UnimplementedRegistryServer) Register

func (UnimplementedRegistryServer) Subscribe

func (UnimplementedRegistryServer) Unregister

type UnsafeRegistryServer

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

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

Jump to

Keyboard shortcuts

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