name_service

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: 8 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)

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

func (*Service) GetHost

func (m *Service) GetHost() string

func (*Service) GetHostname

func (m *Service) GetHostname() string

func (*Service) GetPort

func (m *Service) GetPort() uint32

func (*Service) GetProto

func (m *Service) GetProto() protocol.Type

func (*Service) GetWeight

func (m *Service) GetWeight() 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 UnimplementedEnsServer

type UnimplementedEnsServer struct {
}

UnimplementedEnsServer can be embedded to have forward compatible implementations.

func (*UnimplementedEnsServer) GetRoute

Jump to

Keyboard shortcuts

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