Documentation ¶
Index ¶
- func RegisterEnsServer(s *grpc.Server, srv EnsServer)
- type Contract
- func (*Contract) Descriptor() ([]byte, []int)
- func (m *Contract) GetName() string
- func (m *Contract) GetVersion() string
- func (*Contract) ProtoMessage()
- func (m *Contract) Reset()
- func (m *Contract) String() string
- func (m *Contract) XXX_DiscardUnknown()
- func (m *Contract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Contract) XXX_Merge(src proto.Message)
- func (m *Contract) XXX_Size() int
- func (m *Contract) XXX_Unmarshal(b []byte) error
- type ContractService
- func (*ContractService) Descriptor() ([]byte, []int)
- func (m *ContractService) GetContract() *Contract
- func (m *ContractService) GetServices() []*Service
- func (*ContractService) ProtoMessage()
- func (m *ContractService) Reset()
- func (m *ContractService) String() string
- func (m *ContractService) XXX_DiscardUnknown()
- func (m *ContractService) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ContractService) XXX_Merge(src proto.Message)
- func (m *ContractService) XXX_Size() int
- func (m *ContractService) XXX_Unmarshal(b []byte) error
- type EnsClient
- type EnsServer
- type RouteTable
- func (*RouteTable) Descriptor() ([]byte, []int)
- func (m *RouteTable) GetContractServices() []*ContractService
- func (*RouteTable) ProtoMessage()
- func (m *RouteTable) Reset()
- func (m *RouteTable) String() string
- func (m *RouteTable) XXX_DiscardUnknown()
- func (m *RouteTable) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RouteTable) XXX_Merge(src proto.Message)
- func (m *RouteTable) XXX_Size() int
- func (m *RouteTable) XXX_Unmarshal(b []byte) error
- type Service
- func (*Service) Descriptor() ([]byte, []int)
- func (m *Service) GetHost() string
- func (m *Service) GetHostname() string
- func (m *Service) GetPort() uint32
- func (m *Service) GetProto() protocol.Type
- func (m *Service) GetWeight() uint32
- func (*Service) ProtoMessage()
- func (m *Service) Reset()
- func (m *Service) String() string
- func (m *Service) XXX_DiscardUnknown()
- func (m *Service) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Service) XXX_Merge(src proto.Message)
- func (m *Service) XXX_Size() int
- func (m *Service) XXX_Unmarshal(b []byte) error
- type UnimplementedEnsServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterEnsServer ¶
Types ¶
type Contract ¶
type Contract 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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Contract 契约信息, 契约由 name 和 version 组成, version 需要满足 semver 规范
func (*Contract) Descriptor ¶
func (*Contract) GetVersion ¶
func (*Contract) ProtoMessage ¶
func (*Contract) ProtoMessage()
func (*Contract) XXX_DiscardUnknown ¶
func (m *Contract) XXX_DiscardUnknown()
func (*Contract) XXX_Marshal ¶
func (*Contract) XXX_Unmarshal ¶
type ContractService ¶
type ContractService struct { Contract *Contract `protobuf:"bytes,1,opt,name=contract,proto3" json:"contract,omitempty"` Services []*Service `protobuf:"bytes,2,rep,name=services,proto3" json:"services,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
ContractService 契约对应的路由信息
func (*ContractService) Descriptor ¶
func (*ContractService) Descriptor() ([]byte, []int)
func (*ContractService) GetContract ¶
func (m *ContractService) GetContract() *Contract
func (*ContractService) GetServices ¶
func (m *ContractService) GetServices() []*Service
func (*ContractService) ProtoMessage ¶
func (*ContractService) ProtoMessage()
func (*ContractService) Reset ¶
func (m *ContractService) Reset()
func (*ContractService) String ¶
func (m *ContractService) String() string
func (*ContractService) XXX_DiscardUnknown ¶
func (m *ContractService) XXX_DiscardUnknown()
func (*ContractService) XXX_Marshal ¶
func (m *ContractService) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ContractService) XXX_Merge ¶
func (m *ContractService) XXX_Merge(src proto.Message)
func (*ContractService) XXX_Size ¶
func (m *ContractService) XXX_Size() int
func (*ContractService) XXX_Unmarshal ¶
func (m *ContractService) XXX_Unmarshal(b []byte) error
type EnsClient ¶
type EnsClient interface { // GetRoute 根据契约, 查询路由信息 GetRoute(ctx context.Context, in *Contract, opts ...grpc.CallOption) (*RouteTable, error) }
EnsClient is the client API for Ens service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewEnsClient ¶
func NewEnsClient(cc *grpc.ClientConn) EnsClient
type EnsServer ¶
type EnsServer interface { // GetRoute 根据契约, 查询路由信息 GetRoute(context.Context, *Contract) (*RouteTable, error) }
EnsServer is the server API for Ens service.
type RouteTable ¶
type RouteTable struct { ContractServices []*ContractService `protobuf:"bytes,1,rep,name=contractServices,proto3" json:"contractServices,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
RouteTable 契约路由表
func (*RouteTable) Descriptor ¶
func (*RouteTable) Descriptor() ([]byte, []int)
func (*RouteTable) GetContractServices ¶
func (m *RouteTable) GetContractServices() []*ContractService
func (*RouteTable) ProtoMessage ¶
func (*RouteTable) ProtoMessage()
func (*RouteTable) Reset ¶
func (m *RouteTable) Reset()
func (*RouteTable) String ¶
func (m *RouteTable) String() string
func (*RouteTable) XXX_DiscardUnknown ¶
func (m *RouteTable) XXX_DiscardUnknown()
func (*RouteTable) XXX_Marshal ¶
func (m *RouteTable) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*RouteTable) XXX_Merge ¶
func (m *RouteTable) XXX_Merge(src proto.Message)
func (*RouteTable) XXX_Size ¶
func (m *RouteTable) XXX_Size() int
func (*RouteTable) XXX_Unmarshal ¶
func (m *RouteTable) XXX_Unmarshal(b []byte) error
type Service ¶
type Service struct { Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` Hostname string `protobuf:"bytes,3,opt,name=hostname,proto3" json:"hostname,omitempty"` Weight uint32 `protobuf:"varint,4,opt,name=weight,proto3" json:"weight,omitempty"` Proto protocol.Type `protobuf:"varint,5,opt,name=proto,proto3,enum=protocol.Type" json:"proto,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Service 服务节点信息, 服务节点由 host, port, hostname 组成
func (*Service) Descriptor ¶
func (*Service) GetHostname ¶
func (*Service) ProtoMessage ¶
func (*Service) ProtoMessage()
func (*Service) XXX_DiscardUnknown ¶
func (m *Service) XXX_DiscardUnknown()
func (*Service) XXX_Marshal ¶
func (*Service) XXX_Unmarshal ¶
type UnimplementedEnsServer ¶
type UnimplementedEnsServer struct { }
UnimplementedEnsServer can be embedded to have forward compatible implementations.
func (*UnimplementedEnsServer) GetRoute ¶
func (*UnimplementedEnsServer) GetRoute(ctx context.Context, req *Contract) (*RouteTable, error)
Click to show internal directories.
Click to hide internal directories.