Versions in this module Expand all Collapse all v1 v1.0.0 Dec 17, 2023 Changes in this version + const MODBUS_DT_BOOL + const MODBUS_DT_FLOAT + const MODBUS_DT_INT16 + const MODBUS_DT_INT32 + const MODBUS_DT_UINT16 + const MODBUS_DT_UINT32 + const MODBUS_ED_BIG + const MODBUS_ED_LITTLE + const MODBUS_FUNC_COIL_R + const MODBUS_FUNC_COIL_RW + const MODBUS_FUNC_REGISTER_R + const MODBUS_FUNC_REGISTER_RW + const REQUEST_FAIL + const REQUEST_QUERY_ERR + const REQUEST_RESPONSE_ERR + const REQUEST_SERVER_ERR + const REQUEST_SUCCESS + const REQUEST_TOKEN_OVERDUE + var MODBUS_FUNC = []string + func HttpDefault(ctx *gin.Context, msg string, code int, data interface{}) + func HttpFailure(ctx *gin.Context, msg string, code int, data interface{}) + func HttpSuccess(ctx *gin.Context, msg string, data interface{}) + func ModbusRtuGetData(result []byte, slave_id uint8, address uint16, endian string, ...) (err error) + func ModbusRtuReadByte(slave_id uint8, function string, address, quantity uint16) (result []byte) + func NewNullID() (primitive.ObjectID, error) + func NewShortID() string + func NewShortObjectID() (primitive.ObjectID, error) + func ParseToken(jwtKey []byte, tokenString string) (*jwt.Token, int64, interface{}, error) + func ReleaseToken(jwtKey []byte, expire int64, info interface{}) (token string, err error) + type BSON bson.M + type Claims struct + Info interface{} + Timer int64 + type HTTPQUERY map[string]string + type HTTPRESPONSE struct + Code int + Data interface{} + Msg string + type HttpClient struct + Config HttpClientConfig + Instance *resty.Client + func NewHttpClient(config HttpClientConfig) (http_client HttpClient) + func (http_client *HttpClient) DELETE(url string, query HTTPQUERY) (response HTTPRESPONSE, err error) + func (http_client *HttpClient) GET(url string, query HTTPQUERY) (response HTTPRESPONSE, err error) + func (http_client *HttpClient) POST(url string, query HTTPQUERY, body interface{}) (response HTTPRESPONSE, err error) + func (http_client *HttpClient) PROXY(ctx *gin.Context, url string) + type HttpClientConfig struct + BaseUrl string + type HttpServer struct + Config HttpServerConfig + Router *gin.Engine + func NewHttpServer(config HttpServerConfig) (http_server HttpServer) + func (http_server *HttpServer) Running() (err error) + type HttpServerConfig struct + HtmlPath string + Mode string + Url string + type Influx struct + Client influxdb2.Client + Config InfluxConfig + func NewInflux(config InfluxConfig) (influx Influx) + func (influx *Influx) DeleteByMeasurement(bucket string, measurement string) (err error) + func (influx *Influx) DeleteByTag(bucket string, measurement string, tag_key, tag_value string) (err error) + func (influx *Influx) Ping(time_sec int) (result bool, err error) + func (influx *Influx) Query(flux_code string) (query_results []map[string]interface{}, err error) + type InfluxBatch struct + Points []*write.Point + WriteApi api.WriteAPIBlocking + func NewInfluxBatch(influx *Influx, bucket string) (batch InfluxBatch) + func (batch *InfluxBatch) AddPoint(measurement string, tags map[string]string, fields map[string]interface{}, ...) + func (batch *InfluxBatch) Write() (err error) + type InfluxConfig struct + Org string + Token string + Url string + type JavaScriptResult goja.Value + type Javascript struct + Client *goja.Runtime + func NewJavascript() (js Javascript) + func (js *Javascript) Function(func_name, code string, func_params ...interface{}) (result JavaScriptResult, err error) + type ModbusPoint struct + Address uint16 + DataType string + Function string + func (modbus_point ModbusPoint) Value() *float64 + type Mongo struct + Client *_mongo.Client + Config MongoConfig + Database *_mongo.Database + func NewMongo(config MongoConfig) (mongo Mongo) + func (mongo *Mongo) Connect() (err error) + func (mongo *Mongo) CountDocuments(collection string, filter interface{}) (count int64, err error) + func (mongo *Mongo) CreateCollection(coll string) (err error) + func (mongo *Mongo) DeleteMany(collection string, filter interface{}) (result *_mongo.DeleteResult, err error) + func (mongo *Mongo) DeleteOne(collection string, filter interface{}) (result *_mongo.DeleteResult, err error) + func (mongo *Mongo) Disconnect() (err error) + func (mongo *Mongo) DropCollection(coll string) (err error) + func (mongo *Mongo) FetchList(database string, filter BSON) (tables []map[string]interface{}, err error) + func (mongo *Mongo) FindAll(collection string, filter map[string]interface{}, tables interface{}) (err error) + func (mongo *Mongo) FindAll2(collection string, filter map[string]interface{}, tables interface{}) (err error) + func (mongo *Mongo) FindMany(collection string, filter map[string]interface{}, tables interface{}, ...) (err error) + func (mongo *Mongo) FindOne(collection string, filter map[string]interface{}, tables interface{}) (err error) + func (mongo *Mongo) InsertMany(collection string, tables []map[string]interface{}) (result *_mongo.InsertManyResult, err error) + func (mongo *Mongo) InsertOne(collection string, table interface{}) (result *_mongo.InsertOneResult, err error) + func (mongo *Mongo) ListCollectionNames() (result []string, err error) + func (mongo *Mongo) Ping(timeOut int) (err error) + func (mongo *Mongo) ResetOne(collection string, filter interface{}, update interface{}) (result *_mongo.UpdateResult, err error) + func (mongo *Mongo) TableCreate(database string, table any) (err error) + func (mongo *Mongo) TableDelete(database string, objectid primitive.ObjectID) (err error) + func (mongo *Mongo) TableExist(database string, filter BSON) (table map[string]interface{}, result bool) + func (mongo *Mongo) TableFind(database string, filter BSON, table any) (result bool) + func (mongo *Mongo) UpdateMany(collection string, filter interface{}, update interface{}) (result *_mongo.UpdateResult, err error) + func (mongo *Mongo) UpdateOne(collection string, filter interface{}, update interface{}) (result *_mongo.UpdateResult, err error) + type MongoConfig struct + Database string + Password string + Url string + Username string + type NsqClient struct + Client *_nsq.Producer + Config NsqConfig + func NewNsqClient(config NsqConfig) (nsqClient NsqClient) + func (nsq *NsqClient) Connect() (err error) + func (nsq *NsqClient) Publish(topic string, message string) (err error) + type NsqConfig struct + Channel string + Url string + type NsqServer struct + Client *_nsq.Consumer + Config NsqConfig + func NewNsqServer(config NsqConfig) (nsqServer NsqServer) + func (nsq *NsqServer) Subscribe(topic string, handle func(string)) (err error) + type Program struct + Isrun bool + Switch bool + func (program *Program) Exiting(timeout int) (result bool) + func (program *Program) GetLog(log_file_path string, row int) (contents []string, err error) + func (program *Program) GetRestartCount() int64 + func (program *Program) GetStatename() string + func (program *Program) GetStatus() map[string]interface{} + func (program *Program) Runing(work_dir string, command string, log_file_path string) + type ProgramExit struct + type ProgramStatus struct + type TcpConfig struct + Ip string + Port int + type TcpMessageCallback func(clientid *string, message []byte) + type TcpServer struct + Clients map[string]*TcpServerClient + Config TcpConfig + Listener net.Listener + MessageCallback TcpMessageCallback + func NewTcpServer(config TcpConfig, message_callback TcpMessageCallback) (tcp_server TcpServer) + func (tcp_server *TcpServer) Exist(clientid string) *TcpServerClient + func (tcp_server *TcpServer) Listen() (err error) + func (tcp_server *TcpServer) Read(clientid string, timeout int64) (data []byte, err error) + func (tcp_server *TcpServer) Send(clientid string, message []byte) (length int, err error) + type TcpServerClient struct + ActiveTime int64 + Addr string + Clientid string + Conn net.Conn