base

package
v0.0.0-...-03dd0ed Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BASEPATH   = config.BASEPATH
	TCPSERVER  = config.TCPSERVER
	TIMEFILE   = config.TIMEFILE
	SWITCHFILE = config.SWITCHFILE
)

Variables

View Source
var (
	DeviceLink   *cache.Cache
	DeviceAlias  *cache.Cache
	ButtonStatus *cache.Cache
)

Functions

This section is empty.

Types

type Base

type Base struct {
}

func (*Base) Args

func (ctx *Base) Args() string

*

  • 获取 Http 服务端口

func (*Base) CheckDir

func (ctx *Base) CheckDir(path string) bool

*

  • 检查文件夹是否存在

func (*Base) CheckFile

func (ctx *Base) CheckFile(path string) bool

*

  • 检查文件是否存在

func (*Base) CreateDir

func (ctx *Base) CreateDir(path string) bool

*

  • 新建文件夹

func (*Base) CreateFile

func (ctx *Base) CreateFile(path string) bool

*

  • 新建文件

func (*Base) DelDir

func (ctx *Base) DelDir(path string) bool

*

  • 删除文件夹

func (*Base) DelFile

func (ctx *Base) DelFile(path string) bool

*

  • 删除文件

func (*Base) GetButtonAlias

func (ctx *Base) GetButtonAlias() string

*

  • 获取开关别名

func (*Base) GetButtonList

func (ctx *Base) GetButtonList() string

*

  • 获取在线设备(90秒内有心跳的设备)

func (*Base) GetButtonStatus

func (ctx *Base) GetButtonStatus() string

*

  • 获取开关状态

func (*Base) GetFileList

func (ctx *Base) GetFileList(path string) []os.FileInfo

*

  • 获取文件夹下文件列表

func (*Base) GoFail

func (ctx *Base) GoFail(data interface{}, info interface{}) gin.H

*

  • 失败返回模板

func (*Base) GoSuccess

func (ctx *Base) GoSuccess(data interface{}, info interface{}) gin.H

*

  • 成功返回

func (*Base) Init

func (ctx *Base) Init()

*

  • 系统启动初始化

func (*Base) InitDir

func (ctx *Base) InitDir(path string)

*

  • 初始化文件夹

func (*Base) InitFile

func (ctx *Base) InitFile(path string)

*

  • 初始化存储文件

func (*Base) NowTime

func (ctx *Base) NowTime() [3]string

*

  • 获取当前时间 ["23","05","40"]

func (*Base) ReadFile

func (ctx *Base) ReadFile(path string) string

*

  • 读取文件内容

func (*Base) RequestTCP

func (ctx *Base) RequestTCP(data string) bool

*

  • TCP连接并发送信息

func (*Base) WriteFile

func (ctx *Base) WriteFile(path string, info string) bool

*

  • 写入文件内容(快速)

Jump to

Keyboard shortcuts

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