client

package
v0.0.0-...-7cc72ef Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Timeout = 3 * time.Second // 默认超时时间
)

Variables

This section is empty.

Functions

func GetConn

func GetConn() (*kafukago.Conn, error)

GetConn conn不能保证并发安全,仅可作为单线程的长连接使用。

func GetNewReader

func GetNewReader(topic string, groupID string) *kafukago.Reader

GetNewReader 创建一个reader示例,reader是并发安全的

func GetNewWriter

func GetNewWriter(topic string, async bool) (*kafukago.Writer, error)

GetNewWriter 创建一个writer示例,writer是并发安全的。

func InitAcademicRPC

func InitAcademicRPC() (*academicservice.Client, error)

func InitClassroomRPC

func InitClassroomRPC() (*classroomservice.Client, error)

func InitCommonRPC

func InitCommonRPC() (*commonservice.Client, error)

func InitCourseRPC

func InitCourseRPC() (*courseservice.Client, error)

func InitLaunchScreenRPC

func InitLaunchScreenRPC() (*launchscreenservice.Client, error)

func InitLaunchScreenStreamRPC

func InitLaunchScreenStreamRPC() (*launchscreenservice.StreamClient, error)

func InitMySQL

func InitMySQL(tableName string) (db *gorm.DB, err error)

InitMySQL 通用初始化mysql函数,传入tableName指定表

func InitPaperRPC

func InitPaperRPC() (*paperservice.Client, error)

func InitUserRPC

func InitUserRPC() (*userservice.Client, error)

func InitVersionRPC

func InitVersionRPC() (*versionservice.Client, error)

func IsESConnected

func IsESConnected(es *elasticsearch.Client) bool

func NewEsClient

func NewEsClient() (*elasticsearch.Client, error)

func NewRedisClient

func NewRedisClient(db int) (*redis.Client, error)

NewRedisClient 传入dbName,具体参考 constants 包

Types

This section is empty.

Jump to

Keyboard shortcuts

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