Documentation ¶
Index ¶
- func RegisterETCDRegisterPrefixKey(prefix string)
- func RegisterEtcdClient(etcdConfig clientv3.Config) error
- func RegisterRegionProxy(region, proxy string)
- func ResolveEtcdClient() *clientv3.Client
- func ResolveProxy(region string) string
- type ClientConn
- func (c *ClientConn[T]) WithDialTimeout(t time.Duration) infra.ClientOptions[T]
- func (c *ClientConn[T]) WithGrpcDialOptions(opts ...grpc.DialOption) infra.ClientOptions[T]
- func (*ClientConn[T]) WithNamespace(ns string) infra.ClientOptions[etcdresolver.ResolveMeta]
- func (*ClientConn[T]) WithOrg(id string) infra.ClientOptions[etcdresolver.ResolveMeta]
- func (*ClientConn[T]) WithRegion(region string) infra.ClientOptions[etcdresolver.ResolveMeta]
- func (c *ClientConn[T]) WithServiceResolver(r resolver.Resolver) infra.ClientOptions[T]
- type Server
- func (*Server[T]) WithAddress(addr []infra.Address) infra.Option[T]
- func (s *Server[T]) WithGrpcServerOptions(opts ...grpc.ServerOption) infra.Option[T]
- func (*Server[T]) WithHttpServer(srv *http.Server) infra.Option[T]
- func (s *Server[T]) WithNamespace(ns string) infra.Option[etcd.NodeMeta]
- func (s *Server[T]) WithOrg(org string) infra.Option[etcd.NodeMeta]
- func (s *Server[T]) WithRegion(region string) infra.Option[etcd.NodeMeta]
- func (*Server[T]) WithServiceRegister(r register.ServiceRegister[etcd.NodeMeta]) infra.Option[etcd.NodeMeta]
- func (s *Server[T]) WithWeight(weight int32) infra.Option[etcd.NodeMeta]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterETCDRegisterPrefixKey ¶
func RegisterETCDRegisterPrefixKey(prefix string)
RegisterETCDRegisterPrefixKey a function to change default register(etcd) prefix key
func RegisterEtcdClient ¶
ResolveEtcdClient a function to register etcd client to watermelon global
func RegisterRegionProxy ¶
func RegisterRegionProxy(region, proxy string)
RegisterRegionProxy set region's proxy endpoint
func ResolveEtcdClient ¶
ResolveEtcdClient a function to get registed etcd client
func ResolveProxy ¶
ResolveProxy return region's proxy, if it exist
Types ¶
type ClientConn ¶
type ClientConn[T infra.ClientServiceNameGenerator] func(serviceName string, opts ...infra.ClientOptions[T]) (*grpc.ClientConn, error)
ClientConn is a function to create grpc client connection
func NewClientConn ¶
func NewClientConn() ClientConn[etcdresolver.ResolveMeta]
NewClientConn is a function to create a cc instance
func (*ClientConn[T]) WithDialTimeout ¶
func (c *ClientConn[T]) WithDialTimeout(t time.Duration) infra.ClientOptions[T]
func (*ClientConn[T]) WithGrpcDialOptions ¶
func (c *ClientConn[T]) WithGrpcDialOptions(opts ...grpc.DialOption) infra.ClientOptions[T]
func (*ClientConn[T]) WithNamespace ¶
func (*ClientConn[T]) WithNamespace(ns string) infra.ClientOptions[etcdresolver.ResolveMeta]
func (*ClientConn[T]) WithOrg ¶
func (*ClientConn[T]) WithOrg(id string) infra.ClientOptions[etcdresolver.ResolveMeta]
func (*ClientConn[T]) WithRegion ¶
func (*ClientConn[T]) WithRegion(region string) infra.ClientOptions[etcdresolver.ResolveMeta]
func (*ClientConn[T]) WithServiceResolver ¶
func (c *ClientConn[T]) WithServiceResolver(r resolver.Resolver) infra.ClientOptions[T]
type Server ¶
type Server[T interface { WithMeta(register.NodeMeta) T }] func(register func(srv *grpc.Server), opts ...infra.Option[T]) *infra.Srv[T]
Server is a function to build grpc service
func (*Server[T]) WithGrpcServerOptions ¶
func (s *Server[T]) WithGrpcServerOptions(opts ...grpc.ServerOption) infra.Option[T]
func (*Server[T]) WithHttpServer ¶
func (*Server[T]) WithNamespace ¶
func (*Server[T]) WithRegion ¶
customized options
Click to show internal directories.
Click to hide internal directories.