gze

package
v0.0.0-...-6cc5bcb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

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 LoadModel

func LoadModel[T interface{}](modelCreator func(url, db, collection string, c cache.CacheConf) T, c StoreConf, coll string) T

func RpcRouterMiddleware

func RpcRouterMiddleware(next http.HandlerFunc) http.HandlerFunc

Types

type ContextMeta

type ContextMeta struct {
	Env string
}

type MongoConf

type MongoConf struct {
	Host string
	DB   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

type RpcServerKey struct {
	Key string
	Env string
	ID  string
}

func NewRpcServerKey

func NewRpcServerKey(from *mvccpb.KeyValue) (RpcServerKey, bool)

type RpcStubCreator

type RpcStubCreator[T interface{}] func(cli RpcClientConn) T

type StoreConf

type StoreConf struct {
	Redis []cache.NodeConf
	Mongo MongoConf
}

Jump to

Keyboard shortcuts

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