Documentation
¶
Index ¶
- Variables
- func InitHttpApiModule(name string, conf *config.HttpApiConfig, makeMsg httpapi.MakeMessageHandler, ...) error
- func InitMongo(uri string, initOptions ...MongoInitOption) error
- func InitRedis(conf *config.RedisConfig) (err error)
- func InitRpcModule(name string, handlerFunc rpc.RpcHandler, conf *config.RpcConfig) error
- func RpcHandlerFunc(rc *rpc.RpcContext)
- type HttpApiModule
- type MongoImpl
- type MongoInitOption
- type RpcModule
- func (m *RpcModule) AsyncCallWithoutResp(serviceName string, req proto.Message, md ...*rpc.Meta) (err error)
- func (m *RpcModule) Call(serviceName string, cb rpc.RPCReq) (proto.Message, error)
- func (m *RpcModule) Destroy()
- func (m *RpcModule) Name() string
- func (m *RpcModule) OnInit() error
- func (m *RpcModule) RegisterService(serviceName string, ...) error
- func (m *RpcModule) RegisterServiceOnlyOne(serviceName string, ...) error
- func (m *RpcModule) Run()
- func (m *RpcModule) SyncCall(serviceName string, req, resp proto.Message, timeout time.Duration, ...) (err error)
- func (m *RpcModule) UnregisterService(serviceName string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // 全局默认,用户层pb消息解码 MsgUnmarshaler = proto.UnmarshalOptions{ Merge: false, AllowPartial: true, DiscardUnknown: false, RecursionLimit: 100, NoLazyDecoding: true, } // 全局默认,用户层pb消息编码 MsgMarshaler = proto.MarshalOptions{ AllowPartial: true, Deterministic: false, } )
View Source
var Redis *rdb.RedisImpl
Functions ¶
func InitHttpApiModule ¶
func InitHttpApiModule(name string, conf *config.HttpApiConfig, makeMsg httpapi.MakeMessageHandler, middlewares []gin.HandlerFunc) error
func InitMongo ¶
func InitMongo(uri string, initOptions ...MongoInitOption) error
func InitRedis ¶
func InitRedis(conf *config.RedisConfig) (err error)
func InitRpcModule ¶
Types ¶
type HttpApiModule ¶
type HttpApiModule struct {
// contains filtered or unexported fields
}
var HttpApi *HttpApiModule
func (*HttpApiModule) Destroy ¶
func (s *HttpApiModule) Destroy()
func (*HttpApiModule) Name ¶
func (s *HttpApiModule) Name() string
func (*HttpApiModule) OnInit ¶
func (s *HttpApiModule) OnInit() error
func (*HttpApiModule) Run ¶
func (s *HttpApiModule) Run()
type MongoImpl ¶
type MongoImpl struct {
// contains filtered or unexported fields
}
var Mongo *MongoImpl
func (*MongoImpl) GetActiveConnections ¶
func (*MongoImpl) ReadClient ¶
func (*MongoImpl) WriteClient ¶
type MongoInitOption ¶
type RpcModule ¶
type RpcModule struct {
// contains filtered or unexported fields
}
var (
Rpc *RpcModule
)
func (*RpcModule) AsyncCallWithoutResp ¶
func (*RpcModule) RegisterService ¶
func (*RpcModule) RegisterServiceOnlyOne ¶
func (*RpcModule) UnregisterService ¶
Click to show internal directories.
Click to hide internal directories.