Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/l1ghtn1ng/gowol
A go module to be able to turn your computer on using wake on lan
https://github.com/l1ghtn1ng/gowol
Last synced: about 1 month ago
JSON representation
A go module to be able to turn your computer on using wake on lan
- Host: GitHub
- URL: https://github.com/l1ghtn1ng/gowol
- Owner: L1ghtn1ng
- License: gpl-3.0
- Created: 2023-01-02T21:04:34.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-28T16:00:12.000Z (11 months ago)
- Last Synced: 2024-05-01T12:39:48.281Z (7 months ago)
- Language: Go
- Size: 37.1 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Go Report Card](https://goreportcard.com/badge/github.com/L1ghtn1ng/gowol)](https://goreportcard.com/report/github.com/L1ghtn1ng/gowol)
To install the Wake-on-LAN (WoL) module ("gowol"), you can use the go install command:
```go
go install github.com/L1ghtn1ng/gowol
```
This will compile and install the package and its dependencies to the $GOBIN directory.To use the package in your Go code, you can import it like this:
```go
import "github.com/L1ghtn1ng/gowol"
```
Then, you can use the SendMagicPacket function to send a WoL magic packet to the target device like this:
```go
err := gowol.SendMagicPacket("00:11:22:33:44:55", "")
if err != nil {
// Handle the error
}
```You will need to replace the macAddress argument with the MAC address of the target device in the format ``"00:11:22:33:44:55"``. The ipAddress argument is optional, and if it is not specified or is an empty string, the default value of ``255.255.255.255`` will be used. You can specify a custom IP broadcast address by passing it as the ipAddress argument.
To run the tests for the ``"gowol"`` package, you can use the go test command:
```go
go test github.com/L1ghtn1ng/gowol
```
This will run all the tests in the "gowol" package and print the results.