enspb

package
v0.0.0-...-b63aa1a Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterENSServer

func RegisterENSServer(s *grpc.Server, srv ENSServer)

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) Descriptor() ([]byte, []int)

func (*Contract) GetName

func (m *Contract) GetName() string

func (*Contract) GetVersion

func (m *Contract) GetVersion() string

func (*Contract) ProtoMessage

func (*Contract) ProtoMessage()

func (*Contract) Reset

func (m *Contract) Reset()

func (*Contract) String

func (m *Contract) String() string

func (*Contract) XXX_DiscardUnknown

func (m *Contract) XXX_DiscardUnknown()

func (*Contract) XXX_Marshal

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

func (*Contract) XXX_Merge

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

func (*Contract) XXX_Size

func (m *Contract) XXX_Size() int

func (*Contract) XXX_Unmarshal

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

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) Descriptor() ([]byte, []int)

func (*HostList) GetList

func (m *HostList) GetList() []*HostStatus

func (*HostList) ProtoMessage

func (*HostList) ProtoMessage()

func (*HostList) Reset

func (m *HostList) Reset()

func (*HostList) String

func (m *HostList) String() string

func (*HostList) XXX_DiscardUnknown

func (m *HostList) XXX_DiscardUnknown()

func (*HostList) XXX_Marshal

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

func (*HostList) XXX_Merge

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

func (*HostList) XXX_Size

func (m *HostList) XXX_Size() int

func (*HostList) XXX_Unmarshal

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

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) Descriptor() ([]byte, []int)

func (*Name) GetName

func (m *Name) GetName() string

func (*Name) ProtoMessage

func (*Name) ProtoMessage()

func (*Name) Reset

func (m *Name) Reset()

func (*Name) String

func (m *Name) String() string

func (*Name) XXX_DiscardUnknown

func (m *Name) XXX_DiscardUnknown()

func (*Name) XXX_Marshal

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

func (*Name) XXX_Merge

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

func (*Name) XXX_Size

func (m *Name) XXX_Size() int

func (*Name) XXX_Unmarshal

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

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) Descriptor() ([]byte, []int)

func (*NameRoute) GetName

func (m *NameRoute) GetName() *Name

func (*NameRoute) GetService

func (m *NameRoute) GetService() *Service

func (*NameRoute) ProtoMessage

func (*NameRoute) ProtoMessage()

func (*NameRoute) Reset

func (m *NameRoute) Reset()

func (*NameRoute) String

func (m *NameRoute) String() string

func (*NameRoute) XXX_DiscardUnknown

func (m *NameRoute) XXX_DiscardUnknown()

func (*NameRoute) XXX_Marshal

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

func (*NameRoute) XXX_Merge

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

func (*NameRoute) XXX_Size

func (m *NameRoute) XXX_Size() int

func (*NameRoute) XXX_Unmarshal

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

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) Descriptor() ([]byte, []int)

func (*Route) GetContract

func (m *Route) GetContract() *Contract

func (*Route) GetService

func (m *Route) GetService() *Service

func (*Route) ProtoMessage

func (*Route) ProtoMessage()

func (*Route) Reset

func (m *Route) Reset()

func (*Route) String

func (m *Route) String() string

func (*Route) XXX_DiscardUnknown

func (m *Route) XXX_DiscardUnknown()

func (*Route) XXX_Marshal

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

func (*Route) XXX_Merge

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

func (*Route) XXX_Size

func (m *Route) XXX_Size() int

func (*Route) XXX_Unmarshal

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

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) Descriptor() ([]byte, []int)

func (*RouteInfo) GetHostname

func (m *RouteInfo) GetHostname() string

func (*RouteInfo) GetProtocol

func (m *RouteInfo) GetProtocol() protocol.Type

func (*RouteInfo) GetRoute

func (m *RouteInfo) GetRoute() *Route

func (*RouteInfo) GetWeight

func (m *RouteInfo) GetWeight() uint32

func (*RouteInfo) ProtoMessage

func (*RouteInfo) ProtoMessage()

func (*RouteInfo) Reset

func (m *RouteInfo) Reset()

func (*RouteInfo) String

func (m *RouteInfo) String() string

func (*RouteInfo) XXX_DiscardUnknown

func (m *RouteInfo) XXX_DiscardUnknown()

func (*RouteInfo) XXX_Marshal

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

func (*RouteInfo) XXX_Merge

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

func (*RouteInfo) XXX_Size

func (m *RouteInfo) XXX_Size() int

func (*RouteInfo) XXX_Unmarshal

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

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) Descriptor() ([]byte, []int)

func (*RouteList) GetList

func (m *RouteList) GetList() []*Route

func (*RouteList) ProtoMessage

func (*RouteList) ProtoMessage()

func (*RouteList) Reset

func (m *RouteList) Reset()

func (*RouteList) String

func (m *RouteList) String() string

func (*RouteList) XXX_DiscardUnknown

func (m *RouteList) XXX_DiscardUnknown()

func (*RouteList) XXX_Marshal

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

func (*RouteList) XXX_Merge

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

func (*RouteList) XXX_Size

func (m *RouteList) XXX_Size() int

func (*RouteList) XXX_Unmarshal

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

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) Descriptor() ([]byte, []int)

func (*Service) GetHost

func (m *Service) GetHost() string

func (*Service) GetPort

func (m *Service) GetPort() uint32

func (*Service) ProtoMessage

func (*Service) ProtoMessage()

func (*Service) Reset

func (m *Service) Reset()

func (*Service) String

func (m *Service) String() string

func (*Service) XXX_DiscardUnknown

func (m *Service) XXX_DiscardUnknown()

func (*Service) XXX_Marshal

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

func (*Service) XXX_Merge

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

func (*Service) XXX_Size

func (m *Service) XXX_Size() int

func (*Service) XXX_Unmarshal

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

type Status

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

Status 返回状态 TODO 未来可能扩展

func (*Status) Descriptor

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

func (*Status) ProtoMessage

func (*Status) ProtoMessage()

func (*Status) Reset

func (m *Status) Reset()

func (*Status) String

func (m *Status) String() string

func (*Status) XXX_DiscardUnknown

func (m *Status) XXX_DiscardUnknown()

func (*Status) XXX_Marshal

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

func (*Status) XXX_Merge

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

func (*Status) XXX_Size

func (m *Status) XXX_Size() int

func (*Status) XXX_Unmarshal

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

type UnimplementedENSServer

type UnimplementedENSServer struct {
}

UnimplementedENSServer can be embedded to have forward compatible implementations.

func (*UnimplementedENSServer) AddRoute

func (*UnimplementedENSServer) AddRoute(ctx context.Context, req *RouteInfo) (*Status, error)

func (*UnimplementedENSServer) DeleteRoute

func (*UnimplementedENSServer) DeleteRoute(ctx context.Context, req *Route) (*Status, error)

func (*UnimplementedENSServer) DumpHost

func (*UnimplementedENSServer) DumpHost(ctx context.Context, req *types.Empty) (*HostList, error)

func (*UnimplementedENSServer) DumpRoute

func (*UnimplementedENSServer) DumpRoute(ctx context.Context, req *types.Empty) (*RouteList, error)

func (*UnimplementedENSServer) QueryRoute

type UnimplementedLegacyENSServer

type UnimplementedLegacyENSServer struct {
}

UnimplementedLegacyENSServer can be embedded to have forward compatible implementations.

func (*UnimplementedLegacyENSServer) Deregister

func (*UnimplementedLegacyENSServer) Register

Jump to

Keyboard shortcuts

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