storage

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HttpDownload

func HttpDownload(url string) (data []byte, code int, err error)

封装http协议,用于与外部业务数据交互的上传下载;

func NewRedis

func NewRedis(conf RedisConfig) *redis.ClusterClient

func RabFini

func RabFini()

func RabInit

func RabInit(host string, usr string, pass string, name string, logger *utils.Logger) (err error)

TODO pre-init multi rmq‘s channel TODO publish retry if fail

func RabPublish

func RabPublish(body []byte, retry int) (err error)

Types

type RedisConfig

type RedisConfig struct {
	Addrs        []string
	Password     string
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
	IdleTimeout  time.Duration
	DialTimeout  time.Duration
	PoolSize     int
}

redis

type S3Wrapper

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

func NewS3Wrapper

func NewS3Wrapper(endpoint string, access string, secret string) (sw *S3Wrapper, err error)

func (*S3Wrapper) S3Download

func (sw *S3Wrapper) S3Download(buck string, key string) (data []byte, err error)

func (*S3Wrapper) S3Upload

func (sw *S3Wrapper) S3Upload(buck string, key string, data []byte) (err error)

Jump to

Keyboard shortcuts

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