Documentation ¶
Index ¶
- Constants
- Variables
- func Close() error
- func NewPlugin(_ context.Context) application.Plugin
- func Register(ctx context.Context, endpoint string, mds ...Metadata) error
- func RegisterEtcdResolverBuilder(ctx context.Context, client *clientv3.Client, namespace string) resolver.Builder
- func RegisterNacosResolverBuilder(ctx context.Context, client naming_client.INamingClient) resolver.Builder
- func RegistryClientType(typeName string, fn InitRegisterFunc)
- func SetDefaultRegister(r RegisterInterface)
- func Unregister(ctx context.Context, endpoint string, mds ...Metadata) error
- type EtcdRegister
- type EtcdResolverBuilder
- type InitRegisterFunc
- type Metadata
- type NacosRegister
- type NacosResolverBuilder
- func (n *NacosResolverBuilder) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error)
- func (n *NacosResolverBuilder) RegisterService(_ context.Context, service Metadata, endpoint string) error
- func (n *NacosResolverBuilder) Scheme() string
- func (n *NacosResolverBuilder) UnregisterService(_ context.Context, service Metadata, endpoint string) error
- type Plugin
- type RegisterInterface
- type RegisterServices
- type ServiceInfo
Constants ¶
View Source
const ResolverEtcdScheme = "neptune-etcd"
View Source
const ResolverNacosScheme = "neptune-nacos"
Variables ¶
View Source
var DefaultEtcdTTL int64 = 10
Functions ¶
func RegisterEtcdResolverBuilder ¶
func RegisterEtcdResolverBuilder(ctx context.Context, client *clientv3.Client, namespace string) resolver.Builder
RegisterEtcdResolverBuilder 创建一个etcd解析器构建器,解析器schema为 ResolverEtcdScheme
func RegisterNacosResolverBuilder ¶
func RegisterNacosResolverBuilder(ctx context.Context, client naming_client.INamingClient) resolver.Builder
RegisterNacosResolverBuilder 创建一个nacos解析器构建器,解析器schema为 ResolverEtcdScheme
func RegistryClientType ¶
func RegistryClientType(typeName string, fn InitRegisterFunc)
func SetDefaultRegister ¶
func SetDefaultRegister(r RegisterInterface)
Types ¶
type EtcdRegister ¶
func (*EtcdRegister) Close ¶
func (e *EtcdRegister) Close() error
func (*EtcdRegister) Unregister ¶
type EtcdResolverBuilder ¶
type EtcdResolverBuilder struct {
// contains filtered or unexported fields
}
func (*EtcdResolverBuilder) Build ¶
func (e *EtcdResolverBuilder) Build(target resolver.Target, cc resolver.ClientConn, _ resolver.BuildOptions) (resolver.Resolver, error)
func (*EtcdResolverBuilder) Scheme ¶
func (e *EtcdResolverBuilder) Scheme() string
type Metadata ¶
type Metadata interface { ServiceDesc() *grpc.ServiceDesc Version() string UniqueKey() string }
func NewServiceMetadata ¶
func NewServiceMetadata(sd *grpc.ServiceDesc, svcVersion string) Metadata
type NacosRegister ¶
type NacosRegister struct {
// contains filtered or unexported fields
}
func (*NacosRegister) Close ¶
func (n *NacosRegister) Close() error
func (*NacosRegister) Unregister ¶
type NacosResolverBuilder ¶
type NacosResolverBuilder struct {
// contains filtered or unexported fields
}
func (*NacosResolverBuilder) Build ¶
func (n *NacosResolverBuilder) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error)
func (*NacosResolverBuilder) RegisterService ¶
func (*NacosResolverBuilder) Scheme ¶
func (n *NacosResolverBuilder) Scheme() string
func (*NacosResolverBuilder) UnregisterService ¶
type Plugin ¶
type Plugin struct { application.Plugin // contains filtered or unexported fields }
type RegisterInterface ¶
type RegisterInterface interface { Register(ctx context.Context, service Metadata, endpoint string) error Unregister(ctx context.Context, service Metadata, endpoint string) error Close() error }
func NewEtcdRegister ¶
func NewEtcdRegister(ctx context.Context, client *clientv3.Client, namespace string, ttl int64) RegisterInterface
NewEtcdRegister 创建一个etcd注册器
func NewNacosRegister ¶
func NewNacosRegister(ctx context.Context, client naming_client.INamingClient, groupName string) RegisterInterface
NewNacosRegister 创建一个nacos服务注册器
type RegisterServices ¶
type RegisterServices struct {
// contains filtered or unexported fields
}
func (*RegisterServices) Del ¶
func (r *RegisterServices) Del(instance Metadata, endpoint string)
func (*RegisterServices) Put ¶
func (r *RegisterServices) Put(instance Metadata, endpoint string)
type ServiceInfo ¶
func (*ServiceInfo) Del ¶
func (e *ServiceInfo) Del(endpoint string)
func (*ServiceInfo) IsEmpty ¶
func (e *ServiceInfo) IsEmpty() bool
func (*ServiceInfo) Put ¶
func (e *ServiceInfo) Put(endpoint string)
Click to show internal directories.
Click to hide internal directories.