dbHelper

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HttpGet

func HttpGet(url string, queryBody string) string

静态方法

func HttpPost

func HttpPost(url string, queryBody string) (string, error)

func HttpPostFormDataWithHeader

func HttpPostFormDataWithHeader(url string, queryBody string, headers map[string]string) (string, error)

func HttpPostWithHeader

func HttpPostWithHeader(url string, queryBody string, headers map[string]string) (string, error)

func NewTlsConfig

func NewTlsConfig(sslPath string) *tls.Config

func UploadFile

func UploadFile(url string, headers map[string]string, bodyParams map[string]string, fileName string) ([]byte, error)

Types

type FileMonitorHelper

type FileMonitorHelper struct {
	Directory         string
	FilenameExtension string
	// contains filtered or unexported fields
}

func FileMonitorInitial

func FileMonitorInitial(Directory string, FilenameExtension string, cron string) *FileMonitorHelper

func (*FileMonitorHelper) Initial

func (the *FileMonitorHelper) Initial()

func (*FileMonitorHelper) Subscribe

func (the *FileMonitorHelper) Subscribe(task func())

type HttpHelper

type HttpHelper struct {
	Url   string
	Token string
	// contains filtered or unexported fields
}

func (*HttpHelper) HttpGet

func (the *HttpHelper) HttpGet(queryBody string) string

func (*HttpHelper) Initial

func (the *HttpHelper) Initial()

func (*HttpHelper) Publish

func (the *HttpHelper) Publish(messageBytes []byte) (string, error)

type InfluxDBHelper

type InfluxDBHelper struct {
	Url    string
	Token  string
	Bucket string
	Org    string
	// contains filtered or unexported fields
}

func (*InfluxDBHelper) Close

func (the *InfluxDBHelper) Close()

func (*InfluxDBHelper) GetClient

func (the *InfluxDBHelper) GetClient() influxdb2.Client

func (*InfluxDBHelper) Initial

func (the *InfluxDBHelper) Initial()

func (*InfluxDBHelper) Query

func (the *InfluxDBHelper) Query() map[string]time.Time

func (*InfluxDBHelper) QueryByOfflineGap

func (the *InfluxDBHelper) QueryByOfflineGap(measurement string, offlineGap string) map[string]time.Time

func (*InfluxDBHelper) Write

func (the *InfluxDBHelper) Write()

type MqttHelper

type MqttHelper struct {
	Host     string
	Port     int
	ClientId string
	UserName string
	Password string
	// contains filtered or unexported fields
}

func MqttInitial

func MqttInitial(host string, port int, clientId string, userName string, password string, isSSL bool, caPtah ...string) *MqttHelper

func (*MqttHelper) Initial

func (the *MqttHelper) Initial()

func (*MqttHelper) InitialWithSSL

func (the *MqttHelper) InitialWithSSL(caPath string)

func (*MqttHelper) Publish

func (the *MqttHelper) Publish(topic string, messageBytes []byte)

func (*MqttHelper) Subscribe

func (the *MqttHelper) Subscribe(topic string, myCallback func(topic string, callMsg string))

type UdpHelper

type UdpHelper struct {
	Host string
	Port int
	// contains filtered or unexported fields
}

func (*UdpHelper) Close

func (the *UdpHelper) Close()

func (*UdpHelper) Initial

func (the *UdpHelper) Initial()

func (*UdpHelper) Publish

func (the *UdpHelper) Publish(messageBytes []byte)

Jump to

Keyboard shortcuts

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