Documentation
¶
Index ¶
- func RegisterENSServer(s *grpc.Server, srv ENSServer)
- func RegisterLegacyENSServer(s *grpc.Server, srv LegacyENSServer)
- 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 ENSClient
- type ENSServer
- type ENS_QueryRouteClient
- type ENS_QueryRouteServer
- type HostList
- func (*HostList) Descriptor() ([]byte, []int)
- func (m *HostList) GetList() []*HostStatus
- func (*HostList) ProtoMessage()
- func (m *HostList) Reset()
- func (m *HostList) String() string
- func (m *HostList) XXX_DiscardUnknown()
- func (m *HostList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HostList) XXX_Merge(src proto.Message)
- func (m *HostList) XXX_Size() int
- func (m *HostList) XXX_Unmarshal(b []byte) error
- type HostStatus
- func (*HostStatus) Descriptor() ([]byte, []int)
- func (m *HostStatus) GetActive() bool
- func (m *HostStatus) GetHost() string
- func (*HostStatus) ProtoMessage()
- func (m *HostStatus) Reset()
- func (m *HostStatus) String() string
- func (m *HostStatus) XXX_DiscardUnknown()
- func (m *HostStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HostStatus) XXX_Merge(src proto.Message)
- func (m *HostStatus) XXX_Size() int
- func (m *HostStatus) XXX_Unmarshal(b []byte) error
- type LegacyENSClient
- type LegacyENSServer
- type Name
- func (*Name) Descriptor() ([]byte, []int)
- func (m *Name) GetName() string
- func (*Name) ProtoMessage()
- func (m *Name) Reset()
- func (m *Name) String() string
- func (m *Name) XXX_DiscardUnknown()
- func (m *Name) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Name) XXX_Merge(src proto.Message)
- func (m *Name) XXX_Size() int
- func (m *Name) XXX_Unmarshal(b []byte) error
- type NameRoute
- func (*NameRoute) Descriptor() ([]byte, []int)
- func (m *NameRoute) GetName() *Name
- func (m *NameRoute) GetService() *Service
- func (*NameRoute) ProtoMessage()
- func (m *NameRoute) Reset()
- func (m *NameRoute) String() string
- func (m *NameRoute) XXX_DiscardUnknown()
- func (m *NameRoute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *NameRoute) XXX_Merge(src proto.Message)
- func (m *NameRoute) XXX_Size() int
- func (m *NameRoute) XXX_Unmarshal(b []byte) error
- type NameRouteInfo
- func (*NameRouteInfo) Descriptor() ([]byte, []int)
- func (m *NameRouteInfo) GetRoute() *NameRoute
- func (m *NameRouteInfo) GetWeight() uint32
- func (*NameRouteInfo) ProtoMessage()
- func (m *NameRouteInfo) Reset()
- func (m *NameRouteInfo) String() string
- func (m *NameRouteInfo) XXX_DiscardUnknown()
- func (m *NameRouteInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *NameRouteInfo) XXX_Merge(src proto.Message)
- func (m *NameRouteInfo) XXX_Size() int
- func (m *NameRouteInfo) XXX_Unmarshal(b []byte) error
- type Route
- func (*Route) Descriptor() ([]byte, []int)
- func (m *Route) GetContract() *Contract
- func (m *Route) GetService() *Service
- func (*Route) ProtoMessage()
- func (m *Route) Reset()
- func (m *Route) String() string
- func (m *Route) XXX_DiscardUnknown()
- func (m *Route) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Route) XXX_Merge(src proto.Message)
- func (m *Route) XXX_Size() int
- func (m *Route) XXX_Unmarshal(b []byte) error
- type RouteInfo
- func (*RouteInfo) Descriptor() ([]byte, []int)
- func (m *RouteInfo) GetHostname() string
- func (m *RouteInfo) GetProtocol() protocol.Type
- func (m *RouteInfo) GetRoute() *Route
- func (m *RouteInfo) GetWeight() uint32
- func (*RouteInfo) ProtoMessage()
- func (m *RouteInfo) Reset()
- func (m *RouteInfo) String() string
- func (m *RouteInfo) XXX_DiscardUnknown()
- func (m *RouteInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RouteInfo) XXX_Merge(src proto.Message)
- func (m *RouteInfo) XXX_Size() int
- func (m *RouteInfo) XXX_Unmarshal(b []byte) error
- type RouteList
- func (*RouteList) Descriptor() ([]byte, []int)
- func (m *RouteList) GetList() []*Route
- func (*RouteList) ProtoMessage()
- func (m *RouteList) Reset()
- func (m *RouteList) String() string
- func (m *RouteList) XXX_DiscardUnknown()
- func (m *RouteList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RouteList) XXX_Merge(src proto.Message)
- func (m *RouteList) XXX_Size() int
- func (m *RouteList) XXX_Unmarshal(b []byte) error
- type RouteQuery
- func (*RouteQuery) Descriptor() ([]byte, []int)
- func (m *RouteQuery) GetContractName() string
- func (m *RouteQuery) GetVersionConstraint() string
- func (*RouteQuery) ProtoMessage()
- func (m *RouteQuery) Reset()
- func (m *RouteQuery) String() string
- func (m *RouteQuery) XXX_DiscardUnknown()
- func (m *RouteQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RouteQuery) XXX_Merge(src proto.Message)
- func (m *RouteQuery) XXX_Size() int
- func (m *RouteQuery) XXX_Unmarshal(b []byte) error
- type Service
- func (*Service) Descriptor() ([]byte, []int)
- func (m *Service) GetHost() string
- func (m *Service) GetPort() 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 Status
- func (*Status) Descriptor() ([]byte, []int)
- func (*Status) ProtoMessage()
- func (m *Status) Reset()
- func (m *Status) String() string
- func (m *Status) XXX_DiscardUnknown()
- func (m *Status) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Status) XXX_Merge(src proto.Message)
- func (m *Status) XXX_Size() int
- func (m *Status) XXX_Unmarshal(b []byte) error
- type UnimplementedENSServer
- func (*UnimplementedENSServer) AddRoute(ctx context.Context, req *RouteInfo) (*Status, error)
- func (*UnimplementedENSServer) DeleteRoute(ctx context.Context, req *Route) (*Status, error)
- func (*UnimplementedENSServer) DumpHost(ctx context.Context, req *types.Empty) (*HostList, error)
- func (*UnimplementedENSServer) DumpRoute(ctx context.Context, req *types.Empty) (*RouteList, error)
- func (*UnimplementedENSServer) QueryRoute(req *RouteQuery, srv ENS_QueryRouteServer) error
- type UnimplementedLegacyENSServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterENSServer ¶
func RegisterLegacyENSServer ¶
func RegisterLegacyENSServer(s *grpc.Server, srv LegacyENSServer)
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 ENSClient ¶
type ENSClient interface { //AddRoute 添加一条契约路由 AddRoute(ctx context.Context, in *RouteInfo, opts ...grpc.CallOption) (*Status, error) //DeleteRoute 删除一条契约路由 DeleteRoute(ctx context.Context, in *Route, opts ...grpc.CallOption) (*Status, error) //QueryRoute 根据契约查询路由信息 QueryRoute(ctx context.Context, in *RouteQuery, opts ...grpc.CallOption) (ENS_QueryRouteClient, error) //DumpHost 输出所有缓存主机 DumpHost(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*HostList, error) //DumpRoute 输出所有缓存路由 DumpRoute(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*RouteList, 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 { //AddRoute 添加一条契约路由 AddRoute(context.Context, *RouteInfo) (*Status, error) //DeleteRoute 删除一条契约路由 DeleteRoute(context.Context, *Route) (*Status, error) //QueryRoute 根据契约查询路由信息 QueryRoute(*RouteQuery, ENS_QueryRouteServer) error //DumpHost 输出所有缓存主机 DumpHost(context.Context, *types.Empty) (*HostList, error) //DumpRoute 输出所有缓存路由 DumpRoute(context.Context, *types.Empty) (*RouteList, error) }
ENSServer is the server API for ENS service.
type ENS_QueryRouteClient ¶
type ENS_QueryRouteClient interface { Recv() (*RouteInfo, error) grpc.ClientStream }
type ENS_QueryRouteServer ¶
type ENS_QueryRouteServer interface { Send(*RouteInfo) error grpc.ServerStream }
type HostList ¶
type HostList struct { List []*HostStatus `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*HostList) Descriptor ¶
func (*HostList) GetList ¶
func (m *HostList) GetList() []*HostStatus
func (*HostList) ProtoMessage ¶
func (*HostList) ProtoMessage()
func (*HostList) XXX_DiscardUnknown ¶
func (m *HostList) XXX_DiscardUnknown()
func (*HostList) XXX_Marshal ¶
func (*HostList) XXX_Unmarshal ¶
type HostStatus ¶
type HostStatus struct { Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` Active bool `protobuf:"varint,2,opt,name=active,proto3" json:"active,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*HostStatus) Descriptor ¶
func (*HostStatus) Descriptor() ([]byte, []int)
func (*HostStatus) GetActive ¶
func (m *HostStatus) GetActive() bool
func (*HostStatus) GetHost ¶
func (m *HostStatus) GetHost() string
func (*HostStatus) ProtoMessage ¶
func (*HostStatus) ProtoMessage()
func (*HostStatus) Reset ¶
func (m *HostStatus) Reset()
func (*HostStatus) String ¶
func (m *HostStatus) String() string
func (*HostStatus) XXX_DiscardUnknown ¶
func (m *HostStatus) XXX_DiscardUnknown()
func (*HostStatus) XXX_Marshal ¶
func (m *HostStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*HostStatus) XXX_Merge ¶
func (m *HostStatus) XXX_Merge(src proto.Message)
func (*HostStatus) XXX_Size ¶
func (m *HostStatus) XXX_Size() int
func (*HostStatus) XXX_Unmarshal ¶
func (m *HostStatus) XXX_Unmarshal(b []byte) error
type LegacyENSClient ¶
type LegacyENSClient interface { Register(ctx context.Context, in *NameRoute, opts ...grpc.CallOption) (*Status, error) Deregister(ctx context.Context, in *NameRoute, opts ...grpc.CallOption) (*Status, error) }
LegacyENSClient is the client API for LegacyENS service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewLegacyENSClient ¶
func NewLegacyENSClient(cc *grpc.ClientConn) LegacyENSClient
type LegacyENSServer ¶
type LegacyENSServer interface { Register(context.Context, *NameRoute) (*Status, error) Deregister(context.Context, *NameRoute) (*Status, error) }
LegacyENSServer is the server API for LegacyENS service.
type Name ¶
type Name struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Name 名字
func (*Name) Descriptor ¶
func (*Name) ProtoMessage ¶
func (*Name) ProtoMessage()
func (*Name) XXX_DiscardUnknown ¶
func (m *Name) XXX_DiscardUnknown()
func (*Name) XXX_Unmarshal ¶
type NameRoute ¶
type NameRoute struct { Name *Name `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Service *Service `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
NameRoute 名字路由
func (*NameRoute) Descriptor ¶
func (*NameRoute) GetService ¶
func (*NameRoute) ProtoMessage ¶
func (*NameRoute) ProtoMessage()
func (*NameRoute) XXX_DiscardUnknown ¶
func (m *NameRoute) XXX_DiscardUnknown()
func (*NameRoute) XXX_Marshal ¶
func (*NameRoute) XXX_Unmarshal ¶
type NameRouteInfo ¶
type NameRouteInfo struct { Route *NameRoute `protobuf:"bytes,1,opt,name=route,proto3" json:"route,omitempty"` Weight uint32 `protobuf:"varint,4,opt,name=weight,proto3" json:"weight,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*NameRouteInfo) Descriptor ¶
func (*NameRouteInfo) Descriptor() ([]byte, []int)
func (*NameRouteInfo) GetRoute ¶
func (m *NameRouteInfo) GetRoute() *NameRoute
func (*NameRouteInfo) GetWeight ¶
func (m *NameRouteInfo) GetWeight() uint32
func (*NameRouteInfo) ProtoMessage ¶
func (*NameRouteInfo) ProtoMessage()
func (*NameRouteInfo) Reset ¶
func (m *NameRouteInfo) Reset()
func (*NameRouteInfo) String ¶
func (m *NameRouteInfo) String() string
func (*NameRouteInfo) XXX_DiscardUnknown ¶
func (m *NameRouteInfo) XXX_DiscardUnknown()
func (*NameRouteInfo) XXX_Marshal ¶
func (m *NameRouteInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*NameRouteInfo) XXX_Merge ¶
func (m *NameRouteInfo) XXX_Merge(src proto.Message)
func (*NameRouteInfo) XXX_Size ¶
func (m *NameRouteInfo) XXX_Size() int
func (*NameRouteInfo) XXX_Unmarshal ¶
func (m *NameRouteInfo) XXX_Unmarshal(b []byte) error
type Route ¶
type Route struct { Contract *Contract `protobuf:"bytes,1,opt,name=contract,proto3" json:"contract,omitempty"` Service *Service `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Route 路由定义, Contract + Service 作为一条路由的定义, 路由
func (*Route) Descriptor ¶
func (*Route) GetContract ¶
func (*Route) GetService ¶
func (*Route) ProtoMessage ¶
func (*Route) ProtoMessage()
func (*Route) XXX_DiscardUnknown ¶
func (m *Route) XXX_DiscardUnknown()
func (*Route) XXX_Marshal ¶
func (*Route) XXX_Unmarshal ¶
type RouteInfo ¶
type RouteInfo struct { Route *Route `protobuf:"bytes,1,opt,name=route,proto3" json:"route,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"` Protocol protocol.Type `protobuf:"varint,5,opt,name=protocol,proto3,enum=protocol.Type" json:"protocol,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
RouteInfo 路由信息
func (*RouteInfo) Descriptor ¶
func (*RouteInfo) GetHostname ¶
func (*RouteInfo) GetProtocol ¶
func (*RouteInfo) ProtoMessage ¶
func (*RouteInfo) ProtoMessage()
func (*RouteInfo) XXX_DiscardUnknown ¶
func (m *RouteInfo) XXX_DiscardUnknown()
func (*RouteInfo) XXX_Marshal ¶
func (*RouteInfo) XXX_Unmarshal ¶
type RouteList ¶
type RouteList struct { List []*Route `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*RouteList) Descriptor ¶
func (*RouteList) ProtoMessage ¶
func (*RouteList) ProtoMessage()
func (*RouteList) XXX_DiscardUnknown ¶
func (m *RouteList) XXX_DiscardUnknown()
func (*RouteList) XXX_Marshal ¶
func (*RouteList) XXX_Unmarshal ¶
type RouteQuery ¶
type RouteQuery struct { ContractName string `protobuf:"bytes,1,opt,name=contract_name,json=contractName,proto3" json:"contract_name,omitempty"` VersionConstraint string `protobuf:"bytes,2,opt,name=version_constraint,json=versionConstraint,proto3" json:"version_constraint,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*RouteQuery) Descriptor ¶
func (*RouteQuery) Descriptor() ([]byte, []int)
func (*RouteQuery) GetContractName ¶
func (m *RouteQuery) GetContractName() string
func (*RouteQuery) GetVersionConstraint ¶
func (m *RouteQuery) GetVersionConstraint() string
func (*RouteQuery) ProtoMessage ¶
func (*RouteQuery) ProtoMessage()
func (*RouteQuery) Reset ¶
func (m *RouteQuery) Reset()
func (*RouteQuery) String ¶
func (m *RouteQuery) String() string
func (*RouteQuery) XXX_DiscardUnknown ¶
func (m *RouteQuery) XXX_DiscardUnknown()
func (*RouteQuery) XXX_Marshal ¶
func (m *RouteQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*RouteQuery) XXX_Merge ¶
func (m *RouteQuery) XXX_Merge(src proto.Message)
func (*RouteQuery) XXX_Size ¶
func (m *RouteQuery) XXX_Size() int
func (*RouteQuery) XXX_Unmarshal ¶
func (m *RouteQuery) 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"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Service 服务节点信息, 服务节点由 host, port, hostname 组成
func (*Service) Descriptor ¶
func (*Service) ProtoMessage ¶
func (*Service) ProtoMessage()
func (*Service) XXX_DiscardUnknown ¶
func (m *Service) XXX_DiscardUnknown()
func (*Service) XXX_Marshal ¶
func (*Service) XXX_Unmarshal ¶
type Status ¶
type Status struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Status 返回状态 TODO 未来可能扩展
func (*Status) Descriptor ¶
func (*Status) ProtoMessage ¶
func (*Status) ProtoMessage()
func (*Status) XXX_DiscardUnknown ¶
func (m *Status) XXX_DiscardUnknown()
func (*Status) XXX_Marshal ¶
func (*Status) XXX_Unmarshal ¶
type UnimplementedENSServer ¶
type UnimplementedENSServer struct { }
UnimplementedENSServer can be embedded to have forward compatible implementations.
func (*UnimplementedENSServer) DeleteRoute ¶
func (*UnimplementedENSServer) QueryRoute ¶
func (*UnimplementedENSServer) QueryRoute(req *RouteQuery, srv ENS_QueryRouteServer) error
type UnimplementedLegacyENSServer ¶
type UnimplementedLegacyENSServer struct { }
UnimplementedLegacyENSServer can be embedded to have forward compatible implementations.