grpcdomain

package
v0.0.0-...-6db7017 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2020 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterDomainServer

func RegisterDomainServer(s *grpc.Server, srv DomainServer)

Types

type ClosePositionReply

type ClosePositionReply struct {
	// Accept is the servers acceptance of the position
	Accept               bool     `protobuf:"varint,1,opt,name=Accept,proto3" json:"Accept,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

ClosePositionReply contains the acceptance of the Server

func (*ClosePositionReply) Descriptor

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

func (*ClosePositionReply) GetAccept

func (m *ClosePositionReply) GetAccept() bool

func (*ClosePositionReply) ProtoMessage

func (*ClosePositionReply) ProtoMessage()

func (*ClosePositionReply) Reset

func (m *ClosePositionReply) Reset()

func (*ClosePositionReply) String

func (m *ClosePositionReply) String() string

func (*ClosePositionReply) XXX_DiscardUnknown

func (m *ClosePositionReply) XXX_DiscardUnknown()

func (*ClosePositionReply) XXX_Marshal

func (m *ClosePositionReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ClosePositionReply) XXX_Merge

func (m *ClosePositionReply) XXX_Merge(src proto.Message)

func (*ClosePositionReply) XXX_Size

func (m *ClosePositionReply) XXX_Size() int

func (*ClosePositionReply) XXX_Unmarshal

func (m *ClosePositionReply) XXX_Unmarshal(b []byte) error

type ClosePositionRequest

type ClosePositionRequest struct {
	// Identity is the identity of the client
	Identity *Identity `protobuf:"bytes,1,opt,name=Identity,proto3" json:"Identity,omitempty"`
	// Name is the name of the service which is open
	Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"`
	// Elected is the port which the service is availible at
	Elected              bool     `protobuf:"varint,3,opt,name=Elected,proto3" json:"Elected,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

ClosePositionRequest contains the name of the election which was being held,

func (*ClosePositionRequest) Descriptor

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

func (*ClosePositionRequest) GetElected

func (m *ClosePositionRequest) GetElected() bool

func (*ClosePositionRequest) GetIdentity

func (m *ClosePositionRequest) GetIdentity() *Identity

func (*ClosePositionRequest) GetName

func (m *ClosePositionRequest) GetName() string

func (*ClosePositionRequest) ProtoMessage

func (*ClosePositionRequest) ProtoMessage()

func (*ClosePositionRequest) Reset

func (m *ClosePositionRequest) Reset()

func (*ClosePositionRequest) String

func (m *ClosePositionRequest) String() string

func (*ClosePositionRequest) XXX_DiscardUnknown

func (m *ClosePositionRequest) XXX_DiscardUnknown()

func (*ClosePositionRequest) XXX_Marshal

func (m *ClosePositionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ClosePositionRequest) XXX_Merge

func (m *ClosePositionRequest) XXX_Merge(src proto.Message)

func (*ClosePositionRequest) XXX_Size

func (m *ClosePositionRequest) XXX_Size() int

func (*ClosePositionRequest) XXX_Unmarshal

func (m *ClosePositionRequest) XXX_Unmarshal(b []byte) error

type DomainClient

type DomainClient interface {
	// GetServices returns the availible services and their locations
	GetServices(ctx context.Context, in *GetServicesRequest, opts ...grpc.CallOption) (*GetServicesReply, error)
	// ShareIdentityList Exchanges the IdentityList which the domain is aware of
	ShareIdentityList(ctx context.Context, in *IdentityListRequest, opts ...grpc.CallOption) (*IdentityListReply, error)
	// DumpIdentityList Dumps the IdentityList which the domain is aware of
	DumpIdentityList(ctx context.Context, in *DumpIdentityListRequest, opts ...grpc.CallOption) (*IdentityListReply, error)
	// OpenPosition declares the new service which is needed and requests Appointments
	OpenPosition(ctx context.Context, in *OpenPositionRequest, opts ...grpc.CallOption) (*OpenPositionReply, error)
	// ClosePosition ends an election and informs if the position was awarded
	ClosePosition(ctx context.Context, in *ClosePositionRequest, opts ...grpc.CallOption) (*ClosePositionReply, error)
}

DomainClient is the client API for Domain service.

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

func NewDomainClient

func NewDomainClient(cc *grpc.ClientConn) DomainClient

type DomainServer

type DomainServer interface {
	// GetServices returns the availible services and their locations
	GetServices(context.Context, *GetServicesRequest) (*GetServicesReply, error)
	// ShareIdentityList Exchanges the IdentityList which the domain is aware of
	ShareIdentityList(context.Context, *IdentityListRequest) (*IdentityListReply, error)
	// DumpIdentityList Dumps the IdentityList which the domain is aware of
	DumpIdentityList(context.Context, *DumpIdentityListRequest) (*IdentityListReply, error)
	// OpenPosition declares the new service which is needed and requests Appointments
	OpenPosition(context.Context, *OpenPositionRequest) (*OpenPositionReply, error)
	// ClosePosition ends an election and informs if the position was awarded
	ClosePosition(context.Context, *ClosePositionRequest) (*ClosePositionReply, error)
}

DomainServer is the server API for Domain service.

type DumpIdentityListRequest

type DumpIdentityListRequest struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

DumpIdentityListRequest contains nothing

func (*DumpIdentityListRequest) Descriptor

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

func (*DumpIdentityListRequest) ProtoMessage

func (*DumpIdentityListRequest) ProtoMessage()

func (*DumpIdentityListRequest) Reset

func (m *DumpIdentityListRequest) Reset()

func (*DumpIdentityListRequest) String

func (m *DumpIdentityListRequest) String() string

func (*DumpIdentityListRequest) XXX_DiscardUnknown

func (m *DumpIdentityListRequest) XXX_DiscardUnknown()

func (*DumpIdentityListRequest) XXX_Marshal

func (m *DumpIdentityListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DumpIdentityListRequest) XXX_Merge

func (m *DumpIdentityListRequest) XXX_Merge(src proto.Message)

func (*DumpIdentityListRequest) XXX_Size

func (m *DumpIdentityListRequest) XXX_Size() int

func (*DumpIdentityListRequest) XXX_Unmarshal

func (m *DumpIdentityListRequest) XXX_Unmarshal(b []byte) error

type GetServicesReply

type GetServicesReply struct {
	// Addresses is the list of addresses of the requested service
	Addresses            []string `protobuf:"bytes,1,rep,name=Addresses,proto3" json:"Addresses,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

GetServicesReply contains the list of known addresses hosting the requested service

func (*GetServicesReply) Descriptor

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

func (*GetServicesReply) GetAddresses

func (m *GetServicesReply) GetAddresses() []string

func (*GetServicesReply) ProtoMessage

func (*GetServicesReply) ProtoMessage()

func (*GetServicesReply) Reset

func (m *GetServicesReply) Reset()

func (*GetServicesReply) String

func (m *GetServicesReply) String() string

func (*GetServicesReply) XXX_DiscardUnknown

func (m *GetServicesReply) XXX_DiscardUnknown()

func (*GetServicesReply) XXX_Marshal

func (m *GetServicesReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetServicesReply) XXX_Merge

func (m *GetServicesReply) XXX_Merge(src proto.Message)

func (*GetServicesReply) XXX_Size

func (m *GetServicesReply) XXX_Size() int

func (*GetServicesReply) XXX_Unmarshal

func (m *GetServicesReply) XXX_Unmarshal(b []byte) error

type GetServicesRequest

type GetServicesRequest struct {
	// Name is the name of the service which is requested
	Name                 string   `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

func (*GetServicesRequest) Descriptor

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

func (*GetServicesRequest) GetName

func (m *GetServicesRequest) GetName() string

func (*GetServicesRequest) ProtoMessage

func (*GetServicesRequest) ProtoMessage()

func (*GetServicesRequest) Reset

func (m *GetServicesRequest) Reset()

func (*GetServicesRequest) String

func (m *GetServicesRequest) String() string

func (*GetServicesRequest) XXX_DiscardUnknown

func (m *GetServicesRequest) XXX_DiscardUnknown()

func (*GetServicesRequest) XXX_Marshal

func (m *GetServicesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetServicesRequest) XXX_Merge

func (m *GetServicesRequest) XXX_Merge(src proto.Message)

func (*GetServicesRequest) XXX_Size

func (m *GetServicesRequest) XXX_Size() int

func (*GetServicesRequest) XXX_Unmarshal

func (m *GetServicesRequest) XXX_Unmarshal(b []byte) error

type Identity

type Identity struct {
	// UUID is a Unique Identifier for the domain
	UUID string `protobuf:"bytes,1,opt,name=UUID,proto3" json:"UUID,omitempty"`
	// Version is the version of code being run by the domain
	Version string `protobuf:"bytes,2,opt,name=Version,proto3" json:"Version,omitempty"`
	// Services is the list of services an Identity currently offers
	Services []*ServiceIdentity `protobuf:"bytes,3,rep,name=Services,proto3" json:"Services,omitempty"`
	// LastContact is the time of the last heard communication (UnixNano)
	LastContact int64 `protobuf:"varint,4,opt,name=LastContact,proto3" json:"LastContact,omitempty"`
	// 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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Identity represents a domain

func (*Identity) Descriptor

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

func (*Identity) GetIP

func (m *Identity) GetIP() []byte

func (*Identity) GetLastContact

func (m *Identity) GetLastContact() int64

func (*Identity) GetPort

func (m *Identity) GetPort() int32

func (*Identity) GetServices

func (m *Identity) GetServices() []*ServiceIdentity

func (*Identity) GetUUID

func (m *Identity) GetUUID() string

func (*Identity) GetVersion

func (m *Identity) GetVersion() string

func (*Identity) ProtoMessage

func (*Identity) ProtoMessage()

func (*Identity) Reset

func (m *Identity) Reset()

func (*Identity) String

func (m *Identity) String() string

func (*Identity) XXX_DiscardUnknown

func (m *Identity) XXX_DiscardUnknown()

func (*Identity) XXX_Marshal

func (m *Identity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Identity) XXX_Merge

func (m *Identity) XXX_Merge(src proto.Message)

func (*Identity) XXX_Size

func (m *Identity) XXX_Size() int

func (*Identity) XXX_Unmarshal

func (m *Identity) XXX_Unmarshal(b []byte) error

type IdentityListReply

type IdentityListReply struct {
	// Identity is the identity of the server
	Identity *Identity `protobuf:"bytes,1,opt,name=Identity,proto3" json:"Identity,omitempty"`
	// IdentityList is a list of all domains known to the server
	IdentityList         []*Identity `protobuf:"bytes,2,rep,name=IdentityList,proto3" json:"IdentityList,omitempty"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

IdentityListReply contains the server's & peers' identities

func (*IdentityListReply) Descriptor

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

func (*IdentityListReply) GetIdentity

func (m *IdentityListReply) GetIdentity() *Identity

func (*IdentityListReply) GetIdentityList

func (m *IdentityListReply) GetIdentityList() []*Identity

func (*IdentityListReply) ProtoMessage

func (*IdentityListReply) ProtoMessage()

func (*IdentityListReply) Reset

func (m *IdentityListReply) Reset()

func (*IdentityListReply) String

func (m *IdentityListReply) String() string

func (*IdentityListReply) XXX_DiscardUnknown

func (m *IdentityListReply) XXX_DiscardUnknown()

func (*IdentityListReply) XXX_Marshal

func (m *IdentityListReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*IdentityListReply) XXX_Merge

func (m *IdentityListReply) XXX_Merge(src proto.Message)

func (*IdentityListReply) XXX_Size

func (m *IdentityListReply) XXX_Size() int

func (*IdentityListReply) XXX_Unmarshal

func (m *IdentityListReply) XXX_Unmarshal(b []byte) error

type IdentityListRequest

type IdentityListRequest struct {
	// Identity is the identity of the client
	Identity *Identity `protobuf:"bytes,1,opt,name=Identity,proto3" json:"Identity,omitempty"`
	// IdentityList is a list of all domains known to the client
	IdentityList         []*Identity `protobuf:"bytes,2,rep,name=IdentityList,proto3" json:"IdentityList,omitempty"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

IdentityListRequest contains the client's & peers' identities

func (*IdentityListRequest) Descriptor

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

func (*IdentityListRequest) GetIdentity

func (m *IdentityListRequest) GetIdentity() *Identity

func (*IdentityListRequest) GetIdentityList

func (m *IdentityListRequest) GetIdentityList() []*Identity

func (*IdentityListRequest) ProtoMessage

func (*IdentityListRequest) ProtoMessage()

func (*IdentityListRequest) Reset

func (m *IdentityListRequest) Reset()

func (*IdentityListRequest) String

func (m *IdentityListRequest) String() string

func (*IdentityListRequest) XXX_DiscardUnknown

func (m *IdentityListRequest) XXX_DiscardUnknown()

func (*IdentityListRequest) XXX_Marshal

func (m *IdentityListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*IdentityListRequest) XXX_Merge

func (m *IdentityListRequest) XXX_Merge(src proto.Message)

func (*IdentityListRequest) XXX_Size

func (m *IdentityListRequest) XXX_Size() int

func (*IdentityListRequest) XXX_Unmarshal

func (m *IdentityListRequest) XXX_Unmarshal(b []byte) error

type OpenPositionReply

type OpenPositionReply struct {
	// Accept is whether or not the domain is willing to take the position
	Accept bool `protobuf:"varint,1,opt,name=Accept,proto3" json:"Accept,omitempty"`
	// Proficiency is the measure of the servers effectiveness of performing the task
	Proficiency          int32    `protobuf:"varint,2,opt,name=Proficiency,proto3" json:"Proficiency,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

OpenPositionReply contains the consent and proficiency of the servir

func (*OpenPositionReply) Descriptor

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

func (*OpenPositionReply) GetAccept

func (m *OpenPositionReply) GetAccept() bool

func (*OpenPositionReply) GetProficiency

func (m *OpenPositionReply) GetProficiency() int32

func (*OpenPositionReply) ProtoMessage

func (*OpenPositionReply) ProtoMessage()

func (*OpenPositionReply) Reset

func (m *OpenPositionReply) Reset()

func (*OpenPositionReply) String

func (m *OpenPositionReply) String() string

func (*OpenPositionReply) XXX_DiscardUnknown

func (m *OpenPositionReply) XXX_DiscardUnknown()

func (*OpenPositionReply) XXX_Marshal

func (m *OpenPositionReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*OpenPositionReply) XXX_Merge

func (m *OpenPositionReply) XXX_Merge(src proto.Message)

func (*OpenPositionReply) XXX_Size

func (m *OpenPositionReply) XXX_Size() int

func (*OpenPositionReply) XXX_Unmarshal

func (m *OpenPositionReply) XXX_Unmarshal(b []byte) error

type OpenPositionRequest

type OpenPositionRequest struct {
	// Identity is the identity of the client
	Identity *Identity `protobuf:"bytes,1,opt,name=Identity,proto3" json:"Identity,omitempty"`
	// Name is the name of the service which is open
	Name                 string   `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

OpenPositionRequest contains the name of the new open position

func (*OpenPositionRequest) Descriptor

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

func (*OpenPositionRequest) GetIdentity

func (m *OpenPositionRequest) GetIdentity() *Identity

func (*OpenPositionRequest) GetName

func (m *OpenPositionRequest) GetName() string

func (*OpenPositionRequest) ProtoMessage

func (*OpenPositionRequest) ProtoMessage()

func (*OpenPositionRequest) Reset

func (m *OpenPositionRequest) Reset()

func (*OpenPositionRequest) String

func (m *OpenPositionRequest) String() string

func (*OpenPositionRequest) XXX_DiscardUnknown

func (m *OpenPositionRequest) XXX_DiscardUnknown()

func (*OpenPositionRequest) XXX_Marshal

func (m *OpenPositionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*OpenPositionRequest) XXX_Merge

func (m *OpenPositionRequest) XXX_Merge(src proto.Message)

func (*OpenPositionRequest) XXX_Size

func (m *OpenPositionRequest) XXX_Size() int

func (*OpenPositionRequest) XXX_Unmarshal

func (m *OpenPositionRequest) XXX_Unmarshal(b []byte) error

type ServiceIdentity

type ServiceIdentity struct {
	// Name is the name of the service
	Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"`
	// Port is the port which the service is availible at
	Port int32 `protobuf:"varint,2,opt,name=Port,proto3" json:"Port,omitempty"`
	// LastContact is the time of the last heard communication (UnixNano)
	LastContact          int64    `protobuf:"varint,3,opt,name=LastContact,proto3" json:"LastContact,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Service represents a service running under a domain

func (*ServiceIdentity) Descriptor

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

func (*ServiceIdentity) GetLastContact

func (m *ServiceIdentity) GetLastContact() int64

func (*ServiceIdentity) GetName

func (m *ServiceIdentity) GetName() string

func (*ServiceIdentity) GetPort

func (m *ServiceIdentity) GetPort() int32

func (*ServiceIdentity) ProtoMessage

func (*ServiceIdentity) ProtoMessage()

func (*ServiceIdentity) Reset

func (m *ServiceIdentity) Reset()

func (*ServiceIdentity) String

func (m *ServiceIdentity) String() string

func (*ServiceIdentity) XXX_DiscardUnknown

func (m *ServiceIdentity) XXX_DiscardUnknown()

func (*ServiceIdentity) XXX_Marshal

func (m *ServiceIdentity) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ServiceIdentity) XXX_Merge

func (m *ServiceIdentity) XXX_Merge(src proto.Message)

func (*ServiceIdentity) XXX_Size

func (m *ServiceIdentity) XXX_Size() int

func (*ServiceIdentity) XXX_Unmarshal

func (m *ServiceIdentity) XXX_Unmarshal(b []byte) error

type UnimplementedDomainServer

type UnimplementedDomainServer struct {
}

UnimplementedDomainServer can be embedded to have forward compatible implementations.

func (*UnimplementedDomainServer) ClosePosition

func (*UnimplementedDomainServer) DumpIdentityList

func (*UnimplementedDomainServer) GetServices

func (*UnimplementedDomainServer) OpenPosition

func (*UnimplementedDomainServer) ShareIdentityList

Jump to

Keyboard shortcuts

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