grpc

package
v0.0.0-...-407825d Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: GPL-3.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Domain_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "grpc.Domain",
	HandlerType: (*DomainServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Heartbeat",
			Handler:    _Domain_Heartbeat_Handler,
		},
		{
			MethodName: "StartService",
			Handler:    _Domain_StartService_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "domain.proto",
}

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

View Source
var Dominion_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "grpc.Dominion",
	HandlerType: (*DominionServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetServices",
			Handler:    _Dominion_GetServices_Handler,
		},
		{
			MethodName: "GetDomains",
			Handler:    _Dominion_GetDomains_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "dominion.proto",
}

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

View Source
var File_domain_proto protoreflect.FileDescriptor
View Source
var File_dominion_proto protoreflect.FileDescriptor
View Source
var File_identity_proto protoreflect.FileDescriptor
View Source
var File_service_proto protoreflect.FileDescriptor
View Source
var Service_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "grpc.Service",
	HandlerType: (*ServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Heartbeat",
			Handler:    _Service_Heartbeat_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "service.proto",
}

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

Functions

func RegisterDomainServer

func RegisterDomainServer(s grpc.ServiceRegistrar, srv DomainServer)

func RegisterDominionServer

func RegisterDominionServer(s grpc.ServiceRegistrar, srv DominionServer)

func RegisterServiceServer

func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)

Types

type Address

type Address struct {

	// IP is the IP address which the domain was last known to communicate over
	IP []byte `protobuf:"bytes,5,opt,name=IP,proto3" json:"IP,omitempty"`
	// Port is the port which the domain was last known to belong communicate over
	Port int32 `protobuf:"varint,6,opt,name=Port,proto3" json:"Port,omitempty"`
	// contains filtered or unexported fields
}

func (*Address) Descriptor deprecated

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

Deprecated: Use Address.ProtoReflect.Descriptor instead.

func (*Address) GetIP

func (x *Address) GetIP() []byte

func (*Address) GetPort

func (x *Address) GetPort() int32

func (*Address) ProtoMessage

func (*Address) ProtoMessage()

func (*Address) ProtoReflect

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

func (*Address) Reset

func (x *Address) Reset()

func (*Address) String

func (x *Address) String() string

type DomainClient

type DomainClient interface {
	// Heartbeat verifies the status/identity of the domain
	Heartbeat(ctx context.Context, in *HeartbeatRequest, opts ...grpc.CallOption) (*HeartbeatReply, error)
	// StartService requests a domain start a service
	StartService(ctx context.Context, in *StartServiceRequest, opts ...grpc.CallOption) (*StartServiceReply, error)
}

DomainClient is the client API for Domain 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 NewDomainClient

func NewDomainClient(cc grpc.ClientConnInterface) DomainClient

type DomainRecord

type DomainRecord struct {

	// Identity contains identifying information
	Identity *Identity `protobuf:"bytes,1,opt,name=Identity,proto3" json:"Identity,omitempty"`
	// Services is the list of services a Domain currently offers
	Services []*ServiceIdentity `protobuf:"bytes,2,rep,name=Services,proto3" json:"Services,omitempty"`
	// contains filtered or unexported fields
}

DomainRecord is a snapshot of a currently opperating Domain

func (*DomainRecord) Descriptor deprecated

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

Deprecated: Use DomainRecord.ProtoReflect.Descriptor instead.

func (*DomainRecord) GetIdentity

func (x *DomainRecord) GetIdentity() *Identity

func (*DomainRecord) GetServices

func (x *DomainRecord) GetServices() []*ServiceIdentity

func (*DomainRecord) ProtoMessage

func (*DomainRecord) ProtoMessage()

func (*DomainRecord) ProtoReflect

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

func (*DomainRecord) Reset

func (x *DomainRecord) Reset()

func (*DomainRecord) String

func (x *DomainRecord) String() string

type DomainServer

type DomainServer interface {
	// Heartbeat verifies the status/identity of the domain
	Heartbeat(context.Context, *HeartbeatRequest) (*HeartbeatReply, error)
	// StartService requests a domain start a service
	StartService(context.Context, *StartServiceRequest) (*StartServiceReply, error)
	// contains filtered or unexported methods
}

DomainServer is the server API for Domain service. All implementations must embed UnimplementedDomainServer for forward compatibility

type DominionClient

type DominionClient interface {
	// GetServices returns the available services and their locations
	GetServices(ctx context.Context, in *GetServicesRequest, opts ...grpc.CallOption) (*GetServicesReply, error)
	// GetDomains returns all domains and their services
	GetDomains(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetDomainsReply, error)
}

DominionClient is the client API for Dominion 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 NewDominionClient

func NewDominionClient(cc grpc.ClientConnInterface) DominionClient

type DominionServer

type DominionServer interface {
	// GetServices returns the available services and their locations
	GetServices(context.Context, *GetServicesRequest) (*GetServicesReply, error)
	// GetDomains returns all domains and their services
	GetDomains(context.Context, *Empty) (*GetDomainsReply, error)
	// contains filtered or unexported methods
}

DominionServer is the server API for Dominion service. All implementations must embed UnimplementedDominionServer for forward compatibility

type Empty

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

Empty is empty, Duh.

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 GetDomainsReply

type GetDomainsReply struct {

	// DomainRecords is the list of all operating domains
	DomainRecords []*DomainRecord `protobuf:"bytes,1,rep,name=DomainRecords,proto3" json:"DomainRecords,omitempty"`
	// contains filtered or unexported fields
}

GetDomainsReply contains all domains and their services

func (*GetDomainsReply) Descriptor deprecated

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

Deprecated: Use GetDomainsReply.ProtoReflect.Descriptor instead.

func (*GetDomainsReply) GetDomainRecords

func (x *GetDomainsReply) GetDomainRecords() []*DomainRecord

func (*GetDomainsReply) ProtoMessage

func (*GetDomainsReply) ProtoMessage()

func (*GetDomainsReply) ProtoReflect

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

func (*GetDomainsReply) Reset

func (x *GetDomainsReply) Reset()

func (*GetDomainsReply) String

func (x *GetDomainsReply) String() string

type GetServicesReply

type GetServicesReply struct {

	// Services is the list of services of the requested type
	Services []*ServiceIdentity `protobuf:"bytes,1,rep,name=Services,proto3" json:"Services,omitempty"`
	// contains filtered or unexported fields
}

GetServicesReply contains the list of known addresses hosting the requested service

func (*GetServicesReply) Descriptor deprecated

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

Deprecated: Use GetServicesReply.ProtoReflect.Descriptor instead.

func (*GetServicesReply) GetServices

func (x *GetServicesReply) GetServices() []*ServiceIdentity

func (*GetServicesReply) ProtoMessage

func (*GetServicesReply) ProtoMessage()

func (*GetServicesReply) ProtoReflect

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

func (*GetServicesReply) Reset

func (x *GetServicesReply) Reset()

func (*GetServicesReply) String

func (x *GetServicesReply) String() string

type GetServicesRequest

type GetServicesRequest struct {

	// Name is the name of the service which is requested
	Type string `protobuf:"bytes,1,opt,name=Type,proto3" json:"Type,omitempty"`
	// contains filtered or unexported fields
}

GetServicesRequest contains the type of the service the client is searching for

func (*GetServicesRequest) Descriptor deprecated

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

Deprecated: Use GetServicesRequest.ProtoReflect.Descriptor instead.

func (*GetServicesRequest) GetType

func (x *GetServicesRequest) GetType() string

func (*GetServicesRequest) ProtoMessage

func (*GetServicesRequest) ProtoMessage()

func (*GetServicesRequest) ProtoReflect

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

func (*GetServicesRequest) Reset

func (x *GetServicesRequest) Reset()

func (*GetServicesRequest) String

func (x *GetServicesRequest) String() string

type HeartbeatReply

type HeartbeatReply struct {

	// Domain is the responding domainIdentity
	Domain *Identity `protobuf:"bytes,1,opt,name=Domain,proto3" json:"Domain,omitempty"`
	// Services is the list of services a Domain currently offers
	Services []*ServiceIdentity `protobuf:"bytes,2,rep,name=Services,proto3" json:"Services,omitempty"`
	// contains filtered or unexported fields
}

func (*HeartbeatReply) Descriptor deprecated

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

Deprecated: Use HeartbeatReply.ProtoReflect.Descriptor instead.

func (*HeartbeatReply) GetDomain

func (x *HeartbeatReply) GetDomain() *Identity

func (*HeartbeatReply) GetServices

func (x *HeartbeatReply) GetServices() []*ServiceIdentity

func (*HeartbeatReply) ProtoMessage

func (*HeartbeatReply) ProtoMessage()

func (*HeartbeatReply) ProtoReflect

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

func (*HeartbeatReply) Reset

func (x *HeartbeatReply) Reset()

func (*HeartbeatReply) String

func (x *HeartbeatReply) String() string

type HeartbeatRequest

type HeartbeatRequest struct {

	// Dominion is the requesting dominion
	Dominion *Identity `protobuf:"bytes,1,opt,name=Dominion,proto3" json:"Dominion,omitempty"`
	// contains filtered or unexported fields
}

HeartbeatRequest contains the identity of the dominion

func (*HeartbeatRequest) Descriptor deprecated

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

Deprecated: Use HeartbeatRequest.ProtoReflect.Descriptor instead.

func (*HeartbeatRequest) GetDominion

func (x *HeartbeatRequest) GetDominion() *Identity

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

type Identity

type Identity struct {

	// ID is a unique identifier
	ID []byte `protobuf:"bytes,1,opt,name=ID,proto3" json:"ID,omitempty"`
	// Version is the version of code being run
	Version string `protobuf:"bytes,2,opt,name=Version,proto3" json:"Version,omitempty"`
	// Address is the network address where the identity is reachable
	Address *Address `protobuf:"bytes,3,opt,name=Address,proto3" json:"Address,omitempty"`
	// contains filtered or unexported fields
}

Identity holds identifying information for a service, domain, or dominion

func (*Identity) Descriptor deprecated

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

Deprecated: Use Identity.ProtoReflect.Descriptor instead.

func (*Identity) GetAddress

func (x *Identity) GetAddress() *Address

func (*Identity) GetID

func (x *Identity) GetID() []byte

func (*Identity) GetVersion

func (x *Identity) GetVersion() string

func (*Identity) ProtoMessage

func (*Identity) ProtoMessage()

func (*Identity) ProtoReflect

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

func (*Identity) Reset

func (x *Identity) Reset()

func (*Identity) String

func (x *Identity) String() string

type ServiceClient

type ServiceClient interface {
	// Heartbeat verifies the status/identity of the domain
	Heartbeat(ctx context.Context, in *ServiceHeartbeatRequest, opts ...grpc.CallOption) (*ServiceHeartbeatReply, error)
}

ServiceClient is the client API for Service 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 NewServiceClient

func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient

type ServiceHeartbeatReply

type ServiceHeartbeatReply struct {

	// Service is the responding serviceIdentity
	Service *ServiceIdentity `protobuf:"bytes,1,opt,name=Service,proto3" json:"Service,omitempty"`
	// contains filtered or unexported fields
}

func (*ServiceHeartbeatReply) Descriptor deprecated

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

Deprecated: Use ServiceHeartbeatReply.ProtoReflect.Descriptor instead.

func (*ServiceHeartbeatReply) GetService

func (x *ServiceHeartbeatReply) GetService() *ServiceIdentity

func (*ServiceHeartbeatReply) ProtoMessage

func (*ServiceHeartbeatReply) ProtoMessage()

func (*ServiceHeartbeatReply) ProtoReflect

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

func (*ServiceHeartbeatReply) Reset

func (x *ServiceHeartbeatReply) Reset()

func (*ServiceHeartbeatReply) String

func (x *ServiceHeartbeatReply) String() string

type ServiceHeartbeatRequest

type ServiceHeartbeatRequest struct {

	// Domain is the requesting Domain
	Domain *Identity `protobuf:"bytes,1,opt,name=Domain,proto3" json:"Domain,omitempty"`
	// contains filtered or unexported fields
}

ServiceHeartbeatRequest contains the identity of the Domain

func (*ServiceHeartbeatRequest) Descriptor deprecated

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

Deprecated: Use ServiceHeartbeatRequest.ProtoReflect.Descriptor instead.

func (*ServiceHeartbeatRequest) GetDomain

func (x *ServiceHeartbeatRequest) GetDomain() *Identity

func (*ServiceHeartbeatRequest) ProtoMessage

func (*ServiceHeartbeatRequest) ProtoMessage()

func (*ServiceHeartbeatRequest) ProtoReflect

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

func (*ServiceHeartbeatRequest) Reset

func (x *ServiceHeartbeatRequest) Reset()

func (*ServiceHeartbeatRequest) String

func (x *ServiceHeartbeatRequest) String() string

type ServiceIdentity

type ServiceIdentity struct {

	// Identity is the identity of the service
	Identity *Identity `protobuf:"bytes,1,opt,name=Identity,proto3" json:"Identity,omitempty"`
	// Type is the type of the service
	Type string `protobuf:"bytes,2,opt,name=Type,proto3" json:"Type,omitempty"`
	// contains filtered or unexported fields
}

Service represents a service running under a domain

func (*ServiceIdentity) Descriptor deprecated

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

Deprecated: Use ServiceIdentity.ProtoReflect.Descriptor instead.

func (*ServiceIdentity) GetIdentity

func (x *ServiceIdentity) GetIdentity() *Identity

func (*ServiceIdentity) GetType

func (x *ServiceIdentity) GetType() string

func (*ServiceIdentity) ProtoMessage

func (*ServiceIdentity) ProtoMessage()

func (*ServiceIdentity) ProtoReflect

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

func (*ServiceIdentity) Reset

func (x *ServiceIdentity) Reset()

func (*ServiceIdentity) String

func (x *ServiceIdentity) String() string

type ServiceServer

type ServiceServer interface {
	// Heartbeat verifies the status/identity of the domain
	Heartbeat(context.Context, *ServiceHeartbeatRequest) (*ServiceHeartbeatReply, error)
	// contains filtered or unexported methods
}

ServiceServer is the server API for Service service. All implementations must embed UnimplementedServiceServer for forward compatibility

type StartServiceReply

type StartServiceReply struct {

	// Service is the newly started service
	Service *ServiceIdentity `protobuf:"bytes,1,opt,name=Service,proto3" json:"Service,omitempty"`
	// contains filtered or unexported fields
}

StartServiceRequest contains the type of service which needs started

func (*StartServiceReply) Descriptor deprecated

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

Deprecated: Use StartServiceReply.ProtoReflect.Descriptor instead.

func (*StartServiceReply) GetService

func (x *StartServiceReply) GetService() *ServiceIdentity

func (*StartServiceReply) ProtoMessage

func (*StartServiceReply) ProtoMessage()

func (*StartServiceReply) ProtoReflect

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

func (*StartServiceReply) Reset

func (x *StartServiceReply) Reset()

func (*StartServiceReply) String

func (x *StartServiceReply) String() string

type StartServiceRequest

type StartServiceRequest struct {

	// Type is the name of the service which is requested
	Type string `protobuf:"bytes,1,opt,name=Type,proto3" json:"Type,omitempty"`
	// DockerImage is the image to use for the service
	DockerImage string `protobuf:"bytes,2,opt,name=DockerImage,proto3" json:"DockerImage,omitempty"`
	// contains filtered or unexported fields
}

StartServiceRequest contains the type of service which needs started

func (*StartServiceRequest) Descriptor deprecated

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

Deprecated: Use StartServiceRequest.ProtoReflect.Descriptor instead.

func (*StartServiceRequest) GetDockerImage

func (x *StartServiceRequest) GetDockerImage() string

func (*StartServiceRequest) GetType

func (x *StartServiceRequest) GetType() string

func (*StartServiceRequest) ProtoMessage

func (*StartServiceRequest) ProtoMessage()

func (*StartServiceRequest) ProtoReflect

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

func (*StartServiceRequest) Reset

func (x *StartServiceRequest) Reset()

func (*StartServiceRequest) String

func (x *StartServiceRequest) String() string

type UnimplementedDomainServer

type UnimplementedDomainServer struct {
}

UnimplementedDomainServer must be embedded to have forward compatible implementations.

func (UnimplementedDomainServer) Heartbeat

func (UnimplementedDomainServer) StartService

type UnimplementedDominionServer

type UnimplementedDominionServer struct {
}

UnimplementedDominionServer must be embedded to have forward compatible implementations.

func (UnimplementedDominionServer) GetDomains

func (UnimplementedDominionServer) GetServices

type UnimplementedServiceServer

type UnimplementedServiceServer struct {
}

UnimplementedServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedServiceServer) Heartbeat

type UnsafeDomainServer

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

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

type UnsafeDominionServer

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

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

type UnsafeServiceServer

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

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

Jump to

Keyboard shortcuts

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