dao

package
Version: v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

db is sql *db

View Source
var Kafka = &Server{}
View Source
var Mem *cache.Cache

Functions

func InitDB

func InitDB()

func InitKafkaProducer

func InitKafkaProducer()

func InitMdb

func InitMdb()

初始化mongodb

func InitMemory

func InitMemory()

func InitRdb

func InitRdb()

初始化redis

Types

type KafkaConfig

type KafkaConfig struct {
	Brokers   []string `json:"brokers"`
	CertFile  string   `json:"cert_file"`
	KeyFile   string   `json:"key_file"`
	CaFile    string   `json:"ca_file"`
	VerifySsl bool     `json:"verify_ssl"`
}

type Server

type Server struct {
	SyncProducer  sarama.SyncProducer
	AsyncProducer sarama.AsyncProducer
}

func (*Server) PrepareMessage

func (s *Server) PrepareMessage(topic, message string) *sarama.ProducerMessage

func (*Server) SendSyncMsg

func (s *Server) SendSyncMsg(topic, message string) (partition int32, offset int64, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL