datasource

package
v0.0.0-...-d5996f0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const MQURL = "amqp://seckilluser:seckilluser@127.0.0.1:5672/seckill"

连接信息 const MQURL = "amqp://seckilluser:seckilluser@172.31.96.59:5672/seckill"

Variables

This section is empty.

Functions

func DataToStructByTagSql

func DataToStructByTagSql(data map[string]string, obj interface{})

根据结构体中sql标签映射数据到结构体中并且转换类型

func GetResultRow

func GetResultRow(rows *sql.Rows) map[string]string

获取返回值,获取一条

func GetResultRows

func GetResultRows(rows *sql.Rows) map[int]map[string]string

获取所有

func NewMysqlConn

func NewMysqlConn() (db *sql.DB, err error)

创建mysql 连接

Types

type RabbitMQ

type RabbitMQ struct {

	// 队列名称
	QueueName string
	// 交换机名称
	Exchange string
	// bind Key 名称
	Key string
	// 连接信息
	MQUrl string
	sync.Mutex
	// contains filtered or unexported fields
}

func NewRabbitMQSimple

func NewRabbitMQSimple(queueName string) *RabbitMQ

简单模式下RabbitMQ实例

func (*RabbitMQ) ConsumeSimple

func (r *RabbitMQ) ConsumeSimple(orderService service.IOrderService, productService service.IProductService)

simple 模式下消费者

func (*RabbitMQ) Destroy

func (r *RabbitMQ) Destroy()

断开rabbitmq通信信道channel 和 连接connection

func (*RabbitMQ) PublishSimple

func (r *RabbitMQ) PublishSimple(message string) error

直接模式队列生产

Jump to

Keyboard shortcuts

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