data

package
v0.0.0-...-fa05059 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet is data providers.

Functions

func InitTables

func InitTables(db *gorm.DB) error

func NewDB

func NewDB(c *conf.Data) (*gorm.DB, error)

NewDB initializes the database.

func NewLogger

func NewLogger() *zap.Logger

NewLogger 将日志输出到控制台

func NewRedis

func NewRedis(c *conf.Data) redis.Cmdable

NewRedis initializes Redis.

func NewSaramaClient

func NewSaramaClient(c *conf.Service) (sarama.Client, error)

NewSaramaClient 初始化一个新的 Sarama 客户端

func NewSyncProducer

func NewSyncProducer(client sarama.Client) (sarama.SyncProducer, error)

NewSyncProducer 初始化一个新的 Sarama 同步生产者

Types

type Data

type Data struct {
	// contains filtered or unexported fields
}

Data .

func NewData

func NewData(cs *conf.Service, db *gorm.DB, redis redis.Cmdable, logger log.Logger) (*Data, func(), error)

NewData .

Jump to

Keyboard shortcuts

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