 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Variables
- func NewRegistryEndpoints() []*api.Endpoint
- func RegisterRegistryHandler(s server.Server, hdlr RegistryHandler, opts ...server.HandlerOption) error
- func RegisterRegistryServer(s *grpc.Server, srv RegistryServer)
- type EmptyResponse
- type Endpoint
- func (*Endpoint) Descriptor() ([]byte, []int)deprecated
- func (x *Endpoint) GetMetadata() map[string]string
- func (x *Endpoint) GetName() string
- func (x *Endpoint) GetRequest() *Value
- func (x *Endpoint) GetResponse() *Value
- func (*Endpoint) ProtoMessage()
- func (x *Endpoint) ProtoReflect() protoreflect.Message
- func (x *Endpoint) Reset()
- func (x *Endpoint) String() string
 
- type Event
- func (*Event) Descriptor() ([]byte, []int)deprecated
- func (x *Event) GetId() string
- func (x *Event) GetService() *Service
- func (x *Event) GetTimestamp() int64
- func (x *Event) GetType() EventType
- func (*Event) ProtoMessage()
- func (x *Event) ProtoReflect() protoreflect.Message
- func (x *Event) Reset()
- func (x *Event) String() string
 
- type EventType
- type GetRequest
- type GetResponse
- type ListRequest
- type ListResponse
- type Node
- func (*Node) Descriptor() ([]byte, []int)deprecated
- func (x *Node) GetAddress() string
- func (x *Node) GetId() string
- func (x *Node) GetMetadata() map[string]string
- func (x *Node) GetPort() int64
- func (*Node) ProtoMessage()
- func (x *Node) ProtoReflect() protoreflect.Message
- func (x *Node) Reset()
- func (x *Node) String() string
 
- type Options
- type RegistryClient
- type RegistryHandler
- type RegistryServer
- type RegistryService
- type Registry_WatchClient
- type Registry_WatchServer
- type Registry_WatchService
- type Registry_WatchStream
- type Result
- func (*Result) Descriptor() ([]byte, []int)deprecated
- func (x *Result) GetAction() string
- func (x *Result) GetService() *Service
- func (x *Result) GetTimestamp() int64
- func (*Result) ProtoMessage()
- func (x *Result) ProtoReflect() protoreflect.Message
- func (x *Result) Reset()
- func (x *Result) String() string
 
- type Service
- func (*Service) Descriptor() ([]byte, []int)deprecated
- func (x *Service) GetEndpoints() []*Endpoint
- func (x *Service) GetMetadata() map[string]string
- func (x *Service) GetName() string
- func (x *Service) GetNodes() []*Node
- func (x *Service) GetOptions() *Options
- func (x *Service) GetVersion() string
- func (*Service) ProtoMessage()
- func (x *Service) ProtoReflect() protoreflect.Message
- func (x *Service) Reset()
- func (x *Service) String() string
 
- type UnimplementedRegistryServer
- func (*UnimplementedRegistryServer) Deregister(context.Context, *Service) (*EmptyResponse, error)
- func (*UnimplementedRegistryServer) GetService(context.Context, *GetRequest) (*GetResponse, error)
- func (*UnimplementedRegistryServer) ListServices(context.Context, *ListRequest) (*ListResponse, error)
- func (*UnimplementedRegistryServer) Register(context.Context, *Service) (*EmptyResponse, error)
- func (*UnimplementedRegistryServer) Watch(*WatchRequest, Registry_WatchServer) error
 
- type Value
- type WatchRequest
Constants ¶
This section is empty.
Variables ¶
var ( EventType_name = map[int32]string{ 0: "Create", 1: "Delete", 2: "Update", } EventType_value = map[string]int32{ "Create": 0, "Delete": 1, "Update": 2, } )
Enum value maps for EventType.
var File_registry_service_proto_registry_proto protoreflect.FileDescriptor
    Functions ¶
func NewRegistryEndpoints ¶
func RegisterRegistryHandler ¶
func RegisterRegistryHandler(s server.Server, hdlr RegistryHandler, opts ...server.HandlerOption) error
func RegisterRegistryServer ¶
func RegisterRegistryServer(s *grpc.Server, srv RegistryServer)
Types ¶
type EmptyResponse ¶
type EmptyResponse struct {
	// contains filtered or unexported fields
}
    
        
          
            func (*EmptyResponse) Descriptor
            deprecated
            
          
  
    
  
      
      func (*EmptyResponse) Descriptor() ([]byte, []int)
Deprecated: Use EmptyResponse.ProtoReflect.Descriptor instead.
func (*EmptyResponse) ProtoMessage ¶
func (*EmptyResponse) ProtoMessage()
func (*EmptyResponse) ProtoReflect ¶
func (x *EmptyResponse) ProtoReflect() protoreflect.Message
func (*EmptyResponse) Reset ¶
func (x *EmptyResponse) Reset()
func (*EmptyResponse) String ¶
func (x *EmptyResponse) String() string
type Endpoint ¶
type Endpoint struct {
	Name     string            `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Request  *Value            `protobuf:"bytes,2,opt,name=request,proto3" json:"request,omitempty"`
	Response *Value            `protobuf:"bytes,3,opt,name=response,proto3" json:"response,omitempty"`
	Metadata map[string]string `` /* 157-byte string literal not displayed */
	// contains filtered or unexported fields
}
    Endpoint is a endpoint provided by a service
        
          
            func (*Endpoint) Descriptor
            deprecated
            
          
  
    
  
      
      
    func (*Endpoint) GetMetadata ¶
func (*Endpoint) GetRequest ¶
func (*Endpoint) GetResponse ¶
func (*Endpoint) ProtoMessage ¶
func (*Endpoint) ProtoMessage()
func (*Endpoint) ProtoReflect ¶
func (x *Endpoint) ProtoReflect() protoreflect.Message
type Event ¶
type Event struct {
	// Event Id
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// type of event
	Type EventType `protobuf:"varint,2,opt,name=type,proto3,enum=go.micro.registry.EventType" json:"type,omitempty"`
	// unix timestamp of event
	Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// service entry
	Service *Service `protobuf:"bytes,4,opt,name=service,proto3" json:"service,omitempty"`
	// contains filtered or unexported fields
}
    Event is registry event
        
          
            func (*Event) Descriptor
            deprecated
            
          
  
    
  
      
      
    func (*Event) GetService ¶
func (*Event) GetTimestamp ¶
func (*Event) ProtoMessage ¶
func (*Event) ProtoMessage()
func (*Event) ProtoReflect ¶
func (x *Event) ProtoReflect() protoreflect.Message
type EventType ¶
type EventType int32
EventType defines the type of event
func (EventType) Descriptor ¶
func (EventType) Descriptor() protoreflect.EnumDescriptor
        
          
            func (EventType) EnumDescriptor
            deprecated
            
          
  
    
  
      
      
    func (EventType) Number ¶
func (x EventType) Number() protoreflect.EnumNumber
func (EventType) Type ¶
func (EventType) Type() protoreflect.EnumType
type GetRequest ¶
type GetRequest struct {
	Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
	// contains filtered or unexported fields
}
    
        
          
            func (*GetRequest) Descriptor
            deprecated
            
          
  
    
  
      
      func (*GetRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.
func (*GetRequest) GetService ¶
func (x *GetRequest) GetService() string
func (*GetRequest) ProtoMessage ¶
func (*GetRequest) ProtoMessage()
func (*GetRequest) ProtoReflect ¶
func (x *GetRequest) ProtoReflect() protoreflect.Message
func (*GetRequest) Reset ¶
func (x *GetRequest) Reset()
func (*GetRequest) String ¶
func (x *GetRequest) String() string
type GetResponse ¶
type GetResponse struct {
	Services []*Service `protobuf:"bytes,1,rep,name=services,proto3" json:"services,omitempty"`
	// contains filtered or unexported fields
}
    
        
          
            func (*GetResponse) Descriptor
            deprecated
            
          
  
    
  
      
      func (*GetResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.
func (*GetResponse) GetServices ¶
func (x *GetResponse) GetServices() []*Service
func (*GetResponse) ProtoMessage ¶
func (*GetResponse) ProtoMessage()
func (*GetResponse) ProtoReflect ¶
func (x *GetResponse) ProtoReflect() protoreflect.Message
func (*GetResponse) Reset ¶
func (x *GetResponse) Reset()
func (*GetResponse) String ¶
func (x *GetResponse) String() string
type ListRequest ¶
type ListRequest struct {
	// contains filtered or unexported fields
}
    
        
          
            func (*ListRequest) Descriptor
            deprecated
            
          
  
    
  
      
      func (*ListRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.
func (*ListRequest) ProtoMessage ¶
func (*ListRequest) ProtoMessage()
func (*ListRequest) ProtoReflect ¶
func (x *ListRequest) ProtoReflect() protoreflect.Message
func (*ListRequest) Reset ¶
func (x *ListRequest) Reset()
func (*ListRequest) String ¶
func (x *ListRequest) String() string
type ListResponse ¶
type ListResponse struct {
	Services []*Service `protobuf:"bytes,1,rep,name=services,proto3" json:"services,omitempty"`
	// contains filtered or unexported fields
}
    
        
          
            func (*ListResponse) Descriptor
            deprecated
            
          
  
    
  
      
      func (*ListResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.
func (*ListResponse) GetServices ¶
func (x *ListResponse) GetServices() []*Service
func (*ListResponse) ProtoMessage ¶
func (*ListResponse) ProtoMessage()
func (*ListResponse) ProtoReflect ¶
func (x *ListResponse) ProtoReflect() protoreflect.Message
func (*ListResponse) Reset ¶
func (x *ListResponse) Reset()
func (*ListResponse) String ¶
func (x *ListResponse) String() string
type Node ¶
type Node struct {
	Id       string            `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Address  string            `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
	Port     int64             `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"`
	Metadata map[string]string `` /* 157-byte string literal not displayed */
	// contains filtered or unexported fields
}
    Node represents the node the service is on
        
          
            func (*Node) Descriptor
            deprecated
            
          
  
    
  
      
      
    func (*Node) GetAddress ¶
func (*Node) GetMetadata ¶
func (*Node) ProtoMessage ¶
func (*Node) ProtoMessage()
func (*Node) ProtoReflect ¶
func (x *Node) ProtoReflect() protoreflect.Message
type Options ¶
type Options struct {
	Ttl int64 `protobuf:"varint,1,opt,name=ttl,proto3" json:"ttl,omitempty"`
	// contains filtered or unexported fields
}
    Options are registry options
        
          
            func (*Options) Descriptor
            deprecated
            
          
  
    
  
      
      
    func (*Options) ProtoMessage ¶
func (*Options) ProtoMessage()
func (*Options) ProtoReflect ¶
func (x *Options) ProtoReflect() protoreflect.Message
type RegistryClient ¶
type RegistryClient interface {
	GetService(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
	Register(ctx context.Context, in *Service, opts ...grpc.CallOption) (*EmptyResponse, error)
	Deregister(ctx context.Context, in *Service, opts ...grpc.CallOption) (*EmptyResponse, error)
	ListServices(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
	Watch(ctx context.Context, in *WatchRequest, opts ...grpc.CallOption) (Registry_WatchClient, 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.ClientConnInterface) RegistryClient
type RegistryHandler ¶
type RegistryHandler interface {
	GetService(context.Context, *GetRequest, *GetResponse) error
	Register(context.Context, *Service, *EmptyResponse) error
	Deregister(context.Context, *Service, *EmptyResponse) error
	ListServices(context.Context, *ListRequest, *ListResponse) error
	Watch(context.Context, *WatchRequest, Registry_WatchStream) error
}
    type RegistryServer ¶
type RegistryServer interface {
	GetService(context.Context, *GetRequest) (*GetResponse, error)
	Register(context.Context, *Service) (*EmptyResponse, error)
	Deregister(context.Context, *Service) (*EmptyResponse, error)
	ListServices(context.Context, *ListRequest) (*ListResponse, error)
	Watch(*WatchRequest, Registry_WatchServer) error
}
    RegistryServer is the server API for Registry service.
type RegistryService ¶
type RegistryService 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_WatchService, error)
}
    func NewRegistryService ¶
func NewRegistryService(name string, c client.Client) RegistryService
type Registry_WatchClient ¶
type Registry_WatchClient interface {
	Recv() (*Result, error)
	grpc.ClientStream
}
    type Registry_WatchServer ¶
type Registry_WatchServer interface {
	Send(*Result) error
	grpc.ServerStream
}
    type Registry_WatchService ¶
type Registry_WatchStream ¶
type Result ¶
type Result struct {
	Action    string   `protobuf:"bytes,1,opt,name=action,proto3" json:"action,omitempty"` // create, update, delete
	Service   *Service `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"`
	Timestamp int64    `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // unix timestamp
	// contains filtered or unexported fields
}
    Result is returns by the watcher
        
          
            func (*Result) Descriptor
            deprecated
            
          
  
    
  
      
      
    func (*Result) GetService ¶
func (*Result) GetTimestamp ¶
func (*Result) ProtoMessage ¶
func (*Result) ProtoMessage()
func (*Result) ProtoReflect ¶
func (x *Result) ProtoReflect() protoreflect.Message
type Service ¶
type Service struct {
	Name      string            `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Version   string            `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	Metadata  map[string]string `` /* 157-byte string literal not displayed */
	Endpoints []*Endpoint       `protobuf:"bytes,4,rep,name=endpoints,proto3" json:"endpoints,omitempty"`
	Nodes     []*Node           `protobuf:"bytes,5,rep,name=nodes,proto3" json:"nodes,omitempty"`
	Options   *Options          `protobuf:"bytes,6,opt,name=options,proto3" json:"options,omitempty"`
	// contains filtered or unexported fields
}
    Service represents a go-micro service
        
          
            func (*Service) Descriptor
            deprecated
            
          
  
    
  
      
      
    func (*Service) GetEndpoints ¶
func (*Service) GetMetadata ¶
func (*Service) GetOptions ¶
func (*Service) GetVersion ¶
func (*Service) ProtoMessage ¶
func (*Service) ProtoMessage()
func (*Service) ProtoReflect ¶
func (x *Service) ProtoReflect() protoreflect.Message
type UnimplementedRegistryServer ¶
type UnimplementedRegistryServer struct {
}
    UnimplementedRegistryServer can be embedded to have forward compatible implementations.
func (*UnimplementedRegistryServer) Deregister ¶
func (*UnimplementedRegistryServer) Deregister(context.Context, *Service) (*EmptyResponse, error)
func (*UnimplementedRegistryServer) GetService ¶
func (*UnimplementedRegistryServer) GetService(context.Context, *GetRequest) (*GetResponse, error)
func (*UnimplementedRegistryServer) ListServices ¶
func (*UnimplementedRegistryServer) ListServices(context.Context, *ListRequest) (*ListResponse, error)
func (*UnimplementedRegistryServer) Register ¶
func (*UnimplementedRegistryServer) Register(context.Context, *Service) (*EmptyResponse, error)
func (*UnimplementedRegistryServer) Watch ¶
func (*UnimplementedRegistryServer) Watch(*WatchRequest, Registry_WatchServer) error
type Value ¶
type Value struct {
	Name   string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Type   string   `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	Values []*Value `protobuf:"bytes,3,rep,name=values,proto3" json:"values,omitempty"`
	// contains filtered or unexported fields
}
    Value is an opaque value for a request or response
        
          
            func (*Value) Descriptor
            deprecated
            
          
  
    
  
      
      
    func (*Value) ProtoMessage ¶
func (*Value) ProtoMessage()
func (*Value) ProtoReflect ¶
func (x *Value) ProtoReflect() protoreflect.Message
type WatchRequest ¶
type WatchRequest struct {
	// service is optional
	Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"`
	// contains filtered or unexported fields
}
    
        
          
            func (*WatchRequest) Descriptor
            deprecated
            
          
  
    
  
      
      func (*WatchRequest) Descriptor() ([]byte, []int)
Deprecated: Use WatchRequest.ProtoReflect.Descriptor instead.
func (*WatchRequest) GetService ¶
func (x *WatchRequest) GetService() string
func (*WatchRequest) ProtoMessage ¶
func (*WatchRequest) ProtoMessage()
func (*WatchRequest) ProtoReflect ¶
func (x *WatchRequest) ProtoReflect() protoreflect.Message
func (*WatchRequest) Reset ¶
func (x *WatchRequest) Reset()
func (*WatchRequest) String ¶
func (x *WatchRequest) String() string