go_micro_registry

package
v3.0.4+incompatible Latest Latest
Warning

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

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

Documentation

Overview

Package go_micro_registry is a generated protocol buffer package.

It is generated from these files:

registry.proto

It has these top-level messages:

Service
Node
Endpoint
Value
Options
Result
EmptyResponse
GetRequest
GetResponse
ListRequest
ListResponse
WatchRequest
Event

Package go_micro_registry is a generated protocol buffer package.

It is generated from these files:

registry.proto

It has these top-level messages:

Service
Node
Endpoint
Value
Options
Result
EmptyResponse
GetRequest
GetResponse
ListRequest
ListResponse
WatchRequest
Event

Index

Constants

This section is empty.

Variables

View Source
var EventType_name = map[int32]string{
	0: "Create",
	1: "Delete",
	2: "Update",
}
View Source
var EventType_value = map[string]int32{
	"Create": 0,
	"Delete": 1,
	"Update": 2,
}

Functions

func RegisterRegistryHandler

func RegisterRegistryHandler(s server.Server, hdlr RegistryHandler, opts ...server.HandlerOption)

Types

type EmptyResponse

type EmptyResponse struct {
}

func (*EmptyResponse) Descriptor

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

func (*EmptyResponse) ProtoMessage

func (*EmptyResponse) ProtoMessage()

func (*EmptyResponse) Reset

func (m *EmptyResponse) Reset()

func (*EmptyResponse) String

func (m *EmptyResponse) String() string

func (*EmptyResponse) Validate

func (this *EmptyResponse) Validate() error

type Endpoint

type Endpoint struct {
	Name     string            `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
	Request  *Value            `protobuf:"bytes,2,opt,name=request" json:"request,omitempty"`
	Response *Value            `protobuf:"bytes,3,opt,name=response" json:"response,omitempty"`
	Metadata map[string]string `` /* 136-byte string literal not displayed */
}

Endpoint is a endpoint provided by a service

func (*Endpoint) Descriptor

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

func (*Endpoint) GetMetadata

func (m *Endpoint) GetMetadata() map[string]string

func (*Endpoint) GetName

func (m *Endpoint) GetName() string

func (*Endpoint) GetRequest

func (m *Endpoint) GetRequest() *Value

func (*Endpoint) GetResponse

func (m *Endpoint) GetResponse() *Value

func (*Endpoint) ProtoMessage

func (*Endpoint) ProtoMessage()

func (*Endpoint) Reset

func (m *Endpoint) Reset()

func (*Endpoint) String

func (m *Endpoint) String() string

func (*Endpoint) Validate

func (this *Endpoint) Validate() error

type Event

type Event struct {
	// Event Id
	Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
	// type of event
	Type EventType `protobuf:"varint,2,opt,name=type,enum=go.micro.registry.EventType" json:"type,omitempty"`
	// unix timestamp of event
	Timestamp int64 `protobuf:"varint,3,opt,name=timestamp" json:"timestamp,omitempty"`
	// service entry
	Service *Service `protobuf:"bytes,4,opt,name=service" json:"service,omitempty"`
}

Event is registry event

func (*Event) Descriptor

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

func (*Event) GetId

func (m *Event) GetId() string

func (*Event) GetService

func (m *Event) GetService() *Service

func (*Event) GetTimestamp

func (m *Event) GetTimestamp() int64

func (*Event) GetType

func (m *Event) GetType() EventType

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) Reset

func (m *Event) Reset()

func (*Event) String

func (m *Event) String() string

func (*Event) Validate

func (this *Event) Validate() error

type EventType

type EventType int32

EventType defines the type of event

const (
	EventType_Create EventType = 0
	EventType_Delete EventType = 1
	EventType_Update EventType = 2
)

func (EventType) EnumDescriptor

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

func (EventType) String

func (x EventType) String() string

type GetRequest

type GetRequest struct {
	Service string `protobuf:"bytes,1,opt,name=service" json:"service,omitempty"`
}

func (*GetRequest) Descriptor

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

func (*GetRequest) GetService

func (m *GetRequest) GetService() string

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) Reset

func (m *GetRequest) Reset()

func (*GetRequest) String

func (m *GetRequest) String() string

func (*GetRequest) Validate

func (this *GetRequest) Validate() error

type GetResponse

type GetResponse struct {
	Services []*Service `protobuf:"bytes,1,rep,name=services" json:"services,omitempty"`
}

func (*GetResponse) Descriptor

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

func (*GetResponse) GetServices

func (m *GetResponse) GetServices() []*Service

func (*GetResponse) ProtoMessage

func (*GetResponse) ProtoMessage()

func (*GetResponse) Reset

func (m *GetResponse) Reset()

func (*GetResponse) String

func (m *GetResponse) String() string

func (*GetResponse) Validate

func (this *GetResponse) Validate() error

type ListRequest

type ListRequest struct {
}

func (*ListRequest) Descriptor

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

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) Reset

func (m *ListRequest) Reset()

func (*ListRequest) String

func (m *ListRequest) String() string

func (*ListRequest) Validate

func (this *ListRequest) Validate() error

type ListResponse

type ListResponse struct {
	Services []*Service `protobuf:"bytes,1,rep,name=services" json:"services,omitempty"`
}

func (*ListResponse) Descriptor

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

func (*ListResponse) GetServices

func (m *ListResponse) GetServices() []*Service

func (*ListResponse) ProtoMessage

func (*ListResponse) ProtoMessage()

func (*ListResponse) Reset

func (m *ListResponse) Reset()

func (*ListResponse) String

func (m *ListResponse) String() string

func (*ListResponse) Validate

func (this *ListResponse) Validate() error

type Node

type Node struct {
	Id       string            `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
	Address  string            `protobuf:"bytes,2,opt,name=address" json:"address,omitempty"`
	Port     int64             `protobuf:"varint,3,opt,name=port" json:"port,omitempty"`
	Metadata map[string]string `` /* 136-byte string literal not displayed */
}

Node represents the node the service is on

func (*Node) Descriptor

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

func (*Node) GetAddress

func (m *Node) GetAddress() string

func (*Node) GetId

func (m *Node) GetId() string

func (*Node) GetMetadata

func (m *Node) GetMetadata() map[string]string

func (*Node) GetPort

func (m *Node) GetPort() int64

func (*Node) ProtoMessage

func (*Node) ProtoMessage()

func (*Node) Reset

func (m *Node) Reset()

func (*Node) String

func (m *Node) String() string

func (*Node) Validate

func (this *Node) Validate() error

type Options

type Options struct {
	Ttl int64 `protobuf:"varint,1,opt,name=ttl" json:"ttl,omitempty"`
}

Options are registry options

func (*Options) Descriptor

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

func (*Options) GetTtl

func (m *Options) GetTtl() int64

func (*Options) ProtoMessage

func (*Options) ProtoMessage()

func (*Options) Reset

func (m *Options) Reset()

func (*Options) String

func (m *Options) String() string

func (*Options) Validate

func (this *Options) Validate() error

type Registry

type Registry struct {
	RegistryHandler
}

func (*Registry) Deregister

func (h *Registry) Deregister(ctx context.Context, in *Service, out *EmptyResponse) error

func (*Registry) GetService

func (h *Registry) GetService(ctx context.Context, in *GetRequest, out *GetResponse) error

func (*Registry) ListServices

func (h *Registry) ListServices(ctx context.Context, in *ListRequest, out *ListResponse) error

func (*Registry) Register

func (h *Registry) Register(ctx context.Context, in *Service, out *EmptyResponse) error

func (*Registry) Watch

func (h *Registry) Watch(ctx context.Context, stream server.Streamer) error

type RegistryClient

type RegistryClient interface {
	GetService(ctx context.Context, in *GetRequest, opts ...client.CallOption) (*GetResponse, error)
	Register(ctx context.Context, in *Service, opts ...client.CallOption) (*EmptyResponse, error)
	Deregister(ctx context.Context, in *Service, opts ...client.CallOption) (*EmptyResponse, error)
	ListServices(ctx context.Context, in *ListRequest, opts ...client.CallOption) (*ListResponse, error)
	Watch(ctx context.Context, in *WatchRequest, opts ...client.CallOption) (Registry_WatchClient, error)
}

func NewRegistryClient

func NewRegistryClient(serviceName string, c client.Client) RegistryClient

type Registry_WatchClient

type Registry_WatchClient interface {
	SendMsg(interface{}) error
	RecvMsg(interface{}) error
	Close() error
	Recv() (*Result, error)
}

type Registry_WatchStream

type Registry_WatchStream interface {
	SendMsg(interface{}) error
	RecvMsg(interface{}) error
	Close() error
	Send(*Result) error
}

type Result

type Result struct {
	Action    string   `protobuf:"bytes,1,opt,name=action" json:"action,omitempty"`
	Service   *Service `protobuf:"bytes,2,opt,name=service" json:"service,omitempty"`
	Timestamp int64    `protobuf:"varint,3,opt,name=timestamp" json:"timestamp,omitempty"`
}

Result is returns by the watcher

func (*Result) Descriptor

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

func (*Result) GetAction

func (m *Result) GetAction() string

func (*Result) GetService

func (m *Result) GetService() *Service

func (*Result) GetTimestamp

func (m *Result) GetTimestamp() int64

func (*Result) ProtoMessage

func (*Result) ProtoMessage()

func (*Result) Reset

func (m *Result) Reset()

func (*Result) String

func (m *Result) String() string

func (*Result) Validate

func (this *Result) Validate() error

type Service

type Service struct {
	Name      string            `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
	Version   string            `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"`
	Metadata  map[string]string `` /* 136-byte string literal not displayed */
	Endpoints []*Endpoint       `protobuf:"bytes,4,rep,name=endpoints" json:"endpoints,omitempty"`
	Nodes     []*Node           `protobuf:"bytes,5,rep,name=nodes" json:"nodes,omitempty"`
	Options   *Options          `protobuf:"bytes,6,opt,name=options" json:"options,omitempty"`
}

Service represents a go-micro service

func (*Service) Descriptor

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

func (*Service) GetEndpoints

func (m *Service) GetEndpoints() []*Endpoint

func (*Service) GetMetadata

func (m *Service) GetMetadata() map[string]string

func (*Service) GetName

func (m *Service) GetName() string

func (*Service) GetNodes

func (m *Service) GetNodes() []*Node

func (*Service) GetOptions

func (m *Service) GetOptions() *Options

func (*Service) GetVersion

func (m *Service) GetVersion() string

func (*Service) ProtoMessage

func (*Service) ProtoMessage()

func (*Service) Reset

func (m *Service) Reset()

func (*Service) String

func (m *Service) String() string

func (*Service) Validate

func (this *Service) Validate() error

type Value

type Value struct {
	Name   string   `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
	Type   string   `protobuf:"bytes,2,opt,name=type" json:"type,omitempty"`
	Values []*Value `protobuf:"bytes,3,rep,name=values" json:"values,omitempty"`
}

Value is an opaque value for a request or response

func (*Value) Descriptor

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

func (*Value) GetName

func (m *Value) GetName() string

func (*Value) GetType

func (m *Value) GetType() string

func (*Value) GetValues

func (m *Value) GetValues() []*Value

func (*Value) ProtoMessage

func (*Value) ProtoMessage()

func (*Value) Reset

func (m *Value) Reset()

func (*Value) String

func (m *Value) String() string

func (*Value) Validate

func (this *Value) Validate() error

type WatchRequest

type WatchRequest struct {
	// service is optional
	Service string `protobuf:"bytes,1,opt,name=service" json:"service,omitempty"`
}

func (*WatchRequest) Descriptor

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

func (*WatchRequest) GetService

func (m *WatchRequest) GetService() string

func (*WatchRequest) ProtoMessage

func (*WatchRequest) ProtoMessage()

func (*WatchRequest) Reset

func (m *WatchRequest) Reset()

func (*WatchRequest) String

func (m *WatchRequest) String() string

func (*WatchRequest) Validate

func (this *WatchRequest) Validate() error

Jump to

Keyboard shortcuts

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