serviceregistry

package
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EventType_name = map[int32]string{
	0: "Register",
	1: "Remove",
}
View Source
var EventType_value = map[string]int32{
	"Register": 0,
	"Remove":   1,
}

Functions

func RegisterRegistryServer

func RegisterRegistryServer(s *grpc.Server, srv RegistryServer)

Types

type Empty

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

func (*Empty) Descriptor

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

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) String

func (m *Empty) String() string

func (*Empty) XXX_DiscardUnknown

func (m *Empty) XXX_DiscardUnknown()

func (*Empty) XXX_Marshal

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

func (*Empty) XXX_Merge

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

func (*Empty) XXX_Size

func (m *Empty) XXX_Size() int

func (*Empty) XXX_Unmarshal

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

type EventType

type EventType int32
const (
	EventType_Register EventType = 0
	EventType_Remove   EventType = 1
)

func (EventType) EnumDescriptor

func (EventType) EnumDescriptor() ([]byte, []int)

func (EventType) String

func (x EventType) String() string

type RegistryClient

type RegistryClient interface {
	RegisterWorkload(ctx context.Context, in *ServiceWorkload, opts ...grpc.CallOption) (*Empty, error)
	GetServices(ctx context.Context, in *Empty, opts ...grpc.CallOption) (Registry_GetServicesClient, error)
	RemoveWorkload(ctx context.Context, in *ServiceWorkload, opts ...grpc.CallOption) (*Empty, error)
}

RegistryClient is the client API for Registry service.

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

func NewRegistryClient

func NewRegistryClient(cc *grpc.ClientConn) RegistryClient

type RegistryServer

type RegistryServer interface {
	RegisterWorkload(context.Context, *ServiceWorkload) (*Empty, error)
	GetServices(*Empty, Registry_GetServicesServer) error
	RemoveWorkload(context.Context, *ServiceWorkload) (*Empty, error)
}

RegistryServer is the server API for Registry service.

type Registry_GetServicesClient

type Registry_GetServicesClient interface {
	Recv() (*WorkloadEvent, error)
	grpc.ClientStream
}

type Registry_GetServicesServer

type Registry_GetServicesServer interface {
	Send(*WorkloadEvent) error
	grpc.ServerStream
}

type ServiceWorkload

type ServiceWorkload struct {
	ServiceName          string      `protobuf:"bytes,1,opt,name=serviceName,proto3" json:"serviceName,omitempty"`
	ConnectivityDomain   string      `protobuf:"bytes,2,opt,name=connectivityDomain,proto3" json:"connectivityDomain,omitempty"`
	Workloads            []*Workload `protobuf:"bytes,3,rep,name=workloads,proto3" json:"workloads,omitempty"`
	Ports                []int32     `protobuf:"varint,4,rep,packed,name=ports,proto3" json:"ports,omitempty"`
	XXX_NoUnkeyedLiteral struct{}    `json:"-"`
	XXX_unrecognized     []byte      `json:"-"`
	XXX_sizecache        int32       `json:"-"`
}

The request used to register a new service or update the existing ones

func (*ServiceWorkload) Descriptor

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

func (*ServiceWorkload) GetConnectivityDomain

func (m *ServiceWorkload) GetConnectivityDomain() string

func (*ServiceWorkload) GetPorts

func (m *ServiceWorkload) GetPorts() []int32

func (*ServiceWorkload) GetServiceName

func (m *ServiceWorkload) GetServiceName() string

func (*ServiceWorkload) GetWorkloads

func (m *ServiceWorkload) GetWorkloads() []*Workload

func (*ServiceWorkload) ProtoMessage

func (*ServiceWorkload) ProtoMessage()

func (*ServiceWorkload) Reset

func (m *ServiceWorkload) Reset()

func (*ServiceWorkload) String

func (m *ServiceWorkload) String() string

func (*ServiceWorkload) Validate

func (x *ServiceWorkload) Validate() error

func (*ServiceWorkload) XXX_DiscardUnknown

func (m *ServiceWorkload) XXX_DiscardUnknown()

func (*ServiceWorkload) XXX_Marshal

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

func (*ServiceWorkload) XXX_Merge

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

func (*ServiceWorkload) XXX_Size

func (m *ServiceWorkload) XXX_Size() int

func (*ServiceWorkload) XXX_Unmarshal

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

type UnimplementedRegistryServer

type UnimplementedRegistryServer struct {
}

UnimplementedRegistryServer can be embedded to have forward compatible implementations.

func (*UnimplementedRegistryServer) GetServices

func (*UnimplementedRegistryServer) RegisterWorkload

func (*UnimplementedRegistryServer) RegisterWorkload(ctx context.Context, req *ServiceWorkload) (*Empty, error)

func (*UnimplementedRegistryServer) RemoveWorkload

func (*UnimplementedRegistryServer) RemoveWorkload(ctx context.Context, req *ServiceWorkload) (*Empty, error)

type Workload

type Workload struct {
	Identifier           *WorkloadIdentifier `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"`
	IPAddress            []string            `protobuf:"bytes,2,rep,name=IPAddress,json=iPAddress,proto3" json:"IPAddress,omitempty"`
	XXX_NoUnkeyedLiteral struct{}            `json:"-"`
	XXX_unrecognized     []byte              `json:"-"`
	XXX_sizecache        int32               `json:"-"`
}

Basic workload

func (*Workload) Descriptor

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

func (*Workload) GetIPAddress

func (m *Workload) GetIPAddress() []string

func (*Workload) GetIdentifier

func (m *Workload) GetIdentifier() *WorkloadIdentifier

func (*Workload) ProtoMessage

func (*Workload) ProtoMessage()

func (*Workload) Reset

func (m *Workload) Reset()

func (*Workload) String

func (m *Workload) String() string

func (*Workload) Validate

func (m *Workload) Validate() error

func (*Workload) XXX_DiscardUnknown

func (m *Workload) XXX_DiscardUnknown()

func (*Workload) XXX_Marshal

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

func (*Workload) XXX_Merge

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

func (*Workload) XXX_Size

func (m *Workload) XXX_Size() int

func (*Workload) XXX_Unmarshal

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

type WorkloadEvent

type WorkloadEvent struct {
	EventType            EventType        `protobuf:"varint,1,opt,name=eventType,proto3,enum=svreg.EventType" json:"eventType,omitempty"`
	ServiceWorkload      *ServiceWorkload `protobuf:"bytes,2,opt,name=serviceWorkload,proto3" json:"serviceWorkload,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

func (*WorkloadEvent) Descriptor

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

func (*WorkloadEvent) GetEventType

func (m *WorkloadEvent) GetEventType() EventType

func (*WorkloadEvent) GetServiceWorkload

func (m *WorkloadEvent) GetServiceWorkload() *ServiceWorkload

func (*WorkloadEvent) ProtoMessage

func (*WorkloadEvent) ProtoMessage()

func (*WorkloadEvent) Reset

func (m *WorkloadEvent) Reset()

func (*WorkloadEvent) String

func (m *WorkloadEvent) String() string

func (*WorkloadEvent) XXX_DiscardUnknown

func (m *WorkloadEvent) XXX_DiscardUnknown()

func (*WorkloadEvent) XXX_Marshal

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

func (*WorkloadEvent) XXX_Merge

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

func (*WorkloadEvent) XXX_Size

func (m *WorkloadEvent) XXX_Size() int

func (*WorkloadEvent) XXX_Unmarshal

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

type WorkloadIdentifier

type WorkloadIdentifier struct {
	Cluster              string   `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"`
	PodName              string   `protobuf:"bytes,2,opt,name=podName,proto3" json:"podName,omitempty"`
	Name                 string   `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*WorkloadIdentifier) Descriptor

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

func (*WorkloadIdentifier) GetCluster

func (m *WorkloadIdentifier) GetCluster() string

func (*WorkloadIdentifier) GetName

func (m *WorkloadIdentifier) GetName() string

func (*WorkloadIdentifier) GetPodName

func (m *WorkloadIdentifier) GetPodName() string

func (*WorkloadIdentifier) ProtoMessage

func (*WorkloadIdentifier) ProtoMessage()

func (*WorkloadIdentifier) Reset

func (m *WorkloadIdentifier) Reset()

func (*WorkloadIdentifier) String

func (m *WorkloadIdentifier) String() string

func (*WorkloadIdentifier) Validate

func (x *WorkloadIdentifier) Validate() error

func (*WorkloadIdentifier) XXX_DiscardUnknown

func (m *WorkloadIdentifier) XXX_DiscardUnknown()

func (*WorkloadIdentifier) XXX_Marshal

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

func (*WorkloadIdentifier) XXX_Merge

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

func (*WorkloadIdentifier) XXX_Size

func (m *WorkloadIdentifier) XXX_Size() int

func (*WorkloadIdentifier) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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