Documentation ¶
Index ¶
- Constants
- func LoadModel[T interface{}](modelCreator func(url, db, collection string, c cache.CacheConf) T, ...) T
- func RpcRouterMiddleware(next http.HandlerFunc) http.HandlerFunc
- type ContextMeta
- type MongoConf
- type RpcClientConn
- type RpcClientRouter
- func (r *RpcClientRouter[T]) AddRpcClient(ctx context.Context, KV *mvccpb.KeyValue)
- func (r *RpcClientRouter[T]) DeleteRpcClient(ctx context.Context, KV *mvccpb.KeyValue)
- func (r *RpcClientRouter[T]) GetEnvKey(env string) string
- func (r *RpcClientRouter[T]) Start(ctx context.Context, etcdCli *clientv3.Client)
- func (r *RpcClientRouter[T]) Stub(ctx context.Context) T
- type RpcServerKey
- type RpcStubCreator
- type StoreConf
Constants ¶
View Source
const (
CTX_META_ENV = "x-ms-env"
)
View Source
const CtxEtcdClient = "CTX_ETCD_CLIENT"
View Source
const (
CtxMeta key = "CTX_META"
)
Variables ¶
This section is empty.
Functions ¶
func RpcRouterMiddleware ¶
func RpcRouterMiddleware(next http.HandlerFunc) http.HandlerFunc
Types ¶
type ContextMeta ¶
type ContextMeta struct {
Env string
}
type RpcClientConn ¶
type RpcClientConn interface {
Conn() grpc.ClientConnInterface
}
type RpcClientRouter ¶
type RpcClientRouter[T interface{}] struct {
// contains filtered or unexported fields
}
func NewRpcClientRouter ¶
func NewRpcClientRouter[T interface{}](EtcdHosts []string, RpcKey string, creator func(cli RpcClientConn) T) *RpcClientRouter[T]
func (*RpcClientRouter[T]) AddRpcClient ¶
func (r *RpcClientRouter[T]) AddRpcClient(ctx context.Context, KV *mvccpb.KeyValue)
func (*RpcClientRouter[T]) DeleteRpcClient ¶
func (r *RpcClientRouter[T]) DeleteRpcClient(ctx context.Context, KV *mvccpb.KeyValue)
func (*RpcClientRouter[T]) GetEnvKey ¶
func (r *RpcClientRouter[T]) GetEnvKey(env string) string
func (*RpcClientRouter[T]) Start ¶
func (r *RpcClientRouter[T]) Start(ctx context.Context, etcdCli *clientv3.Client)
func (*RpcClientRouter[T]) Stub ¶
func (r *RpcClientRouter[T]) Stub(ctx context.Context) T
type RpcServerKey ¶
func NewRpcServerKey ¶
func NewRpcServerKey(from *mvccpb.KeyValue) (RpcServerKey, bool)
type RpcStubCreator ¶
type RpcStubCreator[T interface{}] func(cli RpcClientConn) T
Click to show internal directories.
Click to hide internal directories.