wol

package
v1.10.8 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeLogin               = '0'
	TypeLoginResp           = '1'
	TypeSyncClientConfigure = '2'
	TypeReplyWakeUp         = '3'
	TypeShutDown            = '4'
)

Variables

This section is empty.

Functions

func AlterWOLClientConfigure

func AlterWOLClientConfigure(conf *wolconf.WOLServiceConfigure, logger *logrus.Logger, updateTimeOpt bool) error

func CheckWOLServiceConfigure

func CheckWOLServiceConfigure(conf *wolconf.WOLServiceConfigure) error

func ClientDisconnect

func ClientDisconnect()

func DeleteWOLDeviceListslice

func DeleteWOLDeviceListslice(a []wolconf.WOLDevice, deleteIndex int) []wolconf.WOLDevice

func ExecShutDown

func ExecShutDown(d *wolconf.WOLDevice) int

func GetClientState

func GetClientState() string

func GetClientStateMsg

func GetClientStateMsg() string

func GetDeviceStateDetail

func GetDeviceStateDetail(d *wolconf.WOLDevice) (state string, onlineMacList []string)

func GetWOLDeviceByKey

func GetWOLDeviceByKey(key string) *wolconf.WOLDevice

func GetWOLDeviceByMac

func GetWOLDeviceByMac(mac string) *wolconf.WOLDevice

func GetWOLDeviceList

func GetWOLDeviceList() []wolconf.WOLDevice

func GetWOLServiceConfigure

func GetWOLServiceConfigure() wolconf.WOLServiceConfigure

func Init

func Init(log *logrus.Logger)

func Pack

func Pack(msg interface{}) ([]byte, error)

func ReceiveMessageDecryptionFunc

func ReceiveMessageDecryptionFunc(messageBytes []byte) ([]byte, error)

receiveMessageDecryptionFunc 自定义接收消息解密函数

func ReceiveMsgFromWOLClient

func ReceiveMsgFromWOLClient(c *websocketcontroller.Controller, msgBytes []byte)

func SendMessage

func SendMessage(c *websocketcontroller.Controller, msg any) error

func SendMessageEncryptionFunc

func SendMessageEncryptionFunc(messageBytesPtr []byte) ([]byte, error)

func SyncClientConfigureToClient

func SyncClientConfigureToClient(d *wolconf.WOLDevice)

func WOLClientConfigureInit

func WOLClientConfigureInit(l *logrus.Logger)

func WOLClientConnected

func WOLClientConnected(c *websocketcontroller.Controller)

func WOLClientDisconnect

func WOLClientDisconnect(c *websocketcontroller.Controller)

func WOLClientInit

func WOLClientInit(logger *logrus.Logger, c *wolconf.WOLClientConfigure)

func WOLDeviceListAdd

func WOLDeviceListAdd(d *wolconf.WOLDevice) error

func WOLDeviceListAlter

func WOLDeviceListAlter(d *wolconf.WOLDevice) error

func WOLDeviceListDelete

func WOLDeviceListDelete(key string) error

func WOLDeviceListReplace

func WOLDeviceListReplace(key string, d *wolconf.WOLDevice) error

func WakeUpFinishedCallback

func WakeUpFinishedCallback(reply bool, macList []string, broadcastIps []string, port, repeat int)

Types

type Login

type Login struct {
	wolconf.WOLClientConfigure
	ClientTimeStamp int64
}

type LoginResp

type LoginResp struct {
	Ret int //
	Msg string
}

服务器发送给客户端,登录认证反馈 ,ret 为0成功,其它失败

type Message

type Message = jsonMsg.Message

func UnPack

func UnPack(bytes []byte) (msg Message, err error)

type ReplyWakeUp

type ReplyWakeUp struct {
	MacList      []string
	BroadcastIPs []string
	Port         int
	Repeat       int
}

type ShutDown

type ShutDown struct {
}

type SyncClientConfigure

type SyncClientConfigure struct {
	wolconf.WOLClientConfigure
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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