Documentation ¶
Index ¶
- Constants
- Variables
- func ComputePrefixKey() string
- func GetRpcConn(serviceName string) (*grpc.ClientConn, error)
- func GetServiceCommonClient() (proto_build.CommonServiceClient, error)
- func GetServiceGroupClient() (proto_build.GroupServiceClient, error)
- func GetServiceMessageClient() (proto_build.MessageServiceClient, error)
- func GetServiceUserClient() (proto_build.UserServiceClient, error)
- func NewClientV3(endPoints []string, timeOut uint64) *clientv3.Client
- type BasicService
- func (s *BasicService) AddSpan(c context.Context, funcName string, req interface{}, rsp interface{})
- func (s *BasicService) FailCommon(errorCode uint64, businessCode uint64, message string) *proto_build.CommonResponse
- func (s *BasicService) GetAddress() string
- func (s *BasicService) GetLoginUserId() uint64
- func (s *BasicService) GetName() string
- func (s *BasicService) GetTTL() int64
- func (s *BasicService) SuccessCommon() *proto_build.CommonResponse
- type Discovery
- func (d *Discovery) DeleteServer(serviceName string, server string)
- func (d *Discovery) GetServerList(serviceName string) []string
- func (d *Discovery) GetServiceServerList() map[string][]string
- func (d *Discovery) InitServerList() []string
- func (d *Discovery) PutServer(serviceName string, server string)
- func (d *Discovery) Watch()
- type JResolver
- type JResolverBuilder
- type Register
Constants ¶
View Source
const (
JScheme = "jim"
)
Variables ¶
View Source
var FormatMap = map[uint64]proto_build.IMAGE_FORMAT{ constant.ImageFormatJpg: proto_build.IMAGE_FORMAT_JPG, constant.ImageFormatGif: proto_build.IMAGE_FORMAT_GIF, constant.ImageFormatPng: proto_build.IMAGE_FORMAT_PNG, constant.ImageFormatBmp: proto_build.IMAGE_FORMAT_BMP, constant.ImageFormatOther: proto_build.IMAGE_FORMAT_OTHER, }
Functions ¶
func ComputePrefixKey ¶
func ComputePrefixKey() string
func GetRpcConn ¶
func GetRpcConn(serviceName string) (*grpc.ClientConn, error)
func GetServiceCommonClient ¶
func GetServiceCommonClient() (proto_build.CommonServiceClient, error)
func GetServiceGroupClient ¶
func GetServiceGroupClient() (proto_build.GroupServiceClient, error)
func GetServiceMessageClient ¶
func GetServiceMessageClient() (proto_build.MessageServiceClient, error)
func GetServiceUserClient ¶
func GetServiceUserClient() (proto_build.UserServiceClient, error)
Types ¶
type BasicService ¶
BasicService 基本服务类
func (*BasicService) AddSpan ¶
func (s *BasicService) AddSpan(c context.Context, funcName string, req interface{}, rsp interface{})
func (*BasicService) FailCommon ¶
func (s *BasicService) FailCommon(errorCode uint64, businessCode uint64, message string) *proto_build.CommonResponse
func (*BasicService) GetAddress ¶
func (s *BasicService) GetAddress() string
func (*BasicService) GetLoginUserId ¶
func (s *BasicService) GetLoginUserId() uint64
func (*BasicService) GetTTL ¶
func (s *BasicService) GetTTL() int64
func (*BasicService) SuccessCommon ¶
func (s *BasicService) SuccessCommon() *proto_build.CommonResponse
type Discovery ¶
type Discovery struct { Client *clientv3.Client ServiceServerListMap map[string][]string // contains filtered or unexported fields }
func NewServiceDiscovery ¶
func (*Discovery) DeleteServer ¶
func (*Discovery) GetServerList ¶
func (*Discovery) GetServiceServerList ¶
func (*Discovery) InitServerList ¶
type JResolver ¶
type JResolver struct {
// contains filtered or unexported fields
}
func (*JResolver) ResolveNow ¶
func (r *JResolver) ResolveNow(o resolver.ResolveNowOptions)
func (*JResolver) UpdateAddressStore ¶
func (r *JResolver) UpdateAddressStore()
type JResolverBuilder ¶
type JResolverBuilder struct {
// contains filtered or unexported fields
}
func NewJResolverBuilder ¶
func NewJResolverBuilder(client *clientv3.Client) *JResolverBuilder
func (*JResolverBuilder) Build ¶
func (b *JResolverBuilder) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error)
func (*JResolverBuilder) Scheme ¶
func (b *JResolverBuilder) Scheme() string
type Register ¶
type Register struct { Client *clientv3.Client AppName string Service BasicService ServiceLeaseIdMap map[BasicService]clientv3.LeaseID ServiceKeepAliveMap map[BasicService]<-chan *clientv3.LeaseKeepAliveResponse ServiceCloseMap map[BasicService]chan bool }
func NewServiceRegister ¶
func (*Register) CloseSrv ¶
func (r *Register) CloseSrv(srv BasicService)
func (*Register) RegisterService ¶
func (r *Register) RegisterService(srvList ...BasicService)
func (*Register) Stop ¶
func (r *Register) Stop(srv BasicService)
func (*Register) UnRegisterService ¶
func (r *Register) UnRegisterService(srv BasicService)
Click to show internal directories.
Click to hide internal directories.