Documentation
¶
Index ¶
- Constants
- func GetConn() (*kafukago.Conn, error)
- func GetNewReader(topic string, groupID string) *kafukago.Reader
- func GetNewWriter(topic string, async bool) (*kafukago.Writer, error)
- func InitCartRPC() (*cartservice.Client, error)
- func InitCommodityRPC() (*commodityservice.Client, error)
- func InitCommodityStreamClientRPC() (*commodityservice.StreamClient, error)
- func InitMySQL() (db *gorm.DB, err error)
- func InitOrderRPC() (*orderservice.Client, error)
- func InitPaymentRPC() (*paymentservice.Client, error)
- func InitRedis(db int) (*redis.Client, error)
- func InitUserRPC() (*userservice.Client, error)
- func IsESConnected(es *elasticsearch.Client) bool
- func NewEsClient() (*elasticsearch.Client, error)
- func NewEsCommodityClient() (*elastic.Client, error)
- func NewRedisClient(db int) (*redis.Client, error)
Constants ¶
View Source
const (
Timeout = 3 * time.Second // 默认超时时间
)
Variables ¶
This section is empty.
Functions ¶
func GetNewReader ¶
GetNewReader 创建一个reader示例,reader是并发安全的
func GetNewWriter ¶
GetNewWriter 创建一个writer示例,writer是并发安全的。
func InitCartRPC ¶
func InitCartRPC() (*cartservice.Client, error)
func InitCommodityRPC ¶
func InitCommodityRPC() (*commodityservice.Client, error)
func InitCommodityStreamClientRPC ¶
func InitCommodityStreamClientRPC() (*commodityservice.StreamClient, error)
func InitOrderRPC ¶
func InitOrderRPC() (*orderservice.Client, error)
func InitPaymentRPC ¶
func InitPaymentRPC() (*paymentservice.Client, error)
func InitUserRPC ¶
func InitUserRPC() (*userservice.Client, error)
func IsESConnected ¶
func IsESConnected(es *elasticsearch.Client) bool
func NewEsClient ¶
func NewEsClient() (*elasticsearch.Client, error)
func NewEsCommodityClient ¶
func NewEsCommodityClient() (*elastic.Client, error)
func NewRedisClient ¶
NewRedisClient 传入dbName,具体参考 constants 包
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.