Compare commits
62 Commits
v0.0.3
...
a9ef386883
| Author | SHA1 | Date | |
|---|---|---|---|
| a9ef386883 | |||
| 24cfda82d7 | |||
| 655af5c446 | |||
| b363a20a9d | |||
| f5d326124d | |||
| cb8fb2c0bc | |||
| 38119435f1 | |||
| 034a69c12f | |||
| 70006a3d7b | |||
| 8aada58d64 | |||
| 5d231207cd | |||
| 584d9426e6 | |||
| 7a772a5458 | |||
| 079c733b60 | |||
| e24a8e9088 | |||
| 0b5d777077 | |||
| 75327286ef | |||
| 099b0cd849 | |||
| c9c00e0072 | |||
| b2ffb2062a | |||
| 2e8c825fff | |||
| 7b870950d1 | |||
| 3a877c41a4 | |||
| 04fb390bee | |||
| 50b17d3266 | |||
| 763d408405 | |||
| fbb7cd9bc1 | |||
| f1b7f70313 | |||
| 552f19676b | |||
| 9d58ea0ae7 | |||
| 76875db7ea | |||
| be5bdc625b | |||
| 0d0db949af | |||
| 0d164aef3d | |||
| 28610d9ebb | |||
| dff34b484d | |||
| 2ea9f99db6 | |||
| 44dc5f8e47 | |||
| 4d35912466 | |||
| ef29b9bee4 | |||
| e198b769f9 | |||
| ef4bad94b5 | |||
| 8cf2b47733 | |||
| f20fdcb161 | |||
| eeba9b2964 | |||
| d7057e3f9c | |||
| 80a5867d6b | |||
| f001dd6079 | |||
| b87586ef15 | |||
| 295892c8a8 | |||
| 1492db7566 | |||
| e7de7bd7bb | |||
| 7b849a3fc7 | |||
| 21d4964207 | |||
| 604ea57c5f | |||
| b15cbb6349 | |||
| 843e369bab | |||
| eec7a3db48 | |||
| c23201e18c | |||
| 4bc6eb9d41 | |||
| 2a59e74a2c | |||
| df743cca96 |
14
README.md
14
README.md
@@ -12,9 +12,10 @@
|
|||||||
### Features
|
### Features
|
||||||
|
|
||||||
- Notification relay
|
- Notification relay
|
||||||
- Notificstion transliteration
|
- Notification transliteration
|
||||||
|
- Call Notifications (ModemManager)
|
||||||
- Music control
|
- Music control
|
||||||
- Get info from watch (HRM, Battery level, Firmware version)
|
- Get info from watch (HRM, Battery level, Firmware version, Motion)
|
||||||
- Set current time
|
- Set current time
|
||||||
- Control socket
|
- Control socket
|
||||||
- Firmware upgrades
|
- Firmware upgrades
|
||||||
@@ -28,7 +29,7 @@ This daemon creates a UNIX socket at `/tmp/itd/socket`. It allows you to directl
|
|||||||
The socket accepts JSON requests. For example, sending a notification looks like this:
|
The socket accepts JSON requests. For example, sending a notification looks like this:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{"type": "notify", "data": {"title": "title1", "body": "body1"}}
|
{"type": 5, "data": {"title": "title1", "body": "body1"}}
|
||||||
```
|
```
|
||||||
|
|
||||||
It will return a JSON response. A response can have 3 fields: `error`, `msg`, and `value`. Error is a boolean that signals whether an error was returned. If error is true, the msg field will contain the error. Value can contain any data and depends on what the request was.
|
It will return a JSON response. A response can have 3 fields: `error`, `msg`, and `value`. Error is a boolean that signals whether an error was returned. If error is true, the msg field will contain the error. Value can contain any data and depends on what the request was.
|
||||||
@@ -82,10 +83,10 @@ This is the `itctl` usage screen:
|
|||||||
Control the itd daemon for InfiniTime smartwatches
|
Control the itd daemon for InfiniTime smartwatches
|
||||||
|
|
||||||
Usage:
|
Usage:
|
||||||
|
itctl [flags]
|
||||||
itctl [command]
|
itctl [command]
|
||||||
|
|
||||||
Available Commands:
|
Available Commands:
|
||||||
completion generate the autocompletion script for the specified shell
|
|
||||||
firmware Manage InfiniTime firmware
|
firmware Manage InfiniTime firmware
|
||||||
get Get information from InfiniTime
|
get Get information from InfiniTime
|
||||||
help Help about any command
|
help Help about any command
|
||||||
@@ -93,7 +94,8 @@ Available Commands:
|
|||||||
set Set information on InfiniTime
|
set Set information on InfiniTime
|
||||||
|
|
||||||
Flags:
|
Flags:
|
||||||
-h, --help help for itctl
|
-h, --help help for itctl
|
||||||
|
-s, --socket-path string Path to itd socket
|
||||||
|
|
||||||
Use "itctl [command] --help" for more information about a command.
|
Use "itctl [command] --help" for more information about a command.
|
||||||
```
|
```
|
||||||
@@ -175,7 +177,7 @@ To cross compile, simply set the go environment variables. For example, for Pine
|
|||||||
make GOOS=linux GOARCH=arm64
|
make GOOS=linux GOARCH=arm64
|
||||||
```
|
```
|
||||||
|
|
||||||
This will compile `itd` and `itctl` for Linux aarch64 which is what runs on the PinePhone. This daemon only runs on Linux due to the library's dependencies (`dbus`, `bluez`, and `playerctl` specifically).
|
This will compile `itd` and `itctl` for Linux aarch64 which is what runs on the PinePhone. This daemon only runs on Linux due to the library's dependencies (`dbus`, and `bluez` specifically).
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
133
api/client.go
Normal file
133
api/client.go
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
package api
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bufio"
|
||||||
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
|
"net"
|
||||||
|
|
||||||
|
"github.com/mitchellh/mapstructure"
|
||||||
|
"go.arsenm.dev/infinitime"
|
||||||
|
"go.arsenm.dev/itd/internal/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Default socket address
|
||||||
|
const DefaultAddr = "/tmp/itd/socket"
|
||||||
|
|
||||||
|
// Client is the socket API client
|
||||||
|
type Client struct {
|
||||||
|
conn net.Conn
|
||||||
|
respCh chan types.Response
|
||||||
|
heartRateCh chan types.Response
|
||||||
|
battLevelCh chan types.Response
|
||||||
|
stepCountCh chan types.Response
|
||||||
|
motionCh chan types.Response
|
||||||
|
dfuProgressCh chan types.Response
|
||||||
|
}
|
||||||
|
|
||||||
|
// New creates a new client and sets it up
|
||||||
|
func New(addr string) (*Client, error) {
|
||||||
|
conn, err := net.Dial("unix", addr)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
out := &Client{
|
||||||
|
conn: conn,
|
||||||
|
respCh: make(chan types.Response, 5),
|
||||||
|
}
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
scanner := bufio.NewScanner(conn)
|
||||||
|
for scanner.Scan() {
|
||||||
|
var res types.Response
|
||||||
|
err = json.Unmarshal(scanner.Bytes(), &res)
|
||||||
|
if err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
out.handleResp(res)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
return out, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Client) Close() error {
|
||||||
|
err := c.conn.Close()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
close(c.respCh)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// request sends a request to itd and waits for and returns the response
|
||||||
|
func (c *Client) request(req types.Request) (types.Response, error) {
|
||||||
|
// Encode request into connection
|
||||||
|
err := json.NewEncoder(c.conn).Encode(req)
|
||||||
|
if err != nil {
|
||||||
|
return types.Response{}, err
|
||||||
|
}
|
||||||
|
|
||||||
|
res := <-c.respCh
|
||||||
|
|
||||||
|
if res.Error {
|
||||||
|
return res, errors.New(res.Message)
|
||||||
|
}
|
||||||
|
|
||||||
|
return res, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// requestNoRes sends a request to itd and does not wait for the response
|
||||||
|
func (c *Client) requestNoRes(req types.Request) error {
|
||||||
|
// Encode request into connection
|
||||||
|
err := json.NewEncoder(c.conn).Encode(req)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// handleResp handles the received response as needed
|
||||||
|
func (c *Client) handleResp(res types.Response) error {
|
||||||
|
switch res.Type {
|
||||||
|
case types.ReqTypeWatchHeartRate:
|
||||||
|
c.heartRateCh <- res
|
||||||
|
case types.ReqTypeWatchBattLevel:
|
||||||
|
c.battLevelCh <- res
|
||||||
|
case types.ReqTypeWatchStepCount:
|
||||||
|
c.stepCountCh <- res
|
||||||
|
case types.ReqTypeWatchMotion:
|
||||||
|
c.motionCh <- res
|
||||||
|
case types.ReqTypeFwUpgrade:
|
||||||
|
c.dfuProgressCh <- res
|
||||||
|
default:
|
||||||
|
c.respCh <- res
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func decodeUint8(val interface{}) uint8 {
|
||||||
|
return uint8(val.(float64))
|
||||||
|
}
|
||||||
|
|
||||||
|
func decodeUint32(val interface{}) uint32 {
|
||||||
|
return uint32(val.(float64))
|
||||||
|
}
|
||||||
|
|
||||||
|
func decodeMotion(val interface{}) (infinitime.MotionValues, error) {
|
||||||
|
out := infinitime.MotionValues{}
|
||||||
|
err := mapstructure.Decode(val, &out)
|
||||||
|
if err != nil {
|
||||||
|
return out, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func decodeDFUProgress(val interface{}) (DFUProgress, error) {
|
||||||
|
out := DFUProgress{}
|
||||||
|
err := mapstructure.Decode(val, &out)
|
||||||
|
if err != nil {
|
||||||
|
return out, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
96
api/fs.go
Normal file
96
api/fs.go
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
package api
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/mitchellh/mapstructure"
|
||||||
|
"go.arsenm.dev/itd/internal/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (c *Client) Rename(old, new string) error {
|
||||||
|
_, err := c.request(types.Request{
|
||||||
|
Type: types.ReqTypeFS,
|
||||||
|
Data: types.ReqDataFS{
|
||||||
|
Type: types.FSTypeMove,
|
||||||
|
Files: []string{old, new},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Client) Remove(paths ...string) error {
|
||||||
|
_, err := c.request(types.Request{
|
||||||
|
Type: types.ReqTypeFS,
|
||||||
|
Data: types.ReqDataFS{
|
||||||
|
Type: types.FSTypeDelete,
|
||||||
|
Files: paths,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Client) Mkdir(paths ...string) error {
|
||||||
|
_, err := c.request(types.Request{
|
||||||
|
Type: types.ReqTypeFS,
|
||||||
|
Data: types.ReqDataFS{
|
||||||
|
Type: types.FSTypeMkdir,
|
||||||
|
Files: paths,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Client) ReadDir(path string) ([]types.FileInfo, error) {
|
||||||
|
res, err := c.request(types.Request{
|
||||||
|
Type: types.ReqTypeFS,
|
||||||
|
Data: types.ReqDataFS{
|
||||||
|
Type: types.FSTypeList,
|
||||||
|
Files: []string{path},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
var out []types.FileInfo
|
||||||
|
err = mapstructure.Decode(res.Value, &out)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Client) ReadFile(path string) (string, error) {
|
||||||
|
res, err := c.request(types.Request{
|
||||||
|
Type: types.ReqTypeFS,
|
||||||
|
Data: types.ReqDataFS{
|
||||||
|
Type: types.FSTypeRead,
|
||||||
|
Files: []string{path},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
return res.Value.(string), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Client) WriteFile(path, data string) error {
|
||||||
|
_, err := c.request(types.Request{
|
||||||
|
Type: types.ReqTypeFS,
|
||||||
|
Data: types.ReqDataFS{
|
||||||
|
Type: types.FSTypeWrite,
|
||||||
|
Files: []string{path},
|
||||||
|
Data: data,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
209
api/info.go
Normal file
209
api/info.go
Normal file
@@ -0,0 +1,209 @@
|
|||||||
|
package api
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/mitchellh/mapstructure"
|
||||||
|
"go.arsenm.dev/infinitime"
|
||||||
|
"go.arsenm.dev/itd/internal/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Address gets the bluetooth address of the connected device
|
||||||
|
func (c *Client) Address() (string, error) {
|
||||||
|
res, err := c.request(types.Request{
|
||||||
|
Type: types.ReqTypeBtAddress,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
return res.Value.(string), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Version gets the firmware version of the connected device
|
||||||
|
func (c *Client) Version() (string, error) {
|
||||||
|
res, err := c.request(types.Request{
|
||||||
|
Type: types.ReqTypeFwVersion,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
return res.Value.(string), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// BatteryLevel gets the battery level of the connected device
|
||||||
|
func (c *Client) BatteryLevel() (uint8, error) {
|
||||||
|
res, err := c.request(types.Request{
|
||||||
|
Type: types.ReqTypeBattLevel,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return uint8(res.Value.(float64)), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// WatchBatteryLevel returns a channel which will contain
|
||||||
|
// new battery level values as they update. Do not use after
|
||||||
|
// calling cancellation function
|
||||||
|
func (c *Client) WatchBatteryLevel() (<-chan uint8, func(), error) {
|
||||||
|
c.battLevelCh = make(chan types.Response, 2)
|
||||||
|
err := c.requestNoRes(types.Request{
|
||||||
|
Type: types.ReqTypeWatchBattLevel,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil, err
|
||||||
|
}
|
||||||
|
res := <-c.battLevelCh
|
||||||
|
done, cancel := c.cancelFn(res.ID, c.battLevelCh)
|
||||||
|
out := make(chan uint8, 2)
|
||||||
|
go func() {
|
||||||
|
for res := range c.battLevelCh {
|
||||||
|
select {
|
||||||
|
case <-done:
|
||||||
|
return
|
||||||
|
default:
|
||||||
|
out <- decodeUint8(res.Value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
return out, cancel, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// HeartRate gets the heart rate from the connected device
|
||||||
|
func (c *Client) HeartRate() (uint8, error) {
|
||||||
|
res, err := c.request(types.Request{
|
||||||
|
Type: types.ReqTypeHeartRate,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return decodeUint8(res.Value), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// WatchHeartRate returns a channel which will contain
|
||||||
|
// new heart rate values as they update. Do not use after
|
||||||
|
// calling cancellation function
|
||||||
|
func (c *Client) WatchHeartRate() (<-chan uint8, func(), error) {
|
||||||
|
c.heartRateCh = make(chan types.Response, 2)
|
||||||
|
err := c.requestNoRes(types.Request{
|
||||||
|
Type: types.ReqTypeWatchHeartRate,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil, err
|
||||||
|
}
|
||||||
|
res := <-c.heartRateCh
|
||||||
|
done, cancel := c.cancelFn(res.ID, c.heartRateCh)
|
||||||
|
out := make(chan uint8, 2)
|
||||||
|
go func() {
|
||||||
|
for res := range c.heartRateCh {
|
||||||
|
select {
|
||||||
|
case <-done:
|
||||||
|
return
|
||||||
|
default:
|
||||||
|
out <- decodeUint8(res.Value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
return out, cancel, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// cancelFn generates a cancellation function for the given
|
||||||
|
// request type and channel
|
||||||
|
func (c *Client) cancelFn(reqID string, ch chan types.Response) (chan struct{}, func()) {
|
||||||
|
done := make(chan struct{}, 1)
|
||||||
|
return done, func() {
|
||||||
|
done <- struct{}{}
|
||||||
|
close(ch)
|
||||||
|
c.requestNoRes(types.Request{
|
||||||
|
Type: types.ReqTypeCancel,
|
||||||
|
Data: reqID,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// StepCount gets the step count from the connected device
|
||||||
|
func (c *Client) StepCount() (uint32, error) {
|
||||||
|
res, err := c.request(types.Request{
|
||||||
|
Type: types.ReqTypeStepCount,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return uint32(res.Value.(float64)), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// WatchStepCount returns a channel which will contain
|
||||||
|
// new step count values as they update. Do not use after
|
||||||
|
// calling cancellation function
|
||||||
|
func (c *Client) WatchStepCount() (<-chan uint32, func(), error) {
|
||||||
|
c.stepCountCh = make(chan types.Response, 2)
|
||||||
|
err := c.requestNoRes(types.Request{
|
||||||
|
Type: types.ReqTypeWatchStepCount,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil, err
|
||||||
|
}
|
||||||
|
res := <-c.stepCountCh
|
||||||
|
done, cancel := c.cancelFn(res.ID, c.stepCountCh)
|
||||||
|
out := make(chan uint32, 2)
|
||||||
|
go func() {
|
||||||
|
for res := range c.stepCountCh {
|
||||||
|
select {
|
||||||
|
case <-done:
|
||||||
|
return
|
||||||
|
default:
|
||||||
|
out <- decodeUint32(res.Value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
return out, cancel, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Motion gets the motion values from the connected device
|
||||||
|
func (c *Client) Motion() (infinitime.MotionValues, error) {
|
||||||
|
out := infinitime.MotionValues{}
|
||||||
|
res, err := c.request(types.Request{
|
||||||
|
Type: types.ReqTypeMotion,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return out, err
|
||||||
|
}
|
||||||
|
err = mapstructure.Decode(res.Value, &out)
|
||||||
|
if err != nil {
|
||||||
|
return out, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// WatchMotion returns a channel which will contain
|
||||||
|
// new motion values as they update. Do not use after
|
||||||
|
// calling cancellation function
|
||||||
|
func (c *Client) WatchMotion() (<-chan infinitime.MotionValues, func(), error) {
|
||||||
|
c.motionCh = make(chan types.Response, 5)
|
||||||
|
err := c.requestNoRes(types.Request{
|
||||||
|
Type: types.ReqTypeWatchMotion,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil, err
|
||||||
|
}
|
||||||
|
res := <-c.motionCh
|
||||||
|
done, cancel := c.cancelFn(res.ID, c.motionCh)
|
||||||
|
out := make(chan infinitime.MotionValues, 5)
|
||||||
|
go func() {
|
||||||
|
for res := range c.motionCh {
|
||||||
|
select {
|
||||||
|
case <-done:
|
||||||
|
return
|
||||||
|
default:
|
||||||
|
motion, err := decodeMotion(res.Value)
|
||||||
|
if err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
out <- motion
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
return out, cancel, nil
|
||||||
|
}
|
||||||
14
api/notify.go
Normal file
14
api/notify.go
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
package api
|
||||||
|
|
||||||
|
import "go.arsenm.dev/itd/internal/types"
|
||||||
|
|
||||||
|
func (c *Client) Notify(title string, body string) error {
|
||||||
|
_, err := c.request(types.Request{
|
||||||
|
Type: types.ReqTypeNotify,
|
||||||
|
Data: types.ReqDataNotify{
|
||||||
|
Title: title,
|
||||||
|
Body: body,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
return err
|
||||||
|
}
|
||||||
33
api/time.go
Normal file
33
api/time.go
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
package api
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"go.arsenm.dev/itd/internal/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
// SetTime sets the given time on the connected device
|
||||||
|
func (c *Client) SetTime(t time.Time) error {
|
||||||
|
_, err := c.request(types.Request{
|
||||||
|
Type: types.ReqTypeSetTime,
|
||||||
|
Data: t.Format(time.RFC3339),
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetTimeNow sets the time on the connected device to
|
||||||
|
// the current time. This is more accurate than
|
||||||
|
// SetTime(time.Now()) due to RFC3339 formatting
|
||||||
|
func (c *Client) SetTimeNow() error {
|
||||||
|
_, err := c.request(types.Request{
|
||||||
|
Type: types.ReqTypeSetTime,
|
||||||
|
Data: "now",
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
48
api/upgrade.go
Normal file
48
api/upgrade.go
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
package api
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
|
||||||
|
"go.arsenm.dev/itd/internal/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
// DFUProgress stores the progress of a DFU upfate
|
||||||
|
type DFUProgress types.DFUProgress
|
||||||
|
|
||||||
|
// UpgradeType indicates the type of upgrade to be performed
|
||||||
|
type UpgradeType uint8
|
||||||
|
|
||||||
|
// Type of DFU upgrade
|
||||||
|
const (
|
||||||
|
UpgradeTypeArchive UpgradeType = iota
|
||||||
|
UpgradeTypeFiles
|
||||||
|
)
|
||||||
|
|
||||||
|
// FirmwareUpgrade initiates a DFU update and returns the progress channel
|
||||||
|
func (c *Client) FirmwareUpgrade(upgType UpgradeType, files ...string) (<-chan DFUProgress, error) {
|
||||||
|
err := json.NewEncoder(c.conn).Encode(types.Request{
|
||||||
|
Type: types.ReqTypeFwUpgrade,
|
||||||
|
Data: types.ReqDataFwUpgrade{
|
||||||
|
Type: int(upgType),
|
||||||
|
Files: files,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
c.dfuProgressCh = make(chan types.Response, 5)
|
||||||
|
|
||||||
|
out := make(chan DFUProgress, 5)
|
||||||
|
go func() {
|
||||||
|
for res := range c.dfuProgressCh {
|
||||||
|
progress, err := decodeDFUProgress(res.Value)
|
||||||
|
if err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
out <- progress
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
142
calls.go
Normal file
142
calls.go
Normal file
@@ -0,0 +1,142 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"sync"
|
||||||
|
|
||||||
|
"github.com/godbus/dbus/v5"
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
"go.arsenm.dev/infinitime"
|
||||||
|
)
|
||||||
|
|
||||||
|
func initCallNotifs(dev *infinitime.Device) error {
|
||||||
|
// Connect to system bus. This connection is for method calls.
|
||||||
|
conn, err := newSystemBusConn()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if modem manager interface exists
|
||||||
|
exists, err := modemManagerExists(conn)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// If it does not exist, stop function
|
||||||
|
if !exists {
|
||||||
|
conn.Close()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Connect to system bus. This connection is for monitoring.
|
||||||
|
monitorConn, err := newSystemBusConn()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add match for new calls to monitor connection
|
||||||
|
err = monitorConn.AddMatchSignal(
|
||||||
|
dbus.WithMatchSender("org.freedesktop.ModemManager1"),
|
||||||
|
dbus.WithMatchInterface("org.freedesktop.ModemManager1.Modem.Voice"),
|
||||||
|
dbus.WithMatchMember("CallAdded"),
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create channel to receive calls
|
||||||
|
callCh := make(chan *dbus.Message, 5)
|
||||||
|
// Notify channel upon received message
|
||||||
|
monitorConn.Eavesdrop(callCh)
|
||||||
|
|
||||||
|
var respHandlerOnce sync.Once
|
||||||
|
var callObj dbus.BusObject
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
// For every message received
|
||||||
|
for event := range callCh {
|
||||||
|
// Get path to call object
|
||||||
|
callPath := event.Body[0].(dbus.ObjectPath)
|
||||||
|
// Get call object
|
||||||
|
callObj = conn.Object("org.freedesktop.ModemManager1", callPath)
|
||||||
|
|
||||||
|
// Get phone number from call object using method call connection
|
||||||
|
phoneNum, err := getPhoneNum(conn, callObj)
|
||||||
|
if err != nil {
|
||||||
|
log.Error().Err(err).Msg("Error getting phone number")
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send call notification to InfiniTime
|
||||||
|
resCh, err := dev.NotifyCall(phoneNum)
|
||||||
|
if err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
go respHandlerOnce.Do(func() {
|
||||||
|
// Wait for PineTime response
|
||||||
|
for res := range resCh {
|
||||||
|
switch res {
|
||||||
|
case infinitime.CallStatusAccepted:
|
||||||
|
// Attempt to accept call
|
||||||
|
err = acceptCall(conn, callObj)
|
||||||
|
if err != nil {
|
||||||
|
log.Warn().Err(err).Msg("Error accepting call")
|
||||||
|
}
|
||||||
|
case infinitime.CallStatusDeclined:
|
||||||
|
// Attempt to decline call
|
||||||
|
err = declineCall(conn, callObj)
|
||||||
|
if err != nil {
|
||||||
|
log.Warn().Err(err).Msg("Error declining call")
|
||||||
|
}
|
||||||
|
case infinitime.CallStatusMuted:
|
||||||
|
// Warn about unimplemented muting
|
||||||
|
log.Warn().Msg("Muting calls is not implemented")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
log.Info().Msg("Relaying calls to InfiniTime")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func modemManagerExists(conn *dbus.Conn) (bool, error) {
|
||||||
|
var names []string
|
||||||
|
err := conn.BusObject().Call("org.freedesktop.DBus.ListNames", 0).Store(&names)
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
return strSlcContains(names, "org.freedesktop.ModemManager1"), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// getPhoneNum gets a phone number from a call object using a DBus connection
|
||||||
|
func getPhoneNum(conn *dbus.Conn, callObj dbus.BusObject) (string, error) {
|
||||||
|
var out string
|
||||||
|
// Get number property on DBus object and store return value in out
|
||||||
|
err := callObj.StoreProperty("org.freedesktop.ModemManager1.Call.Number", &out)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// getPhoneNum accepts a call using a DBus connection
|
||||||
|
func acceptCall(conn *dbus.Conn, callObj dbus.BusObject) error {
|
||||||
|
// Call Accept() method on DBus object
|
||||||
|
call := callObj.Call("org.freedesktop.ModemManager1.Call.Accept", 0)
|
||||||
|
if call.Err != nil {
|
||||||
|
return call.Err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// getPhoneNum declines a call using a DBus connection
|
||||||
|
func declineCall(conn *dbus.Conn, callObj dbus.BusObject) error {
|
||||||
|
// Call Hangup() method on DBus object
|
||||||
|
call := callObj.Call("org.freedesktop.ModemManager1.Call.Hangup", 0)
|
||||||
|
if call.Err != nil {
|
||||||
|
return call.Err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
35
cmd/itctl/filesystem/filesystem.go
Normal file
35
cmd/itctl/filesystem/filesystem.go
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* itd uses bluetooth low energy to communicate with InfiniTime devices
|
||||||
|
* Copyright (C) 2021 Arsen Musayelyan
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package filesystem
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
"go.arsenm.dev/itd/cmd/itctl/root"
|
||||||
|
)
|
||||||
|
|
||||||
|
// filesystemCmd represents the filesystem command
|
||||||
|
var filesystemCmd = &cobra.Command{
|
||||||
|
Use: "filesystem",
|
||||||
|
Aliases: []string{"fs"},
|
||||||
|
Short: "Perform filesystem operations on the PineTime",
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
root.RootCmd.AddCommand(filesystemCmd)
|
||||||
|
}
|
||||||
56
cmd/itctl/filesystem/list.go
Normal file
56
cmd/itctl/filesystem/list.go
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
/*
|
||||||
|
* itd uses bluetooth low energy to communicate with InfiniTime devices
|
||||||
|
* Copyright (C) 2021 Arsen Musayelyan
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package filesystem
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
"go.arsenm.dev/itd/api"
|
||||||
|
)
|
||||||
|
|
||||||
|
// listCmd represents the list command
|
||||||
|
var listCmd = &cobra.Command{
|
||||||
|
Use: "list [path]",
|
||||||
|
Aliases: []string{"ls"},
|
||||||
|
Short: "List a directory",
|
||||||
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
dirPath := "/"
|
||||||
|
if len(args) > 0 {
|
||||||
|
dirPath = args[0]
|
||||||
|
}
|
||||||
|
|
||||||
|
client := viper.Get("client").(*api.Client)
|
||||||
|
|
||||||
|
listing, err := client.ReadDir(dirPath)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("Error getting directory listing")
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, entry := range listing {
|
||||||
|
fmt.Println(entry)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
filesystemCmd.AddCommand(listCmd)
|
||||||
|
}
|
||||||
49
cmd/itctl/filesystem/mkdir.go
Normal file
49
cmd/itctl/filesystem/mkdir.go
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
* itd uses bluetooth low energy to communicate with InfiniTime devices
|
||||||
|
* Copyright (C) 2021 Arsen Musayelyan
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package filesystem
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
"go.arsenm.dev/itd/api"
|
||||||
|
)
|
||||||
|
|
||||||
|
// mkdirCmd represents the mkdir command
|
||||||
|
var mkdirCmd = &cobra.Command{
|
||||||
|
Use: "mkdir <path...>",
|
||||||
|
Short: "Create a new directory",
|
||||||
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
if len(args) < 1 {
|
||||||
|
cmd.Usage()
|
||||||
|
log.Fatal().Msg("Command mkdir requires one or more arguments")
|
||||||
|
}
|
||||||
|
|
||||||
|
client := viper.Get("client").(*api.Client)
|
||||||
|
|
||||||
|
err := client.Mkdir(args...)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("Error creating directory")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
filesystemCmd.AddCommand(mkdirCmd)
|
||||||
|
}
|
||||||
50
cmd/itctl/filesystem/move.go
Normal file
50
cmd/itctl/filesystem/move.go
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
/*
|
||||||
|
* itd uses bluetooth low energy to communicate with InfiniTime devices
|
||||||
|
* Copyright (C) 2021 Arsen Musayelyan
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package filesystem
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
"go.arsenm.dev/itd/api"
|
||||||
|
)
|
||||||
|
|
||||||
|
// moveCmd represents the move command
|
||||||
|
var moveCmd = &cobra.Command{
|
||||||
|
Use: "move <old> <new>",
|
||||||
|
Aliases: []string{"mv"},
|
||||||
|
Short: "Move a file or directory",
|
||||||
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
if len(args) != 2 {
|
||||||
|
cmd.Usage()
|
||||||
|
log.Fatal().Msg("Command move requires two arguments")
|
||||||
|
}
|
||||||
|
|
||||||
|
client := viper.Get("client").(*api.Client)
|
||||||
|
|
||||||
|
err := client.Rename(args[0], args[1])
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("Error moving file or directory")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
filesystemCmd.AddCommand(moveCmd)
|
||||||
|
}
|
||||||
73
cmd/itctl/filesystem/read.go
Normal file
73
cmd/itctl/filesystem/read.go
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
/*
|
||||||
|
* itd uses bluetooth low energy to communicate with InfiniTime devices
|
||||||
|
* Copyright (C) 2021 Arsen Musayelyan
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package filesystem
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
"go.arsenm.dev/itd/api"
|
||||||
|
)
|
||||||
|
|
||||||
|
// readCmd represents the read command
|
||||||
|
var readCmd = &cobra.Command{
|
||||||
|
Use: `read <remote path> <local path | "-">`,
|
||||||
|
Short: "Read a file from InfiniTime",
|
||||||
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
if len(args) != 2 {
|
||||||
|
cmd.Usage()
|
||||||
|
log.Fatal().Msg("Command read requires two arguments")
|
||||||
|
}
|
||||||
|
|
||||||
|
start := time.Now()
|
||||||
|
client := viper.Get("client").(*api.Client)
|
||||||
|
|
||||||
|
data, err := client.ReadFile(args[0])
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("Error moving file or directory")
|
||||||
|
}
|
||||||
|
|
||||||
|
var suffix string
|
||||||
|
var out *os.File
|
||||||
|
if args[1] == "-" {
|
||||||
|
out = os.Stdout
|
||||||
|
suffix = "\n"
|
||||||
|
} else {
|
||||||
|
out, err = os.Create(args[1])
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("Error opening local file")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
n, err := out.WriteString(data)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("Error writing to local file")
|
||||||
|
}
|
||||||
|
out.WriteString(suffix)
|
||||||
|
|
||||||
|
log.Info().Msgf("Read %d bytes in %s", n, time.Since(start))
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
filesystemCmd.AddCommand(readCmd)
|
||||||
|
}
|
||||||
50
cmd/itctl/filesystem/remove.go
Normal file
50
cmd/itctl/filesystem/remove.go
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
/*
|
||||||
|
* itd uses bluetooth low energy to communicate with InfiniTime devices
|
||||||
|
* Copyright (C) 2021 Arsen Musayelyan
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package filesystem
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
"go.arsenm.dev/itd/api"
|
||||||
|
)
|
||||||
|
|
||||||
|
// removeCmd represents the remove command
|
||||||
|
var removeCmd = &cobra.Command{
|
||||||
|
Use: "remove <path...>",
|
||||||
|
Aliases: []string{"rm"},
|
||||||
|
Short: "Create a new directory",
|
||||||
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
if len(args) < 1 {
|
||||||
|
cmd.Usage()
|
||||||
|
log.Fatal().Msg("Command mkdir requires one or more arguments")
|
||||||
|
}
|
||||||
|
|
||||||
|
client := viper.Get("client").(*api.Client)
|
||||||
|
|
||||||
|
err := client.Remove(args...)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("Error removing file or directory")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
filesystemCmd.AddCommand(removeCmd)
|
||||||
|
}
|
||||||
72
cmd/itctl/filesystem/write.go
Normal file
72
cmd/itctl/filesystem/write.go
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
/*
|
||||||
|
* itd uses bluetooth low energy to communicate with InfiniTime devices
|
||||||
|
* Copyright (C) 2021 Arsen Musayelyan
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package filesystem
|
||||||
|
|
||||||
|
import (
|
||||||
|
"io"
|
||||||
|
"os"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
"go.arsenm.dev/itd/api"
|
||||||
|
)
|
||||||
|
|
||||||
|
// writeCmd represents the write command
|
||||||
|
var writeCmd = &cobra.Command{
|
||||||
|
Use: `write <local path | "-"> <remote path>`,
|
||||||
|
Short: "Write a file to InfiniTime",
|
||||||
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
if len(args) != 2 {
|
||||||
|
cmd.Usage()
|
||||||
|
log.Fatal().Msg("Command write requires two arguments")
|
||||||
|
}
|
||||||
|
|
||||||
|
start := time.Now()
|
||||||
|
client := viper.Get("client").(*api.Client)
|
||||||
|
|
||||||
|
var in *os.File
|
||||||
|
if args[0] == "-" {
|
||||||
|
in = os.Stdin
|
||||||
|
} else {
|
||||||
|
fl, err := os.Open(args[0])
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("Error opening local file")
|
||||||
|
}
|
||||||
|
in = fl
|
||||||
|
}
|
||||||
|
|
||||||
|
data, err := io.ReadAll(in)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("Error moving file or directory")
|
||||||
|
}
|
||||||
|
|
||||||
|
err = client.WriteFile(args[1], string(data))
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("Error writing to remote file")
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Info().Msgf("Wrote %d bytes in %s", len(data), time.Since(start))
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
filesystemCmd.AddCommand(writeCmd)
|
||||||
|
}
|
||||||
@@ -16,10 +16,11 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cmd
|
package firmware
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
"go.arsenm.dev/itd/cmd/itctl/root"
|
||||||
)
|
)
|
||||||
|
|
||||||
// firmwareCmd represents the firmware command
|
// firmwareCmd represents the firmware command
|
||||||
@@ -30,5 +31,5 @@ var firmwareCmd = &cobra.Command{
|
|||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
rootCmd.AddCommand(firmwareCmd)
|
root.RootCmd.AddCommand(firmwareCmd)
|
||||||
}
|
}
|
||||||
@@ -16,61 +16,55 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cmd
|
package firmware
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"fmt"
|
||||||
"encoding/json"
|
"time"
|
||||||
"net"
|
|
||||||
|
|
||||||
"github.com/cheggaaa/pb/v3"
|
"github.com/cheggaaa/pb/v3"
|
||||||
"github.com/mitchellh/mapstructure"
|
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
"go.arsenm.dev/itd/api"
|
||||||
"go.arsenm.dev/itd/internal/types"
|
"go.arsenm.dev/itd/internal/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type DFUProgress struct {
|
||||||
|
Received int64 `mapstructure:"recvd"`
|
||||||
|
Total int64 `mapstructure:"total"`
|
||||||
|
}
|
||||||
|
|
||||||
// upgradeCmd represents the upgrade command
|
// upgradeCmd represents the upgrade command
|
||||||
var upgradeCmd = &cobra.Command{
|
var upgradeCmd = &cobra.Command{
|
||||||
Use: "upgrade",
|
Use: "upgrade",
|
||||||
Short: "Upgrade InfiniTime firmware using files or archive",
|
Short: "Upgrade InfiniTime firmware using files or archive",
|
||||||
Aliases: []string{"upg"},
|
Aliases: []string{"upg"},
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
// Connect to itd UNIX socket
|
start := time.Now()
|
||||||
conn, err := net.Dial("unix", viper.GetString("sockPath"))
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal().Err(err).Msg("Error dialing socket. Is itd running?")
|
|
||||||
}
|
|
||||||
defer conn.Close()
|
|
||||||
|
|
||||||
var data types.ReqDataFwUpgrade
|
client := viper.Get("client").(*api.Client)
|
||||||
|
|
||||||
|
var upgType api.UpgradeType
|
||||||
|
var files []string
|
||||||
// Get relevant data struct
|
// Get relevant data struct
|
||||||
if viper.GetString("archive") != "" {
|
if viper.GetString("archive") != "" {
|
||||||
// Get archive data struct
|
// Get archive data struct
|
||||||
data = types.ReqDataFwUpgrade{
|
upgType = types.UpgradeTypeArchive
|
||||||
Type: types.UpgradeTypeArchive,
|
files = []string{viper.GetString("archive")}
|
||||||
Files: []string{viper.GetString("archive")},
|
|
||||||
}
|
|
||||||
} else if viper.GetString("initPkt") != "" && viper.GetString("firmware") != "" {
|
} else if viper.GetString("initPkt") != "" && viper.GetString("firmware") != "" {
|
||||||
// Get files data struct
|
// Get files data struct
|
||||||
data = types.ReqDataFwUpgrade{
|
upgType = types.UpgradeTypeFiles
|
||||||
Type: types.UpgradeTypeFiles,
|
files = []string{viper.GetString("initPkt"), viper.GetString("firmware")}
|
||||||
Files: []string{viper.GetString("initPkt"), viper.GetString("firmware")},
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
cmd.Usage()
|
cmd.Usage()
|
||||||
log.Warn().Msg("Upgrade command requires either archive or init packet and firmware.")
|
log.Warn().Msg("Upgrade command requires either archive or init packet and firmware.")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Encode response into connection
|
progress, err := client.FirmwareUpgrade(upgType, files...)
|
||||||
err = json.NewEncoder(conn).Encode(types.Request{
|
|
||||||
Type: types.ReqTypeFwUpgrade,
|
|
||||||
Data: data,
|
|
||||||
})
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal().Err(err).Msg("Error making request")
|
log.Fatal().Err(err).Msg("Error initiating DFU")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create progress bar template
|
// Create progress bar template
|
||||||
@@ -78,37 +72,21 @@ var upgradeCmd = &cobra.Command{
|
|||||||
// Start full bar at 0 total
|
// Start full bar at 0 total
|
||||||
bar := pb.ProgressBarTemplate(barTmpl).Start(0)
|
bar := pb.ProgressBarTemplate(barTmpl).Start(0)
|
||||||
// Create new scanner of connection
|
// Create new scanner of connection
|
||||||
scanner := bufio.NewScanner(conn)
|
for event := range progress {
|
||||||
for scanner.Scan() {
|
|
||||||
var res types.Response
|
|
||||||
// Decode scanned line into response struct
|
|
||||||
err = json.Unmarshal(scanner.Bytes(), &res)
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal().Err(err).Msg("Error decoding JSON response")
|
|
||||||
}
|
|
||||||
if res.Error {
|
|
||||||
log.Fatal().Msg(res.Message)
|
|
||||||
}
|
|
||||||
var event DFUProgress
|
|
||||||
// Decode response data into progress struct
|
|
||||||
err = mapstructure.Decode(res.Value, &event)
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal().Err(err).Msg("Error decoding response data")
|
|
||||||
}
|
|
||||||
// Set total bytes in progress bar
|
// Set total bytes in progress bar
|
||||||
bar.SetTotal(event.Total)
|
bar.SetTotal(event.Total)
|
||||||
// Set amount of bytes received in progress bar
|
// Set amount of bytes received in progress bar
|
||||||
bar.SetCurrent(event.Received)
|
bar.SetCurrent(event.Received)
|
||||||
// If transfer finished, break
|
// If transfer finished, break
|
||||||
if event.Received == event.Total {
|
if event.Sent == event.Total {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Finish progress bar
|
// Finish progress bar
|
||||||
bar.Finish()
|
bar.Finish()
|
||||||
if scanner.Err() != nil {
|
|
||||||
log.Fatal().Err(scanner.Err()).Msg("Error while scanning output")
|
fmt.Printf("Transferred %d B in %s.\n", bar.Total(), time.Since(start))
|
||||||
}
|
fmt.Println("Remember to validate the new firmware in the InfiniTime settings.")
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -16,18 +16,15 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cmd
|
package firmware
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
|
||||||
|
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
"go.arsenm.dev/itd/internal/types"
|
"go.arsenm.dev/itd/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
// versionCmd represents the version command
|
// versionCmd represents the version command
|
||||||
@@ -36,40 +33,14 @@ var versionCmd = &cobra.Command{
|
|||||||
Aliases: []string{"ver"},
|
Aliases: []string{"ver"},
|
||||||
Short: "Get firmware version of InfiniTime",
|
Short: "Get firmware version of InfiniTime",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
// Connect to itd UNIX socket
|
client := viper.Get("client").(*api.Client)
|
||||||
conn, err := net.Dial("unix", viper.GetString("sockPath"))
|
|
||||||
|
version, err := client.Version()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal().Err(err).Msg("Error dialing socket. Is itd running?")
|
log.Fatal().Err(err).Msg("Error getting firmware version")
|
||||||
}
|
|
||||||
defer conn.Close()
|
|
||||||
|
|
||||||
// Encode request into connection
|
|
||||||
err = json.NewEncoder(conn).Encode(types.Request{
|
|
||||||
Type: types.ReqTypeFwVersion,
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal().Err(err).Msg("Error making request")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read one line from connection
|
fmt.Println(version)
|
||||||
line, _, err := bufio.NewReader(conn).ReadLine()
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal().Err(err).Msg("Error reading line from connection")
|
|
||||||
}
|
|
||||||
|
|
||||||
var res types.Response
|
|
||||||
// Decode line into response
|
|
||||||
err = json.Unmarshal(line, &res)
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal().Err(err).Msg("Error decoding JSON data")
|
|
||||||
}
|
|
||||||
|
|
||||||
if res.Error {
|
|
||||||
log.Fatal().Msg(res.Message)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Print returned value
|
|
||||||
fmt.Println(res.Value)
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -16,18 +16,15 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cmd
|
package get
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
|
||||||
|
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
"go.arsenm.dev/itd/internal/types"
|
"go.arsenm.dev/itd/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
// addressCmd represents the address command
|
// addressCmd represents the address command
|
||||||
@@ -36,40 +33,14 @@ var addressCmd = &cobra.Command{
|
|||||||
Aliases: []string{"addr"},
|
Aliases: []string{"addr"},
|
||||||
Short: "Get InfiniTime's bluetooth address",
|
Short: "Get InfiniTime's bluetooth address",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
// Connect to itd UNIX socket
|
client := viper.Get("client").(*api.Client)
|
||||||
conn, err := net.Dial("unix", viper.GetString("sockPath"))
|
|
||||||
|
address, err := client.Address()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal().Err(err).Msg("Error dialing socket. Is itd running?")
|
log.Fatal().Err(err).Msg("Error getting bluetooth address")
|
||||||
}
|
|
||||||
defer conn.Close()
|
|
||||||
|
|
||||||
// Encode request into connection
|
|
||||||
err = json.NewEncoder(conn).Encode(types.Request{
|
|
||||||
Type: types.ReqTypeBtAddress,
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal().Err(err).Msg("Error making request")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read one line from connection
|
fmt.Println(address)
|
||||||
line, _, err := bufio.NewReader(conn).ReadLine()
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal().Err(err).Msg("Error reading line from connection")
|
|
||||||
}
|
|
||||||
|
|
||||||
var res types.Response
|
|
||||||
// Decode line into response
|
|
||||||
err = json.Unmarshal(line, &res)
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal().Err(err).Msg("Error decoding JSON data")
|
|
||||||
}
|
|
||||||
|
|
||||||
if res.Error {
|
|
||||||
log.Fatal().Msg(res.Message)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Print returned value
|
|
||||||
fmt.Println(res.Value)
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -16,18 +16,15 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cmd
|
package get
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
|
||||||
|
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
"go.arsenm.dev/itd/internal/types"
|
"go.arsenm.dev/itd/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
// batteryCmd represents the batt command
|
// batteryCmd represents the batt command
|
||||||
@@ -36,40 +33,15 @@ var batteryCmd = &cobra.Command{
|
|||||||
Aliases: []string{"batt"},
|
Aliases: []string{"batt"},
|
||||||
Short: "Get battery level from InfiniTime",
|
Short: "Get battery level from InfiniTime",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
// Connect to itd UNIX socket
|
client := viper.Get("client").(*api.Client)
|
||||||
conn, err := net.Dial("unix", viper.GetString("sockPath"))
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal().Err(err).Msg("Error dialing socket. Is itd running?")
|
|
||||||
}
|
|
||||||
defer conn.Close()
|
|
||||||
|
|
||||||
// Encode request into connection
|
battLevel, err := client.BatteryLevel()
|
||||||
err = json.NewEncoder(conn).Encode(types.Request{
|
|
||||||
Type: types.ReqTypeBattLevel,
|
|
||||||
})
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal().Err(err).Msg("Error making request")
|
log.Fatal().Err(err).Msg("Error getting battery level")
|
||||||
}
|
|
||||||
|
|
||||||
// Read one line from connection
|
|
||||||
line, _, err := bufio.NewReader(conn).ReadLine()
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal().Err(err).Msg("Error reading line from connection")
|
|
||||||
}
|
|
||||||
|
|
||||||
var res types.Response
|
|
||||||
// Deocde line into response
|
|
||||||
err = json.Unmarshal(line, &res)
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal().Err(err).Msg("Error decoding JSON data")
|
|
||||||
}
|
|
||||||
|
|
||||||
if res.Error {
|
|
||||||
log.Fatal().Msg(res.Message)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Print returned percentage
|
// Print returned percentage
|
||||||
fmt.Printf("%d%%\n", int(res.Value.(float64)))
|
fmt.Printf("%d%%\n", battLevel)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -16,10 +16,11 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cmd
|
package get
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
"go.arsenm.dev/itd/cmd/itctl/root"
|
||||||
)
|
)
|
||||||
|
|
||||||
// getCmd represents the get command
|
// getCmd represents the get command
|
||||||
@@ -29,5 +30,5 @@ var getCmd = &cobra.Command{
|
|||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
rootCmd.AddCommand(getCmd)
|
root.RootCmd.AddCommand(getCmd)
|
||||||
}
|
}
|
||||||
@@ -16,18 +16,15 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cmd
|
package get
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
|
||||||
|
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
"go.arsenm.dev/itd/internal/types"
|
"go.arsenm.dev/itd/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
// heartCmd represents the heart command
|
// heartCmd represents the heart command
|
||||||
@@ -35,40 +32,15 @@ var heartCmd = &cobra.Command{
|
|||||||
Use: "heart",
|
Use: "heart",
|
||||||
Short: "Get heart rate from InfiniTime",
|
Short: "Get heart rate from InfiniTime",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
// Connect to itd UNIX socket
|
client := viper.Get("client").(*api.Client)
|
||||||
conn, err := net.Dial("unix", viper.GetString("sockPath"))
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal().Err(err).Msg("Error dialing socket. Is itd running?")
|
|
||||||
}
|
|
||||||
defer conn.Close()
|
|
||||||
|
|
||||||
// Encode request into connection
|
heartRate, err := client.HeartRate()
|
||||||
err = json.NewEncoder(conn).Encode(types.Request{
|
|
||||||
Type: types.ReqTypeHeartRate,
|
|
||||||
})
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal().Err(err).Msg("Error making request")
|
log.Fatal().Err(err).Msg("Error getting heart rate")
|
||||||
}
|
|
||||||
|
|
||||||
// Read one line from connection
|
|
||||||
line, _, err := bufio.NewReader(conn).ReadLine()
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal().Err(err).Msg("Error reading line from connection")
|
|
||||||
}
|
|
||||||
|
|
||||||
var res types.Response
|
|
||||||
// Decode line into response
|
|
||||||
err = json.Unmarshal(line, &res)
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal().Err(err).Msg("Error decoding JSON data")
|
|
||||||
}
|
|
||||||
|
|
||||||
if res.Error {
|
|
||||||
log.Fatal().Msg(res.Message)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Print returned BPM
|
// Print returned BPM
|
||||||
fmt.Printf("%d BPM\n", int(res.Value.(float64)))
|
fmt.Printf("%d BPM\n", heartRate)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
68
cmd/itctl/get/motion.go
Normal file
68
cmd/itctl/get/motion.go
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* itd uses bluetooth low energy to communicate with InfiniTime devices
|
||||||
|
* Copyright (C) 2021 Arsen Musayelyan
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package get
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
"go.arsenm.dev/itd/api"
|
||||||
|
)
|
||||||
|
|
||||||
|
// steps.goCmd represents the steps.go command
|
||||||
|
var motionCmd = &cobra.Command{
|
||||||
|
Use: "motion",
|
||||||
|
Short: "Get motion values from InfiniTime",
|
||||||
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
client := viper.Get("client").(*api.Client)
|
||||||
|
|
||||||
|
motionVals, err := client.Motion()
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("Error getting motion values")
|
||||||
|
}
|
||||||
|
|
||||||
|
if viper.GetBool("shell") {
|
||||||
|
fmt.Printf(
|
||||||
|
"X=%d\nY=%d\nZ=%d",
|
||||||
|
motionVals.X,
|
||||||
|
motionVals.Y,
|
||||||
|
motionVals.Z,
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
fmt.Printf("%+v\n", motionVals)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
getCmd.AddCommand(motionCmd)
|
||||||
|
|
||||||
|
// Here you will define your flags and configuration settings.
|
||||||
|
|
||||||
|
// Cobra supports Persistent Flags which will work for this command
|
||||||
|
// and all subcommands, e.g.:
|
||||||
|
// steps.goCmd.PersistentFlags().String("foo", "", "A help for foo")
|
||||||
|
|
||||||
|
// Cobra supports local flags which will only run when this command
|
||||||
|
// is called directly, e.g.:
|
||||||
|
motionCmd.Flags().BoolP("shell", "s", false, "Output data in shell-compatible format")
|
||||||
|
viper.BindPFlag("shell", motionCmd.Flags().Lookup("shell"))
|
||||||
|
}
|
||||||
59
cmd/itctl/get/steps.go
Normal file
59
cmd/itctl/get/steps.go
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
* itd uses bluetooth low energy to communicate with InfiniTime devices
|
||||||
|
* Copyright (C) 2021 Arsen Musayelyan
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package get
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
"go.arsenm.dev/itd/api"
|
||||||
|
)
|
||||||
|
|
||||||
|
// steps.goCmd represents the steps.go command
|
||||||
|
var stepsCmd = &cobra.Command{
|
||||||
|
Use: "steps",
|
||||||
|
Short: "Get step count from InfiniTime",
|
||||||
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
client := viper.Get("client").(*api.Client)
|
||||||
|
|
||||||
|
stepCount, err := client.StepCount()
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("Error getting step count")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Print returned BPM
|
||||||
|
fmt.Printf("%d Steps\n", stepCount)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
getCmd.AddCommand(stepsCmd)
|
||||||
|
|
||||||
|
// Here you will define your flags and configuration settings.
|
||||||
|
|
||||||
|
// Cobra supports Persistent Flags which will work for this command
|
||||||
|
// and all subcommands, e.g.:
|
||||||
|
// steps.goCmd.PersistentFlags().String("foo", "", "A help for foo")
|
||||||
|
|
||||||
|
// Cobra supports local flags which will only run when this command
|
||||||
|
// is called directly, e.g.:
|
||||||
|
// steps.goCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
|
||||||
|
}
|
||||||
@@ -19,9 +19,15 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
_ "go.arsenm.dev/itd/cmd/itctl/firmware"
|
||||||
|
_ "go.arsenm.dev/itd/cmd/itctl/get"
|
||||||
|
_ "go.arsenm.dev/itd/cmd/itctl/notify"
|
||||||
|
"go.arsenm.dev/itd/cmd/itctl/root"
|
||||||
|
_ "go.arsenm.dev/itd/cmd/itctl/set"
|
||||||
|
_ "go.arsenm.dev/itd/cmd/itctl/watch"
|
||||||
|
_ "go.arsenm.dev/itd/cmd/itctl/filesystem"
|
||||||
|
|
||||||
"go.arsenm.dev/itd/cmd/itctl/cmd"
|
"os"
|
||||||
|
|
||||||
"github.com/rs/zerolog"
|
"github.com/rs/zerolog"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
@@ -32,5 +38,5 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
cmd.Execute()
|
root.Execute()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,17 +16,14 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cmd
|
package notify
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
|
||||||
"encoding/json"
|
|
||||||
"net"
|
|
||||||
|
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
"go.arsenm.dev/itd/internal/types"
|
"go.arsenm.dev/itd/api"
|
||||||
|
"go.arsenm.dev/itd/cmd/itctl/root"
|
||||||
)
|
)
|
||||||
|
|
||||||
// notifyCmd represents the notify command
|
// notifyCmd represents the notify command
|
||||||
@@ -40,44 +37,15 @@ var notifyCmd = &cobra.Command{
|
|||||||
log.Fatal().Msg("Command notify requires two arguments")
|
log.Fatal().Msg("Command notify requires two arguments")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Connect to itd UNIX socket
|
client := viper.Get("client").(*api.Client)
|
||||||
conn, err := net.Dial("unix", viper.GetString("sockPath"))
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal().Err(err).Msg("Error dialing socket. Is itd running?")
|
|
||||||
}
|
|
||||||
defer conn.Close()
|
|
||||||
|
|
||||||
// Encode request into connection
|
err := client.Notify(args[0], args[1])
|
||||||
err = json.NewEncoder(conn).Encode(types.Request{
|
|
||||||
Type: types.ReqTypeNotify,
|
|
||||||
Data: types.ReqDataNotify{
|
|
||||||
Title: args[0],
|
|
||||||
Body: args[1],
|
|
||||||
},
|
|
||||||
})
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal().Err(err).Msg("Error making request")
|
log.Fatal().Err(err).Msg("Error sending notification")
|
||||||
}
|
|
||||||
|
|
||||||
// Read one line from connection
|
|
||||||
line, _, err := bufio.NewReader(conn).ReadLine()
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal().Err(err).Msg("Error reading line from connection")
|
|
||||||
}
|
|
||||||
|
|
||||||
var res types.Response
|
|
||||||
// Decode line into response
|
|
||||||
err = json.Unmarshal(line, &res)
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal().Err(err).Msg("Error decoding JSON data")
|
|
||||||
}
|
|
||||||
|
|
||||||
if res.Error {
|
|
||||||
log.Fatal().Msg(res.Message)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
rootCmd.AddCommand(notifyCmd)
|
root.RootCmd.AddCommand(notifyCmd)
|
||||||
}
|
}
|
||||||
@@ -16,16 +16,18 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cmd
|
package root
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/abiosoft/ishell"
|
"github.com/abiosoft/ishell"
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
"go.arsenm.dev/itd/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
// rootCmd represents the base command when called without any subcommands
|
// RootCmd represents the base command when called without any subcommands
|
||||||
var rootCmd = &cobra.Command{
|
var RootCmd = &cobra.Command{
|
||||||
Use: "itctl",
|
Use: "itctl",
|
||||||
Short: "Control the itd daemon for InfiniTime smartwatches",
|
Short: "Control the itd daemon for InfiniTime smartwatches",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
@@ -61,18 +63,25 @@ var rootCmd = &cobra.Command{
|
|||||||
// Execute adds all child commands to the root command and sets flags appropriately.
|
// Execute adds all child commands to the root command and sets flags appropriately.
|
||||||
// This is called by main.main(). It only needs to happen once to the rootCmd.
|
// This is called by main.main(). It only needs to happen once to the rootCmd.
|
||||||
func Execute() {
|
func Execute() {
|
||||||
rootCmd.CompletionOptions.DisableDefaultCmd = true
|
client, err := api.New(viper.GetString("sockPath"))
|
||||||
cobra.CheckErr(rootCmd.Execute())
|
if err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("Error connecting to socket. Is itd running?")
|
||||||
|
}
|
||||||
|
defer client.Close()
|
||||||
|
viper.Set("client", client)
|
||||||
|
RootCmd.CompletionOptions.DisableDefaultCmd = true
|
||||||
|
cobra.CheckErr(RootCmd.Execute())
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
// Register flag for socket path
|
// Register flag for socket path
|
||||||
rootCmd.Flags().StringP("socket-path", "s", "", "Path to itd socket")
|
RootCmd.Flags().StringP("socket-path", "s", api.DefaultAddr, "Path to itd socket")
|
||||||
|
|
||||||
// Bind flag and environment variable to viper key
|
// Bind flag and environment variable to viper key
|
||||||
viper.BindPFlag("sockPath", rootCmd.Flags().Lookup("socket-path"))
|
viper.BindPFlag("sockPath", RootCmd.Flags().Lookup("socket-path"))
|
||||||
viper.BindEnv("sockPath", "ITCTL_SOCKET_PATH")
|
viper.BindEnv("sockPath", "ITCTL_SOCKET_PATH")
|
||||||
|
|
||||||
// Set default value for socket path
|
// Set default value for socket path
|
||||||
viper.SetDefault("sockPath", "/tmp/itd/socket")
|
viper.SetDefault("sockPath", api.DefaultAddr)
|
||||||
}
|
}
|
||||||
@@ -16,10 +16,11 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cmd
|
package set
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
"go.arsenm.dev/itd/cmd/itctl/root"
|
||||||
)
|
)
|
||||||
|
|
||||||
// setCmd represents the set command
|
// setCmd represents the set command
|
||||||
@@ -29,5 +30,5 @@ var setCmd = &cobra.Command{
|
|||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
rootCmd.AddCommand(setCmd)
|
root.RootCmd.AddCommand(setCmd)
|
||||||
}
|
}
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cmd
|
package set
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
76
cmd/itctl/watch/battery.go
Normal file
76
cmd/itctl/watch/battery.go
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
/*
|
||||||
|
* itd uses bluetooth low energy to communicate with InfiniTime devices
|
||||||
|
* Copyright (C) 2021 Arsen Musayelyan
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package watch
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"os/signal"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
"go.arsenm.dev/itd/api"
|
||||||
|
)
|
||||||
|
|
||||||
|
// heartCmd represents the address command
|
||||||
|
var batteryCmd = &cobra.Command{
|
||||||
|
Use: "battery",
|
||||||
|
Aliases: []string{"batt"},
|
||||||
|
Short: "Watch InfiniTime's battery level for changes",
|
||||||
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
client := viper.Get("client").(*api.Client)
|
||||||
|
|
||||||
|
battLevelCh, cancel, err := client.WatchBatteryLevel()
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("Error getting battery level channel")
|
||||||
|
}
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
signalCh := make(chan os.Signal, 1)
|
||||||
|
go func() {
|
||||||
|
<-signalCh
|
||||||
|
cancel()
|
||||||
|
os.Exit(0)
|
||||||
|
}()
|
||||||
|
signal.Notify(signalCh,
|
||||||
|
syscall.SIGINT,
|
||||||
|
syscall.SIGTERM,
|
||||||
|
)
|
||||||
|
|
||||||
|
for battlevel := range battLevelCh {
|
||||||
|
fmt.Printf("%d%%\n", battlevel)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
watchCmd.AddCommand(batteryCmd)
|
||||||
|
|
||||||
|
// Here you will define your flags and configuration settings.
|
||||||
|
|
||||||
|
// Cobra supports Persistent Flags which will work for this command
|
||||||
|
// and all subcommands, e.g.:
|
||||||
|
// addressCmd.PersistentFlags().String("foo", "", "A help for foo")
|
||||||
|
|
||||||
|
// Cobra supports local flags which will only run when this command
|
||||||
|
// is called directly, e.g.:
|
||||||
|
// addressCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
|
||||||
|
}
|
||||||
75
cmd/itctl/watch/heart.go
Normal file
75
cmd/itctl/watch/heart.go
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
/*
|
||||||
|
* itd uses bluetooth low energy to communicate with InfiniTime devices
|
||||||
|
* Copyright (C) 2021 Arsen Musayelyan
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package watch
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"os/signal"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
"go.arsenm.dev/itd/api"
|
||||||
|
)
|
||||||
|
|
||||||
|
// heartCmd represents the address command
|
||||||
|
var heartCmd = &cobra.Command{
|
||||||
|
Use: "heart",
|
||||||
|
Short: "Watch InfiniTime's heart rate for changes",
|
||||||
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
client := viper.Get("client").(*api.Client)
|
||||||
|
|
||||||
|
heartRateCh, cancel, err := client.WatchHeartRate()
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("Error getting heart rate channel")
|
||||||
|
}
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
signalCh := make(chan os.Signal, 1)
|
||||||
|
go func() {
|
||||||
|
<-signalCh
|
||||||
|
cancel()
|
||||||
|
os.Exit(0)
|
||||||
|
}()
|
||||||
|
signal.Notify(signalCh,
|
||||||
|
syscall.SIGINT,
|
||||||
|
syscall.SIGTERM,
|
||||||
|
)
|
||||||
|
|
||||||
|
for heartRate := range heartRateCh {
|
||||||
|
fmt.Println(heartRate, "BPM")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
watchCmd.AddCommand(heartCmd)
|
||||||
|
|
||||||
|
// Here you will define your flags and configuration settings.
|
||||||
|
|
||||||
|
// Cobra supports Persistent Flags which will work for this command
|
||||||
|
// and all subcommands, e.g.:
|
||||||
|
// addressCmd.PersistentFlags().String("foo", "", "A help for foo")
|
||||||
|
|
||||||
|
// Cobra supports local flags which will only run when this command
|
||||||
|
// is called directly, e.g.:
|
||||||
|
// addressCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
|
||||||
|
}
|
||||||
86
cmd/itctl/watch/motion.go
Normal file
86
cmd/itctl/watch/motion.go
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
/*
|
||||||
|
* itd uses bluetooth low energy to communicate with InfiniTime devices
|
||||||
|
* Copyright (C) 2021 Arsen Musayelyan
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package watch
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"os/signal"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
"go.arsenm.dev/itd/api"
|
||||||
|
)
|
||||||
|
|
||||||
|
// heartCmd represents the address command
|
||||||
|
var motionCmd = &cobra.Command{
|
||||||
|
Use: "motion",
|
||||||
|
Short: "Watch InfiniTime's motion values for changes",
|
||||||
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
client := viper.Get("client").(*api.Client)
|
||||||
|
|
||||||
|
motionValCh, cancel, err := client.WatchMotion()
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("Error getting motion value channel")
|
||||||
|
}
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
signalCh := make(chan os.Signal, 1)
|
||||||
|
go func() {
|
||||||
|
<-signalCh
|
||||||
|
cancel()
|
||||||
|
os.Exit(0)
|
||||||
|
}()
|
||||||
|
signal.Notify(signalCh,
|
||||||
|
syscall.SIGINT,
|
||||||
|
syscall.SIGTERM,
|
||||||
|
)
|
||||||
|
|
||||||
|
for motionVals := range motionValCh {
|
||||||
|
if viper.GetBool("shell") {
|
||||||
|
fmt.Printf(
|
||||||
|
"X=%d\nY=%d\nZ=%d\n",
|
||||||
|
motionVals.X,
|
||||||
|
motionVals.Y,
|
||||||
|
motionVals.Z,
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
fmt.Printf("%+v\n", motionVals)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
watchCmd.AddCommand(motionCmd)
|
||||||
|
|
||||||
|
// Here you will define your flags and configuration settings.
|
||||||
|
|
||||||
|
// Cobra supports Persistent Flags which will work for this command
|
||||||
|
// and all subcommands, e.g.:
|
||||||
|
// addressCmd.PersistentFlags().String("foo", "", "A help for foo")
|
||||||
|
|
||||||
|
// Cobra supports local flags which will only run when this command
|
||||||
|
// is called directly, e.g.:
|
||||||
|
// addressCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
|
||||||
|
motionCmd.Flags().BoolP("shell", "s", false, "Output data in shell-compatible format")
|
||||||
|
viper.BindPFlag("shell", motionCmd.Flags().Lookup("shell"))
|
||||||
|
}
|
||||||
75
cmd/itctl/watch/steps.go
Normal file
75
cmd/itctl/watch/steps.go
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
/*
|
||||||
|
* itd uses bluetooth low energy to communicate with InfiniTime devices
|
||||||
|
* Copyright (C) 2021 Arsen Musayelyan
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package watch
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"os/signal"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
|
"github.com/rs/zerolog/log"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
"go.arsenm.dev/itd/api"
|
||||||
|
)
|
||||||
|
|
||||||
|
// heartCmd represents the address command
|
||||||
|
var stepsCmd = &cobra.Command{
|
||||||
|
Use: "steps",
|
||||||
|
Short: "Watch InfiniTime's step count for changes",
|
||||||
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
client := viper.Get("client").(*api.Client)
|
||||||
|
|
||||||
|
stepCountCh, cancel, err := client.WatchStepCount()
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal().Err(err).Msg("Error getting step count channel")
|
||||||
|
}
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
signalCh := make(chan os.Signal, 1)
|
||||||
|
go func() {
|
||||||
|
<-signalCh
|
||||||
|
cancel()
|
||||||
|
os.Exit(0)
|
||||||
|
}()
|
||||||
|
signal.Notify(signalCh,
|
||||||
|
syscall.SIGINT,
|
||||||
|
syscall.SIGTERM,
|
||||||
|
)
|
||||||
|
|
||||||
|
for stepCount := range stepCountCh {
|
||||||
|
fmt.Println(stepCount, "Steps")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
watchCmd.AddCommand(stepsCmd)
|
||||||
|
|
||||||
|
// Here you will define your flags and configuration settings.
|
||||||
|
|
||||||
|
// Cobra supports Persistent Flags which will work for this command
|
||||||
|
// and all subcommands, e.g.:
|
||||||
|
// addressCmd.PersistentFlags().String("foo", "", "A help for foo")
|
||||||
|
|
||||||
|
// Cobra supports local flags which will only run when this command
|
||||||
|
// is called directly, e.g.:
|
||||||
|
// addressCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
|
||||||
|
}
|
||||||
@@ -16,9 +16,19 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package cmd
|
package watch
|
||||||
|
|
||||||
type DFUProgress struct {
|
import (
|
||||||
Received int64 `mapstructure:"recvd"`
|
"github.com/spf13/cobra"
|
||||||
Total int64 `mapstructure:"total"`
|
"go.arsenm.dev/itd/cmd/itctl/root"
|
||||||
|
)
|
||||||
|
|
||||||
|
// watchCmd represents the watch command
|
||||||
|
var watchCmd = &cobra.Command{
|
||||||
|
Use: "watch",
|
||||||
|
Short: "Watch values from InfiniTime for changes",
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
root.RootCmd.AddCommand(watchCmd)
|
||||||
}
|
}
|
||||||
@@ -1,22 +1,17 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"image/color"
|
"image/color"
|
||||||
"net"
|
|
||||||
|
|
||||||
"encoding/json"
|
|
||||||
|
|
||||||
"fyne.io/fyne/v2"
|
"fyne.io/fyne/v2"
|
||||||
"fyne.io/fyne/v2/canvas"
|
"fyne.io/fyne/v2/canvas"
|
||||||
"fyne.io/fyne/v2/container"
|
"fyne.io/fyne/v2/container"
|
||||||
"fyne.io/fyne/v2/theme"
|
"fyne.io/fyne/v2/theme"
|
||||||
"go.arsenm.dev/itd/internal/types"
|
"go.arsenm.dev/itd/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
func infoTab(parent fyne.Window) *fyne.Container {
|
func infoTab(parent fyne.Window, client *api.Client) *fyne.Container {
|
||||||
infoLayout := container.NewVBox(
|
infoLayout := container.NewVBox(
|
||||||
// Add rectangle for a bit of padding
|
// Add rectangle for a bit of padding
|
||||||
canvas.NewRectangle(color.Transparent),
|
canvas.NewRectangle(color.Transparent),
|
||||||
@@ -25,20 +20,50 @@ func infoTab(parent fyne.Window) *fyne.Container {
|
|||||||
// Create label for heart rate
|
// Create label for heart rate
|
||||||
heartRateLbl := newText("0 BPM", 24)
|
heartRateLbl := newText("0 BPM", 24)
|
||||||
// Creae container to store heart rate section
|
// Creae container to store heart rate section
|
||||||
heartRate := container.NewVBox(
|
heartRateSect := container.NewVBox(
|
||||||
newText("Heart Rate", 12),
|
newText("Heart Rate", 12),
|
||||||
heartRateLbl,
|
heartRateLbl,
|
||||||
canvas.NewLine(theme.ShadowColor()),
|
canvas.NewLine(theme.ShadowColor()),
|
||||||
)
|
)
|
||||||
infoLayout.Add(heartRate)
|
infoLayout.Add(heartRateSect)
|
||||||
|
|
||||||
// Watch for heart rate updates
|
heartRateCh, cancel, err := client.WatchHeartRate()
|
||||||
go watch(types.ReqTypeWatchHeartRate, func(data interface{}) {
|
if err != nil {
|
||||||
// Change text of heart rate label
|
guiErr(err, "Error getting heart rate channel", true, parent)
|
||||||
heartRateLbl.Text = fmt.Sprintf("%d BPM", int(data.(float64)))
|
}
|
||||||
// Refresh label
|
onClose = append(onClose, cancel)
|
||||||
heartRateLbl.Refresh()
|
go func() {
|
||||||
}, parent)
|
for heartRate := range heartRateCh {
|
||||||
|
// Change text of heart rate label
|
||||||
|
heartRateLbl.Text = fmt.Sprintf("%d BPM", heartRate)
|
||||||
|
// Refresh label
|
||||||
|
heartRateLbl.Refresh()
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
// Create label for heart rate
|
||||||
|
stepCountLbl := newText("0 Steps", 24)
|
||||||
|
// Creae container to store heart rate section
|
||||||
|
stepCountSect := container.NewVBox(
|
||||||
|
newText("Step Count", 12),
|
||||||
|
stepCountLbl,
|
||||||
|
canvas.NewLine(theme.ShadowColor()),
|
||||||
|
)
|
||||||
|
infoLayout.Add(stepCountSect)
|
||||||
|
|
||||||
|
stepCountCh, cancel, err := client.WatchStepCount()
|
||||||
|
if err != nil {
|
||||||
|
guiErr(err, "Error getting step count channel", true, parent)
|
||||||
|
}
|
||||||
|
onClose = append(onClose, cancel)
|
||||||
|
go func() {
|
||||||
|
for stepCount := range stepCountCh {
|
||||||
|
// Change text of heart rate label
|
||||||
|
stepCountLbl.Text = fmt.Sprintf("%d Steps", stepCount)
|
||||||
|
// Refresh label
|
||||||
|
stepCountLbl.Refresh()
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
// Create label for battery level
|
// Create label for battery level
|
||||||
battLevelLbl := newText("0%", 24)
|
battLevelLbl := newText("0%", 24)
|
||||||
@@ -50,32 +75,40 @@ func infoTab(parent fyne.Window) *fyne.Container {
|
|||||||
)
|
)
|
||||||
infoLayout.Add(battLevel)
|
infoLayout.Add(battLevel)
|
||||||
|
|
||||||
// Watch for changes in battery level
|
battLevelCh, cancel, err := client.WatchBatteryLevel()
|
||||||
go watch(types.ReqTypeWatchBattLevel, func(data interface{}) {
|
if err != nil {
|
||||||
battLevelLbl.Text = fmt.Sprintf("%d%%", int(data.(float64)))
|
guiErr(err, "Error getting battery level channel", true, parent)
|
||||||
battLevelLbl.Refresh()
|
}
|
||||||
}, parent)
|
onClose = append(onClose, cancel)
|
||||||
|
go func() {
|
||||||
|
for battLevel := range battLevelCh {
|
||||||
|
// Change text of battery level label
|
||||||
|
battLevelLbl.Text = fmt.Sprintf("%d%%", battLevel)
|
||||||
|
// Refresh label
|
||||||
|
battLevelLbl.Refresh()
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
fwVerString, err := get(types.ReqTypeFwVersion)
|
fwVerString, err := client.Version()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
guiErr(err, "Error getting firmware string", true, parent)
|
guiErr(err, "Error getting firmware string", true, parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
fwVer := container.NewVBox(
|
fwVer := container.NewVBox(
|
||||||
newText("Firmware Version", 12),
|
newText("Firmware Version", 12),
|
||||||
newText(fwVerString.(string), 24),
|
newText(fwVerString, 24),
|
||||||
canvas.NewLine(theme.ShadowColor()),
|
canvas.NewLine(theme.ShadowColor()),
|
||||||
)
|
)
|
||||||
infoLayout.Add(fwVer)
|
infoLayout.Add(fwVer)
|
||||||
|
|
||||||
btAddrString, err := get(types.ReqTypeBtAddress)
|
btAddrString, err := client.Address()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
btAddr := container.NewVBox(
|
btAddr := container.NewVBox(
|
||||||
newText("Bluetooth Address", 12),
|
newText("Bluetooth Address", 12),
|
||||||
newText(btAddrString.(string), 24),
|
newText(btAddrString, 24),
|
||||||
canvas.NewLine(theme.ShadowColor()),
|
canvas.NewLine(theme.ShadowColor()),
|
||||||
)
|
)
|
||||||
infoLayout.Add(btAddr)
|
infoLayout.Add(btAddr)
|
||||||
@@ -83,65 +116,6 @@ func infoTab(parent fyne.Window) *fyne.Container {
|
|||||||
return infoLayout
|
return infoLayout
|
||||||
}
|
}
|
||||||
|
|
||||||
func watch(req int, onRecv func(data interface{}), parent fyne.Window) error {
|
|
||||||
conn, err := net.Dial("unix", SockPath)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
defer conn.Close()
|
|
||||||
err = json.NewEncoder(conn).Encode(types.Request{
|
|
||||||
Type: req,
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
scanner := bufio.NewScanner(conn)
|
|
||||||
for scanner.Scan() {
|
|
||||||
res, err := getResp(scanner.Bytes())
|
|
||||||
if err != nil {
|
|
||||||
guiErr(err, "Error getting response from connection", false, parent)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
onRecv(res.Value)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func get(req int) (interface{}, error) {
|
|
||||||
conn, err := net.Dial("unix", SockPath)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
defer conn.Close()
|
|
||||||
err = json.NewEncoder(conn).Encode(types.Request{
|
|
||||||
Type: req,
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
line, _, err := bufio.NewReader(conn).ReadLine()
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
res, err := getResp(line)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return res.Value, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func getResp(line []byte) (*types.Response, error) {
|
|
||||||
var res types.Response
|
|
||||||
err := json.Unmarshal(line, &res)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if res.Error {
|
|
||||||
return nil, errors.New(res.Message)
|
|
||||||
}
|
|
||||||
return &res, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func newText(t string, size float32) *canvas.Text {
|
func newText(t string, size float32) *canvas.Text {
|
||||||
text := canvas.NewText(t, theme.ForegroundColor())
|
text := canvas.NewText(t, theme.ForegroundColor())
|
||||||
text.TextSize = size
|
text.TextSize = size
|
||||||
|
|||||||
@@ -1,31 +1,39 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net"
|
|
||||||
|
|
||||||
"fyne.io/fyne/v2/app"
|
"fyne.io/fyne/v2/app"
|
||||||
"fyne.io/fyne/v2/container"
|
"fyne.io/fyne/v2/container"
|
||||||
|
"go.arsenm.dev/itd/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
var SockPath = "/tmp/itd/socket"
|
var onClose []func()
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// Create new app
|
// Create new app
|
||||||
a := app.New()
|
a := app.New()
|
||||||
// Create new window with title "itgui"
|
// Create new window with title "itgui"
|
||||||
window := a.NewWindow("itgui")
|
window := a.NewWindow("itgui")
|
||||||
|
window.SetOnClosed(func() {
|
||||||
|
for _, closeFn := range onClose {
|
||||||
|
closeFn()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
_, err := net.Dial("unix", SockPath)
|
client, err := api.New(api.DefaultAddr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
guiErr(err, "Error dialing itd socket", true, window)
|
guiErr(err, "Error connecting to itd", true, window)
|
||||||
}
|
}
|
||||||
|
onClose = append(onClose, func() {
|
||||||
|
client.Close()
|
||||||
|
})
|
||||||
|
|
||||||
// Create new app tabs container
|
// Create new app tabs container
|
||||||
tabs := container.NewAppTabs(
|
tabs := container.NewAppTabs(
|
||||||
container.NewTabItem("Info", infoTab(window)),
|
container.NewTabItem("Info", infoTab(window, client)),
|
||||||
container.NewTabItem("Notify", notifyTab(window)),
|
container.NewTabItem("Motion", motionTab(window, client)),
|
||||||
container.NewTabItem("Set Time", timeTab(window)),
|
container.NewTabItem("Notify", notifyTab(window, client)),
|
||||||
container.NewTabItem("Upgrade", upgradeTab(window)),
|
container.NewTabItem("Set Time", timeTab(window, client)),
|
||||||
|
container.NewTabItem("Upgrade", upgradeTab(window, client)),
|
||||||
)
|
)
|
||||||
|
|
||||||
// Set tabs as window content
|
// Set tabs as window content
|
||||||
|
|||||||
105
cmd/itgui/motion.go
Normal file
105
cmd/itgui/motion.go
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"image/color"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"fyne.io/fyne/v2"
|
||||||
|
"fyne.io/fyne/v2/canvas"
|
||||||
|
"fyne.io/fyne/v2/container"
|
||||||
|
"fyne.io/fyne/v2/theme"
|
||||||
|
"fyne.io/fyne/v2/widget"
|
||||||
|
"go.arsenm.dev/itd/api"
|
||||||
|
)
|
||||||
|
|
||||||
|
func motionTab(parent fyne.Window, client *api.Client) *fyne.Container {
|
||||||
|
// Create label for heart rate
|
||||||
|
xCoordLbl := newText("0", 24)
|
||||||
|
// Creae container to store heart rate section
|
||||||
|
xCoordSect := container.NewVBox(
|
||||||
|
newText("X Coordinate", 12),
|
||||||
|
xCoordLbl,
|
||||||
|
canvas.NewLine(theme.ShadowColor()),
|
||||||
|
)
|
||||||
|
|
||||||
|
// Create label for heart rate
|
||||||
|
yCoordLbl := newText("0", 24)
|
||||||
|
// Creae container to store heart rate section
|
||||||
|
yCoordSect := container.NewVBox(
|
||||||
|
newText("Y Coordinate", 12),
|
||||||
|
yCoordLbl,
|
||||||
|
canvas.NewLine(theme.ShadowColor()),
|
||||||
|
)
|
||||||
|
// Create label for heart rate
|
||||||
|
zCoordLbl := newText("0", 24)
|
||||||
|
// Creae container to store heart rate section
|
||||||
|
zCoordSect := container.NewVBox(
|
||||||
|
newText("Z Coordinate", 12),
|
||||||
|
zCoordLbl,
|
||||||
|
canvas.NewLine(theme.ShadowColor()),
|
||||||
|
)
|
||||||
|
|
||||||
|
// Create variable to keep track of whether motion started
|
||||||
|
started := false
|
||||||
|
|
||||||
|
// Create button to stop motion
|
||||||
|
stopBtn := widget.NewButton("Stop", nil)
|
||||||
|
// Create button to start motion
|
||||||
|
startBtn := widget.NewButton("Start", func() {
|
||||||
|
// if motion is started
|
||||||
|
if started {
|
||||||
|
// Do nothing
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// Set motion started
|
||||||
|
started = true
|
||||||
|
// Watch motion values
|
||||||
|
motionCh, cancel, err := client.WatchMotion()
|
||||||
|
if err != nil {
|
||||||
|
guiErr(err, "Error getting heart rate channel", true, parent)
|
||||||
|
}
|
||||||
|
// Create done channel
|
||||||
|
done := make(chan struct{}, 1)
|
||||||
|
go func() {
|
||||||
|
for {
|
||||||
|
select {
|
||||||
|
case <-done:
|
||||||
|
return
|
||||||
|
case motion := <-motionCh:
|
||||||
|
// Set labels to new values
|
||||||
|
xCoordLbl.Text = strconv.Itoa(int(motion.X))
|
||||||
|
yCoordLbl.Text = strconv.Itoa(int(motion.Y))
|
||||||
|
zCoordLbl.Text = strconv.Itoa(int(motion.Z))
|
||||||
|
// Refresh labels to display new values
|
||||||
|
xCoordLbl.Refresh()
|
||||||
|
yCoordLbl.Refresh()
|
||||||
|
zCoordLbl.Refresh()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
// Create stop function
|
||||||
|
stopBtn.OnTapped = func() {
|
||||||
|
done <- struct{}{}
|
||||||
|
started = false
|
||||||
|
cancel()
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
// Run stop button function on close if possible
|
||||||
|
onClose = append(onClose, func() {
|
||||||
|
if stopBtn.OnTapped != nil {
|
||||||
|
stopBtn.OnTapped()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// Return new container containing all elements
|
||||||
|
return container.NewVBox(
|
||||||
|
// Add rectangle for a bit of padding
|
||||||
|
canvas.NewRectangle(color.Transparent),
|
||||||
|
startBtn,
|
||||||
|
stopBtn,
|
||||||
|
xCoordSect,
|
||||||
|
yCoordSect,
|
||||||
|
zCoordSect,
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -1,17 +1,14 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
|
||||||
"net"
|
|
||||||
|
|
||||||
"fyne.io/fyne/v2"
|
"fyne.io/fyne/v2"
|
||||||
"fyne.io/fyne/v2/container"
|
"fyne.io/fyne/v2/container"
|
||||||
"fyne.io/fyne/v2/layout"
|
"fyne.io/fyne/v2/layout"
|
||||||
"fyne.io/fyne/v2/widget"
|
"fyne.io/fyne/v2/widget"
|
||||||
"go.arsenm.dev/itd/internal/types"
|
"go.arsenm.dev/itd/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
func notifyTab(parent fyne.Window) *fyne.Container {
|
func notifyTab(parent fyne.Window, client *api.Client) *fyne.Container {
|
||||||
// Create new entry for notification title
|
// Create new entry for notification title
|
||||||
titleEntry := widget.NewEntry()
|
titleEntry := widget.NewEntry()
|
||||||
titleEntry.SetPlaceHolder("Title")
|
titleEntry.SetPlaceHolder("Title")
|
||||||
@@ -22,20 +19,11 @@ func notifyTab(parent fyne.Window) *fyne.Container {
|
|||||||
|
|
||||||
// Create new button to send notification
|
// Create new button to send notification
|
||||||
sendBtn := widget.NewButton("Send", func() {
|
sendBtn := widget.NewButton("Send", func() {
|
||||||
// Dial itd UNIX socket
|
err := client.Notify(titleEntry.Text, bodyEntry.Text)
|
||||||
conn, err := net.Dial("unix", SockPath)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
guiErr(err, "Error dialing socket", false, parent)
|
guiErr(err, "Error sending notification", false, parent)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// Encode notify request on connection
|
|
||||||
json.NewEncoder(conn).Encode(types.Request{
|
|
||||||
Type: types.ReqTypeNotify,
|
|
||||||
Data: types.ReqDataNotify{
|
|
||||||
Title: titleEntry.Text,
|
|
||||||
Body: bodyEntry.Text,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// Return new container containing all elements
|
// Return new container containing all elements
|
||||||
|
|||||||
@@ -1,18 +1,16 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
|
||||||
"net"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"fyne.io/fyne/v2"
|
"fyne.io/fyne/v2"
|
||||||
"fyne.io/fyne/v2/container"
|
"fyne.io/fyne/v2/container"
|
||||||
"fyne.io/fyne/v2/layout"
|
"fyne.io/fyne/v2/layout"
|
||||||
"fyne.io/fyne/v2/widget"
|
"fyne.io/fyne/v2/widget"
|
||||||
"go.arsenm.dev/itd/internal/types"
|
"go.arsenm.dev/itd/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
func timeTab(parent fyne.Window) *fyne.Container {
|
func timeTab(parent fyne.Window, client *api.Client) *fyne.Container {
|
||||||
// Create new entry for time string
|
// Create new entry for time string
|
||||||
timeEntry := widget.NewEntry()
|
timeEntry := widget.NewEntry()
|
||||||
// Set text to current time formatter properly
|
// Set text to current time formatter properly
|
||||||
@@ -21,7 +19,7 @@ func timeTab(parent fyne.Window) *fyne.Container {
|
|||||||
// Create button to set current time
|
// Create button to set current time
|
||||||
currentBtn := widget.NewButton("Set Current", func() {
|
currentBtn := widget.NewButton("Set Current", func() {
|
||||||
timeEntry.SetText(time.Now().Format(time.RFC1123))
|
timeEntry.SetText(time.Now().Format(time.RFC1123))
|
||||||
setTime(true)
|
setTime(client, true)
|
||||||
})
|
})
|
||||||
|
|
||||||
// Create button to set time inside entry
|
// Create button to set time inside entry
|
||||||
@@ -33,7 +31,7 @@ func timeTab(parent fyne.Window) *fyne.Container {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
// Set time to parsed time
|
// Set time to parsed time
|
||||||
setTime(false, parsedTime)
|
setTime(client, false, parsedTime)
|
||||||
})
|
})
|
||||||
|
|
||||||
// Return new container with all elements centered
|
// Return new container with all elements centered
|
||||||
@@ -48,30 +46,13 @@ func timeTab(parent fyne.Window) *fyne.Container {
|
|||||||
|
|
||||||
// setTime sets the first element in the variadic parameter
|
// setTime sets the first element in the variadic parameter
|
||||||
// if current is false, otherwise, it sets the current time.
|
// if current is false, otherwise, it sets the current time.
|
||||||
func setTime(current bool, t ...time.Time) error {
|
func setTime(client *api.Client, current bool, t ...time.Time) error {
|
||||||
// Dial UNIX socket
|
var err error
|
||||||
conn, err := net.Dial("unix", SockPath)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
defer conn.Close()
|
|
||||||
var data string
|
|
||||||
// If current is true, use the string "now"
|
|
||||||
// otherwise, use the formatted time from the
|
|
||||||
// first element in the variadic parameter.
|
|
||||||
// "now" is more accurate than formatting
|
|
||||||
// current time as only seconds are preserved
|
|
||||||
// in that case.
|
|
||||||
if current {
|
if current {
|
||||||
data = "now"
|
err = client.SetTimeNow()
|
||||||
} else {
|
} else {
|
||||||
data = t[0].Format(time.RFC3339)
|
err = client.SetTime(t[0])
|
||||||
}
|
}
|
||||||
// Encode SetTime request with above data
|
|
||||||
err = json.NewEncoder(conn).Encode(types.Request{
|
|
||||||
Type: types.ReqTypeSetTime,
|
|
||||||
Data: data,
|
|
||||||
})
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"path/filepath"
|
||||||
|
|
||||||
"fyne.io/fyne/v2"
|
"fyne.io/fyne/v2"
|
||||||
"fyne.io/fyne/v2/container"
|
"fyne.io/fyne/v2/container"
|
||||||
@@ -12,17 +10,18 @@ import (
|
|||||||
"fyne.io/fyne/v2/layout"
|
"fyne.io/fyne/v2/layout"
|
||||||
"fyne.io/fyne/v2/storage"
|
"fyne.io/fyne/v2/storage"
|
||||||
"fyne.io/fyne/v2/widget"
|
"fyne.io/fyne/v2/widget"
|
||||||
"github.com/mitchellh/mapstructure"
|
"go.arsenm.dev/itd/api"
|
||||||
"go.arsenm.dev/itd/internal/types"
|
"go.arsenm.dev/itd/internal/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func upgradeTab(parent fyne.Window) *fyne.Container {
|
func upgradeTab(parent fyne.Window, client *api.Client) *fyne.Container {
|
||||||
var (
|
var (
|
||||||
archivePath string
|
archivePath string
|
||||||
fiwmarePath string
|
firmwarePath string
|
||||||
initPktPath string
|
initPktPath string
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var archiveBtn *widget.Button
|
||||||
// Create archive selection dialog
|
// Create archive selection dialog
|
||||||
archiveDialog := dialog.NewFileOpen(func(uc fyne.URIReadCloser, e error) {
|
archiveDialog := dialog.NewFileOpen(func(uc fyne.URIReadCloser, e error) {
|
||||||
if e != nil || uc == nil {
|
if e != nil || uc == nil {
|
||||||
@@ -30,25 +29,29 @@ func upgradeTab(parent fyne.Window) *fyne.Container {
|
|||||||
}
|
}
|
||||||
uc.Close()
|
uc.Close()
|
||||||
archivePath = uc.URI().Path()
|
archivePath = uc.URI().Path()
|
||||||
|
archiveBtn.SetText(fmt.Sprintf("Select archive (.zip) [%s]", filepath.Base(archivePath)))
|
||||||
}, parent)
|
}, parent)
|
||||||
// Limit dialog to .zip files
|
// Limit dialog to .zip files
|
||||||
archiveDialog.SetFilter(storage.NewExtensionFileFilter([]string{".zip"}))
|
archiveDialog.SetFilter(storage.NewExtensionFileFilter([]string{".zip"}))
|
||||||
// Create button to show dialog
|
// Create button to show dialog
|
||||||
archiveBtn := widget.NewButton("Select archive (.zip)", archiveDialog.Show)
|
archiveBtn = widget.NewButton("Select archive (.zip)", archiveDialog.Show)
|
||||||
|
|
||||||
|
var firmwareBtn *widget.Button
|
||||||
// Create firmware selection dialog
|
// Create firmware selection dialog
|
||||||
firmwareDialog := dialog.NewFileOpen(func(uc fyne.URIReadCloser, e error) {
|
firmwareDialog := dialog.NewFileOpen(func(uc fyne.URIReadCloser, e error) {
|
||||||
if e != nil || uc == nil {
|
if e != nil || uc == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
uc.Close()
|
uc.Close()
|
||||||
fiwmarePath = uc.URI().Path()
|
firmwarePath = uc.URI().Path()
|
||||||
|
firmwareBtn.SetText(fmt.Sprintf("Select firmware (.bin) [%s]", filepath.Base(firmwarePath)))
|
||||||
}, parent)
|
}, parent)
|
||||||
// Limit dialog to .bin files
|
// Limit dialog to .bin files
|
||||||
firmwareDialog.SetFilter(storage.NewExtensionFileFilter([]string{".bin"}))
|
firmwareDialog.SetFilter(storage.NewExtensionFileFilter([]string{".bin"}))
|
||||||
// Create button to show dialog
|
// Create button to show dialog
|
||||||
firmwareBtn := widget.NewButton("Select init packet (.bin)", firmwareDialog.Show)
|
firmwareBtn = widget.NewButton("Select firmware (.bin)", firmwareDialog.Show)
|
||||||
|
|
||||||
|
var initPktBtn *widget.Button
|
||||||
// Create init packet selection dialog
|
// Create init packet selection dialog
|
||||||
initPktDialog := dialog.NewFileOpen(func(uc fyne.URIReadCloser, e error) {
|
initPktDialog := dialog.NewFileOpen(func(uc fyne.URIReadCloser, e error) {
|
||||||
if e != nil || uc == nil {
|
if e != nil || uc == nil {
|
||||||
@@ -56,11 +59,12 @@ func upgradeTab(parent fyne.Window) *fyne.Container {
|
|||||||
}
|
}
|
||||||
uc.Close()
|
uc.Close()
|
||||||
initPktPath = uc.URI().Path()
|
initPktPath = uc.URI().Path()
|
||||||
|
initPktBtn.SetText(fmt.Sprintf("Select init packet (.dat) [%s]", filepath.Base(initPktPath)))
|
||||||
}, parent)
|
}, parent)
|
||||||
// Limit dialog to .dat files
|
// Limit dialog to .dat files
|
||||||
initPktDialog.SetFilter(storage.NewExtensionFileFilter([]string{".dat"}))
|
initPktDialog.SetFilter(storage.NewExtensionFileFilter([]string{".dat"}))
|
||||||
// Create button to show dialog
|
// Create button to show dialog
|
||||||
initPktBtn := widget.NewButton("Select init packet (.dat)", initPktDialog.Show)
|
initPktBtn = widget.NewButton("Select init packet (.dat)", initPktDialog.Show)
|
||||||
|
|
||||||
// Hide init packet and firmware buttons
|
// Hide init packet and firmware buttons
|
||||||
initPktBtn.Hide()
|
initPktBtn.Hide()
|
||||||
@@ -91,7 +95,7 @@ func upgradeTab(parent fyne.Window) *fyne.Container {
|
|||||||
startBtn := widget.NewButton("Start", func() {
|
startBtn := widget.NewButton("Start", func() {
|
||||||
// If archive path does not exist and both init packet and firmware paths
|
// If archive path does not exist and both init packet and firmware paths
|
||||||
// also do not exist, return error
|
// also do not exist, return error
|
||||||
if archivePath == "" && (initPktPath == "" && fiwmarePath == "") {
|
if archivePath == "" && (initPktPath == "" && firmwarePath == "") {
|
||||||
guiErr(nil, "Upgrade requires archive or files selected", false, parent)
|
guiErr(nil, "Upgrade requires archive or files selected", false, parent)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -110,7 +114,7 @@ func upgradeTab(parent fyne.Window) *fyne.Container {
|
|||||||
// Resize modal to 300x100
|
// Resize modal to 300x100
|
||||||
progressDlg.Resize(fyne.NewSize(300, 100))
|
progressDlg.Resize(fyne.NewSize(300, 100))
|
||||||
|
|
||||||
var fwUpgType int
|
var fwUpgType api.UpgradeType
|
||||||
var files []string
|
var files []string
|
||||||
// Get appropriate upgrade type and file paths
|
// Get appropriate upgrade type and file paths
|
||||||
switch upgradeTypeSelect.Selected {
|
switch upgradeTypeSelect.Selected {
|
||||||
@@ -119,51 +123,19 @@ func upgradeTab(parent fyne.Window) *fyne.Container {
|
|||||||
files = append(files, archivePath)
|
files = append(files, archivePath)
|
||||||
case "Files":
|
case "Files":
|
||||||
fwUpgType = types.UpgradeTypeFiles
|
fwUpgType = types.UpgradeTypeFiles
|
||||||
files = append(files, initPktPath, fiwmarePath)
|
files = append(files, initPktPath, firmwarePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dial itd UNIX socket
|
progress, err := client.FirmwareUpgrade(fwUpgType, files...)
|
||||||
conn, err := net.Dial("unix", SockPath)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
guiErr(err, "Error dialing socket", false, parent)
|
guiErr(err, "Error initiating DFU", false, parent)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer conn.Close()
|
|
||||||
|
|
||||||
// Encode firmware upgrade request to connection
|
|
||||||
json.NewEncoder(conn).Encode(types.Request{
|
|
||||||
Type: types.ReqTypeFwUpgrade,
|
|
||||||
Data: types.ReqDataFwUpgrade{
|
|
||||||
Type: fwUpgType,
|
|
||||||
Files: files,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
// Show progress dialog
|
// Show progress dialog
|
||||||
progressDlg.Show()
|
progressDlg.Show()
|
||||||
// Hide progress dialog after completion
|
|
||||||
defer progressDlg.Hide()
|
|
||||||
|
|
||||||
scanner := bufio.NewScanner(conn)
|
for event := range progress {
|
||||||
for scanner.Scan() {
|
|
||||||
var res types.Response
|
|
||||||
// Decode scanned line into response struct
|
|
||||||
err = json.Unmarshal(scanner.Bytes(), &res)
|
|
||||||
if err != nil {
|
|
||||||
guiErr(err, "Error decoding response", false, parent)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if res.Error {
|
|
||||||
guiErr(err, "Error returned in response", false, parent)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var event types.DFUProgress
|
|
||||||
// Decode response data into progress struct
|
|
||||||
err = mapstructure.Decode(res.Value, &event)
|
|
||||||
if err != nil {
|
|
||||||
guiErr(err, "Error decoding response value", false, parent)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// Set label text to received / total B
|
// Set label text to received / total B
|
||||||
progressLbl.SetText(fmt.Sprintf("%d / %d B", event.Received, event.Total))
|
progressLbl.SetText(fmt.Sprintf("%d / %d B", event.Received, event.Total))
|
||||||
// Set progress bar values
|
// Set progress bar values
|
||||||
@@ -172,10 +144,28 @@ func upgradeTab(parent fyne.Window) *fyne.Container {
|
|||||||
// Refresh progress bar
|
// Refresh progress bar
|
||||||
progressBar.Refresh()
|
progressBar.Refresh()
|
||||||
// If transfer finished, break
|
// If transfer finished, break
|
||||||
if event.Received == event.Total {
|
if event.Sent == event.Total {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hide progress dialog after completion
|
||||||
|
progressDlg.Hide()
|
||||||
|
|
||||||
|
// Reset screen to default
|
||||||
|
upgradeTypeSelect.SetSelectedIndex(0)
|
||||||
|
firmwareBtn.SetText("Select firmware (.bin)")
|
||||||
|
initPktBtn.SetText("Select init packet (.dat)")
|
||||||
|
archiveBtn.SetText("Select archive (.zip)")
|
||||||
|
firmwarePath = ""
|
||||||
|
initPktPath = ""
|
||||||
|
archivePath = ""
|
||||||
|
|
||||||
|
dialog.NewInformation(
|
||||||
|
"Upgrade Complete",
|
||||||
|
"The firmware was transferred successfully.\nRemember to validate the firmware in InfiniTime settings.",
|
||||||
|
parent,
|
||||||
|
).Show()
|
||||||
})
|
})
|
||||||
|
|
||||||
// Return container containing all elements
|
// Return container containing all elements
|
||||||
|
|||||||
@@ -28,17 +28,21 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func setCfgDefaults() {
|
func setCfgDefaults() {
|
||||||
viper.SetDefault("cfg.version", 2)
|
|
||||||
|
|
||||||
viper.SetDefault("socket.path", "/tmp/itd/socket")
|
viper.SetDefault("socket.path", "/tmp/itd/socket")
|
||||||
|
|
||||||
viper.SetDefault("conn.reconnect", true)
|
viper.SetDefault("conn.reconnect", true)
|
||||||
|
|
||||||
|
viper.SetDefault("conn.whitelist.enabled", false)
|
||||||
|
viper.SetDefault("conn.whitelist.devices", []string{})
|
||||||
|
|
||||||
viper.SetDefault("on.connect.notify", true)
|
viper.SetDefault("on.connect.notify", true)
|
||||||
|
|
||||||
viper.SetDefault("on.reconnect.notify", true)
|
viper.SetDefault("on.reconnect.notify", true)
|
||||||
viper.SetDefault("on.reconnect.setTime", true)
|
viper.SetDefault("on.reconnect.setTime", true)
|
||||||
|
|
||||||
|
viper.SetDefault("notifs.translit.use", []string{"eASCII"})
|
||||||
|
viper.SetDefault("notifs.translit.custom", []string{})
|
||||||
|
|
||||||
viper.SetDefault("notifs.ignore.sender", []string{})
|
viper.SetDefault("notifs.ignore.sender", []string{})
|
||||||
viper.SetDefault("notifs.ignore.summary", []string{"InfiniTime"})
|
viper.SetDefault("notifs.ignore.summary", []string{"InfiniTime"})
|
||||||
viper.SetDefault("notifs.ignore.body", []string{})
|
viper.SetDefault("notifs.ignore.body", []string{})
|
||||||
|
|||||||
37
dbus.go
Normal file
37
dbus.go
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import "github.com/godbus/dbus/v5"
|
||||||
|
|
||||||
|
func newSystemBusConn() (*dbus.Conn, error) {
|
||||||
|
// Connect to dbus session bus
|
||||||
|
conn, err := dbus.SystemBusPrivate()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
err = conn.Auth(nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
err = conn.Hello()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return conn, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func newSessionBusConn() (*dbus.Conn, error) {
|
||||||
|
// Connect to dbus session bus
|
||||||
|
conn, err := dbus.SessionBusPrivate()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
err = conn.Auth(nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
err = conn.Hello()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return conn, nil
|
||||||
|
}
|
||||||
28
go.mod
28
go.mod
@@ -3,25 +3,31 @@ module go.arsenm.dev/itd
|
|||||||
go 1.16
|
go 1.16
|
||||||
|
|
||||||
require (
|
require (
|
||||||
fyne.io/fyne/v2 v2.0.4
|
fyne.io/fyne/v2 v2.1.0
|
||||||
github.com/VividCortex/ewma v1.2.0 // indirect
|
github.com/VividCortex/ewma v1.2.0 // indirect
|
||||||
github.com/abiosoft/ishell v2.0.0+incompatible
|
github.com/abiosoft/ishell v2.0.0+incompatible
|
||||||
github.com/abiosoft/readline v0.0.0-20180607040430-155bce2042db // indirect
|
github.com/abiosoft/readline v0.0.0-20180607040430-155bce2042db // indirect
|
||||||
github.com/cheggaaa/pb/v3 v3.0.8
|
github.com/cheggaaa/pb/v3 v3.0.8
|
||||||
github.com/fatih/color v1.12.0 // indirect
|
github.com/fatih/color v1.13.0 // indirect
|
||||||
github.com/flynn-archive/go-shlex v0.0.0-20150515145356-3f9db97f8568 // indirect
|
github.com/flynn-archive/go-shlex v0.0.0-20150515145356-3f9db97f8568 // indirect
|
||||||
github.com/fsnotify/fsnotify v1.5.0 // indirect
|
github.com/go-gl/gl v0.0.0-20210905235341-f7a045908259 // indirect
|
||||||
github.com/godbus/dbus/v5 v5.0.4
|
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210727001814-0db043d8d5be // indirect
|
||||||
github.com/mattn/go-isatty v0.0.13 // indirect
|
github.com/godbus/dbus/v5 v5.0.5
|
||||||
|
github.com/google/uuid v1.1.2
|
||||||
|
github.com/mattn/go-colorable v0.1.11 // indirect
|
||||||
github.com/mattn/go-runewidth v0.0.13 // indirect
|
github.com/mattn/go-runewidth v0.0.13 // indirect
|
||||||
github.com/mitchellh/mapstructure v1.4.1
|
github.com/mitchellh/mapstructure v1.4.2
|
||||||
github.com/mozillazg/go-pinyin v0.18.0
|
github.com/mozillazg/go-pinyin v0.18.0
|
||||||
github.com/rs/zerolog v1.23.0
|
github.com/rs/zerolog v1.25.0
|
||||||
github.com/sirupsen/logrus v1.8.1 // indirect
|
github.com/sirupsen/logrus v1.8.1 // indirect
|
||||||
github.com/spf13/cast v1.4.1 // indirect
|
|
||||||
github.com/spf13/cobra v1.2.1
|
github.com/spf13/cobra v1.2.1
|
||||||
github.com/spf13/viper v1.8.1
|
github.com/spf13/viper v1.9.0
|
||||||
go.arsenm.dev/infinitime v0.0.0-20210825051734-745b4bd37cf4
|
github.com/srwiley/oksvg v0.0.0-20210519022825-9fc0c575d5fe // indirect
|
||||||
golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf // indirect
|
github.com/srwiley/rasterx v0.0.0-20210519020934-456a8d69b780 // indirect
|
||||||
|
github.com/yuin/goldmark v1.4.1 // indirect
|
||||||
|
go.arsenm.dev/infinitime v0.0.0-20211126043306-522c10a9c0a7
|
||||||
|
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d // indirect
|
||||||
|
golang.org/x/net v0.0.0-20211011170408-caeb26a5c8c0 // indirect
|
||||||
|
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac // indirect
|
||||||
golang.org/x/text v0.3.7
|
golang.org/x/text v0.3.7
|
||||||
)
|
)
|
||||||
|
|||||||
184
go.sum
184
go.sum
@@ -18,6 +18,11 @@ cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmW
|
|||||||
cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg=
|
cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg=
|
||||||
cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8=
|
cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8=
|
||||||
cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0=
|
cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0=
|
||||||
|
cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY=
|
||||||
|
cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM=
|
||||||
|
cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY=
|
||||||
|
cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ=
|
||||||
|
cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI=
|
||||||
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
|
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
|
||||||
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
|
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
|
||||||
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
|
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
|
||||||
@@ -27,6 +32,7 @@ cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM7
|
|||||||
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
|
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
|
||||||
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
|
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
|
||||||
cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk=
|
cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk=
|
||||||
|
cloud.google.com/go/firestore v1.6.0/go.mod h1:afJwI0vaXwAG54kI7A//lP/lSPDkQORQuMkv56TxEPU=
|
||||||
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
|
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
|
||||||
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
|
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
|
||||||
cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
|
cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
|
||||||
@@ -37,11 +43,13 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
|
|||||||
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
||||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||||
fyne.io/fyne/v2 v2.0.4 h1:eDGaPGzeR4qNqWuAp9Li1kY4eVIHldCkf42KMakKIK4=
|
fyne.io/fyne/v2 v2.1.0 h1:qzdkaXL/UpmMtG4FlsX9xMZ0Q93CRzLxkoiSXyplP/I=
|
||||||
fyne.io/fyne/v2 v2.0.4/go.mod h1:nNpgL7sZkDVLraGtQII2ArNRnnl6kHup/KfQRxIhbvs=
|
fyne.io/fyne/v2 v2.1.0/go.mod h1:c1vwI38Ebd0dAdxVa6H1Pj6/+cK1xtDy61+I31g+s14=
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
|
github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
|
||||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||||
github.com/Kodeworks/golang-image-ico v0.0.0-20141118225523-73f0f4cfade9/go.mod h1:7uhhqiBaR4CpN0k9rMjOtjpcfGd6DG2m04zQxKnWQ0I=
|
github.com/Kodeworks/golang-image-ico v0.0.0-20141118225523-73f0f4cfade9/go.mod h1:7uhhqiBaR4CpN0k9rMjOtjpcfGd6DG2m04zQxKnWQ0I=
|
||||||
|
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
|
||||||
github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA=
|
github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA=
|
||||||
github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow=
|
github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow=
|
||||||
github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4=
|
github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4=
|
||||||
@@ -54,9 +62,11 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd
|
|||||||
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
|
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
|
||||||
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
|
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
|
||||||
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
|
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
|
||||||
|
github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
|
||||||
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
|
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
|
||||||
github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM=
|
github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM=
|
||||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||||
|
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
|
||||||
github.com/cheggaaa/pb/v3 v3.0.8 h1:bC8oemdChbke2FHIIGy9mn4DPJ2caZYQnfbRqwmdCoA=
|
github.com/cheggaaa/pb/v3 v3.0.8 h1:bC8oemdChbke2FHIIGy9mn4DPJ2caZYQnfbRqwmdCoA=
|
||||||
github.com/cheggaaa/pb/v3 v3.0.8/go.mod h1:UICbiLec/XO6Hw6k+BHEtHeQFzzBH4i2/qk/ow1EJTA=
|
github.com/cheggaaa/pb/v3 v3.0.8/go.mod h1:UICbiLec/XO6Hw6k+BHEtHeQFzzBH4i2/qk/ow1EJTA=
|
||||||
github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE=
|
github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE=
|
||||||
@@ -68,8 +78,10 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk
|
|||||||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
||||||
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
||||||
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
||||||
|
github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||||
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||||
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
|
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
|
||||||
|
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
|
||||||
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
|
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
@@ -80,11 +92,13 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
|
|||||||
github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
|
github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
|
||||||
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
||||||
github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
||||||
|
github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
|
||||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||||
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||||
|
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
|
||||||
github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
|
github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
|
||||||
github.com/fatih/color v1.12.0 h1:mRhaKNwANqRgUBGKmnI5ZxEk7QXmjQeCcuYFMX2bfcc=
|
github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
|
||||||
github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
|
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
|
||||||
github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo=
|
github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo=
|
||||||
github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
|
github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
|
||||||
github.com/flynn-archive/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BMXYYRWTLOJKlh+lOBt6nUQgXAfB7oVIQt5cNreqSLI=
|
github.com/flynn-archive/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BMXYYRWTLOJKlh+lOBt6nUQgXAfB7oVIQt5cNreqSLI=
|
||||||
@@ -92,22 +106,24 @@ github.com/flynn-archive/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:r
|
|||||||
github.com/fredbi/uri v0.0.0-20181227131451-3dcfdacbaaf3 h1:FDqhDm7pcsLhhWl1QtD8vlzI4mm59llRvNzrFg6/LAA=
|
github.com/fredbi/uri v0.0.0-20181227131451-3dcfdacbaaf3 h1:FDqhDm7pcsLhhWl1QtD8vlzI4mm59llRvNzrFg6/LAA=
|
||||||
github.com/fredbi/uri v0.0.0-20181227131451-3dcfdacbaaf3/go.mod h1:CzM2G82Q9BDUvMTGHnXf/6OExw/Dz2ivDj48nVg7Lg8=
|
github.com/fredbi/uri v0.0.0-20181227131451-3dcfdacbaaf3/go.mod h1:CzM2G82Q9BDUvMTGHnXf/6OExw/Dz2ivDj48nVg7Lg8=
|
||||||
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
||||||
github.com/fsnotify/fsnotify v1.5.0 h1:NO5hkcB+srp1x6QmwvNZLeaOgbM8cmBTN32THzjvu2k=
|
github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI=
|
||||||
github.com/fsnotify/fsnotify v1.5.0/go.mod h1:BX0DCEr5pT4jm2CnQdVP1lFV521fcCNcyEeNp4DQQDk=
|
github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU=
|
||||||
github.com/fyne-io/mobile v0.1.3-0.20210412090810-650a3139866a h1:3TAJhl8vXyli0tooKB0vd6gLCyBdWL4QEYbDoJpHEZk=
|
|
||||||
github.com/fyne-io/mobile v0.1.3-0.20210412090810-650a3139866a/go.mod h1:/kOrWrZB6sasLbEy2JIvr4arEzQTXBTZGb3Y96yWbHY=
|
|
||||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||||
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7 h1:SCYMcCJ89LjRGwEa0tRluNRiMjZHalQZrVrvTbPh+qw=
|
github.com/go-gl/gl v0.0.0-20210813123233-e4099ee2221f/go.mod h1:wjpnOv6ONl2SuJSxqCPVaPZibGFdSci9HFocT9qtVYM=
|
||||||
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk=
|
github.com/go-gl/gl v0.0.0-20210905235341-f7a045908259 h1:8q7+xl2D2qHPLTII1t4vSMNP2VKwDcn+Avf2WXvdB1A=
|
||||||
|
github.com/go-gl/gl v0.0.0-20210905235341-f7a045908259/go.mod h1:wjpnOv6ONl2SuJSxqCPVaPZibGFdSci9HFocT9qtVYM=
|
||||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0=
|
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0=
|
||||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210410170116-ea3d685f79fb h1:T6gaWBvRzJjuOrdCtg8fXXjKai2xSDqWTcKFUPuw8Tw=
|
|
||||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210410170116-ea3d685f79fb/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210410170116-ea3d685f79fb/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||||
|
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210727001814-0db043d8d5be h1:vEIVIuBApEBQTEJt19GfhoU+zFSV+sNTa9E9FdnRYfk=
|
||||||
|
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210727001814-0db043d8d5be/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||||
|
github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
|
||||||
github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||||
github.com/godbus/dbus/v5 v5.0.4 h1:9349emZab16e7zQvpmsbtjc18ykshndd8y2PG3sgJbA=
|
|
||||||
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||||
|
github.com/godbus/dbus/v5 v5.0.5 h1:9Eg0XUhQxtkV8ykTMKtMMYY72g4NgxtRq4jgh4Ih5YM=
|
||||||
|
github.com/godbus/dbus/v5 v5.0.5/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||||
github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff h1:W71vTCKoxtdXgnm1ECDFkfQnpdqAO00zzGXLA5yaEX8=
|
github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff h1:W71vTCKoxtdXgnm1ECDFkfQnpdqAO00zzGXLA5yaEX8=
|
||||||
github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff/go.mod h1:wfqRWLHRBsRgkp5dmbG56SA0DmVtwrF5N3oPdI8t+Aw=
|
github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff/go.mod h1:wfqRWLHRBsRgkp5dmbG56SA0DmVtwrF5N3oPdI8t+Aw=
|
||||||
@@ -123,6 +139,7 @@ github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt
|
|||||||
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||||
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
|
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
|
||||||
github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8=
|
github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8=
|
||||||
|
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
|
||||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||||
@@ -140,6 +157,7 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw
|
|||||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||||
github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM=
|
github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM=
|
||||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||||
|
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||||
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||||
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||||
@@ -153,10 +171,12 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
|||||||
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
|
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||||
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
||||||
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
||||||
|
github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk=
|
||||||
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||||
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||||
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||||
@@ -168,22 +188,31 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe
|
|||||||
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||||
github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||||
github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||||
|
github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||||
|
github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||||
|
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||||
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
|
github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y=
|
||||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
||||||
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
||||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
|
github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0=
|
||||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
|
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
|
||||||
github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
|
github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
|
||||||
|
github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M=
|
||||||
github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
|
github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
|
||||||
|
github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms=
|
||||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||||
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
|
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
|
||||||
|
github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
|
||||||
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
|
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
|
||||||
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
|
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
|
||||||
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
|
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
|
||||||
|
github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA=
|
||||||
github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU=
|
github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU=
|
||||||
|
github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8=
|
||||||
github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=
|
github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=
|
||||||
github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=
|
github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=
|
||||||
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||||
@@ -195,8 +224,11 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
|||||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||||
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
|
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
|
||||||
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
|
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
|
||||||
|
github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY=
|
||||||
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
|
github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I=
|
||||||
|
github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE=
|
||||||
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
|
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
|
||||||
|
github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk=
|
||||||
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||||
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||||
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
|
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
|
||||||
@@ -206,53 +238,65 @@ github.com/josephspurrier/goversioninfo v0.0.0-20200309025242-14b0ab84c6ca/go.mo
|
|||||||
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||||
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
||||||
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
|
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
|
||||||
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
|
|
||||||
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
||||||
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
||||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||||
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
|
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
|
||||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||||
|
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
||||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||||
github.com/lucor/goinfo v0.0.0-20200401173949-526b5363a13a/go.mod h1:ORP3/rB5IsulLEBwQZCJyyV6niqmI7P4EWSmkug+1Ng=
|
github.com/lucor/goinfo v0.0.0-20210802170112-c078a2b0f08b/go.mod h1:PRq09yoB+Q2OJReAmwzKivcYyremnibWGbK7WfftHzc=
|
||||||
github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls=
|
github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls=
|
||||||
github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
|
github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
|
||||||
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
||||||
github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8=
|
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||||
|
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||||
github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||||
|
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||||
|
github.com/mattn/go-colorable v0.1.11 h1:nQ+aFkoE2TMGc0b68U2OKSexC+eq46+XwZzWXHRmPYs=
|
||||||
|
github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
|
||||||
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||||
|
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||||
|
github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84=
|
||||||
|
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
|
||||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||||
github.com/mattn/go-isatty v0.0.13 h1:qdl+GuBjcsKKDco5BsxPJlId98mSWNKqYA+Co0SC1yA=
|
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
|
||||||
github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
||||||
github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
|
github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
|
||||||
github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU=
|
github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU=
|
||||||
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
||||||
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
|
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
|
||||||
|
github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso=
|
||||||
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
|
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
|
||||||
|
github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI=
|
||||||
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||||
|
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||||
github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
|
github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
|
||||||
github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg=
|
github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg=
|
||||||
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
|
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
|
||||||
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||||
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||||
github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag=
|
|
||||||
github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||||
|
github.com/mitchellh/mapstructure v1.4.2 h1:6h7AQ0yhTcIsmFmnAwQls75jp2Gzs4iB8W7pjMO+rqo=
|
||||||
|
github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||||
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||||
github.com/mozillazg/go-pinyin v0.18.0 h1:hQompXO23/0ohH8YNjvfsAITnCQImCiR/Fny8EhIeW0=
|
github.com/mozillazg/go-pinyin v0.18.0 h1:hQompXO23/0ohH8YNjvfsAITnCQImCiR/Fny8EhIeW0=
|
||||||
github.com/mozillazg/go-pinyin v0.18.0/go.mod h1:iR4EnMMRXkfpFVV5FMi4FNB6wGq9NV6uDWbUuPhP4Yc=
|
github.com/mozillazg/go-pinyin v0.18.0/go.mod h1:iR4EnMMRXkfpFVV5FMi4FNB6wGq9NV6uDWbUuPhP4Yc=
|
||||||
github.com/muka/go-bluetooth v0.0.0-20210812063148-b6c83362e27d h1:EG/xyWjHT19rkUpwsWSkyiCCmyqNwFovr9m10rhyOxU=
|
github.com/muka/go-bluetooth v0.0.0-20211122080231-b99792bbe62a h1:KxRXeSWoBM5FCPAnSUYxt1qwEzmoH/K7upb4fiSDwdc=
|
||||||
github.com/muka/go-bluetooth v0.0.0-20210812063148-b6c83362e27d/go.mod h1:dMCjicU6vRBk34dqOmIZm0aod6gUwZXOXzBROqGous0=
|
github.com/muka/go-bluetooth v0.0.0-20211122080231-b99792bbe62a/go.mod h1:dMCjicU6vRBk34dqOmIZm0aod6gUwZXOXzBROqGous0=
|
||||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=
|
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=
|
||||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
|
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
|
||||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
||||||
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
||||||
github.com/paypal/gatt v0.0.0-20151011220935-4ae819d591cf/go.mod h1:+AwQL2mK3Pd3S+TUwg0tYQjid0q1txyNUJuuSmz8Kdk=
|
github.com/paypal/gatt v0.0.0-20151011220935-4ae819d591cf/go.mod h1:+AwQL2mK3Pd3S+TUwg0tYQjid0q1txyNUJuuSmz8Kdk=
|
||||||
github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ=
|
|
||||||
github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
|
github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
|
||||||
|
github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM=
|
||||||
|
github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
|
||||||
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
@@ -260,26 +304,27 @@ github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZ
|
|||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
|
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
|
||||||
|
github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s=
|
||||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||||
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||||
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
|
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
|
||||||
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||||
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
|
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
|
||||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||||
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
|
github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
|
||||||
github.com/rs/zerolog v1.23.0 h1:UskrK+saS9P9Y789yNNulYKdARjPZuS35B8gJF2x60g=
|
github.com/rs/zerolog v1.25.0 h1:Rj7XygbUHKUlDPcVdoLyR91fJBsduXj5fRxyqIQj/II=
|
||||||
github.com/rs/zerolog v1.23.0/go.mod h1:6c7hFfxPOy7TacJc4Fcdi24/J0NKYGzjG8FWRI916Qo=
|
github.com/rs/zerolog v1.25.0/go.mod h1:7KHcEGe0QZPOm2IE4Kpb5rTh6n1h2hIgS5OOnu1rUaI=
|
||||||
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||||
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
||||||
|
github.com/sagikazarmark/crypt v0.1.0/go.mod h1:B/mN0msZuINBtQ1zZLEQcegFJJf9vnYIR88KRMEuODE=
|
||||||
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
|
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
|
||||||
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
|
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
|
||||||
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
|
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
|
||||||
github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
|
github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
|
||||||
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
||||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
|
|
||||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
|
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
|
||||||
github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
|
|
||||||
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
|
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
|
||||||
|
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||||
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
||||||
github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY=
|
github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY=
|
||||||
github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
|
github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
|
||||||
@@ -293,12 +338,15 @@ github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0
|
|||||||
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||||
github.com/spf13/viper v1.8.1 h1:Kq1fyeebqsBfbjZj4EL7gj2IO0mMaiyjYUWcUsl2O44=
|
|
||||||
github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns=
|
github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns=
|
||||||
github.com/srwiley/oksvg v0.0.0-20200311192757-870daf9aa564 h1:HunZiaEKNGVdhTRQOVpMmj5MQnGnv+e8uZNu3xFLgyM=
|
github.com/spf13/viper v1.9.0 h1:yR6EXjTp0y0cLN8OZg1CRZmOBdI88UcGkhgyJhu6nZk=
|
||||||
|
github.com/spf13/viper v1.9.0/go.mod h1:+i6ajR7OX2XaiBkrcZJFK21htRk7eDeLg7+O6bhUPP4=
|
||||||
github.com/srwiley/oksvg v0.0.0-20200311192757-870daf9aa564/go.mod h1:afMbS0qvv1m5tfENCwnOdZGOF8RGR/FsZ7bvBxQGZG4=
|
github.com/srwiley/oksvg v0.0.0-20200311192757-870daf9aa564/go.mod h1:afMbS0qvv1m5tfENCwnOdZGOF8RGR/FsZ7bvBxQGZG4=
|
||||||
github.com/srwiley/rasterx v0.0.0-20200120212402-85cb7272f5e9 h1:m59mIOBO4kfcNCEzJNy71UkeF4XIx2EVmL9KLwDQdmM=
|
github.com/srwiley/oksvg v0.0.0-20210519022825-9fc0c575d5fe h1:J5Ga/gb+4/WgJBupg9Fp8F6JQnUT3UF+asoTweLi9Jc=
|
||||||
|
github.com/srwiley/oksvg v0.0.0-20210519022825-9fc0c575d5fe/go.mod h1:afMbS0qvv1m5tfENCwnOdZGOF8RGR/FsZ7bvBxQGZG4=
|
||||||
github.com/srwiley/rasterx v0.0.0-20200120212402-85cb7272f5e9/go.mod h1:mvWM0+15UqyrFKqdRjY6LuAVJR0HOVhJlEgZ5JWtSWU=
|
github.com/srwiley/rasterx v0.0.0-20200120212402-85cb7272f5e9/go.mod h1:mvWM0+15UqyrFKqdRjY6LuAVJR0HOVhJlEgZ5JWtSWU=
|
||||||
|
github.com/srwiley/rasterx v0.0.0-20210519020934-456a8d69b780 h1:oDMiXaTMyBEuZMU53atpxqYsSB3U1CHkeAu2zr6wTeY=
|
||||||
|
github.com/srwiley/rasterx v0.0.0-20210519020934-456a8d69b780/go.mod h1:mvWM0+15UqyrFKqdRjY6LuAVJR0HOVhJlEgZ5JWtSWU=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||||
@@ -310,13 +358,17 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
|
|||||||
github.com/suapapa/go_eddystone v1.3.1/go.mod h1:bXC11TfJOS+3g3q/Uzd7FKd5g62STQEfeEIhcKe4Qy8=
|
github.com/suapapa/go_eddystone v1.3.1/go.mod h1:bXC11TfJOS+3g3q/Uzd7FKd5g62STQEfeEIhcKe4Qy8=
|
||||||
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
|
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
|
||||||
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
|
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
|
||||||
|
github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
|
||||||
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||||
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||||
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||||
go.arsenm.dev/infinitime v0.0.0-20210825051734-745b4bd37cf4 h1:XZyynxrvGxP0mwyhdiuMrvj5SkiK6N+MDiC6DiGzgWU=
|
github.com/yuin/goldmark v1.3.8/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||||
go.arsenm.dev/infinitime v0.0.0-20210825051734-745b4bd37cf4/go.mod h1:gaepaueUz4J5FfxuV19B4w5pi+V3mD0LTef50ryxr/Q=
|
github.com/yuin/goldmark v1.4.1 h1:/vn0k+RBvwlxEmP5E7SZMqNxPhfMVFEJiykr15/0XKM=
|
||||||
|
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||||
|
go.arsenm.dev/infinitime v0.0.0-20211126043306-522c10a9c0a7 h1:m6BVtAiWMRbfUgBZVthXq2eZhSwDxdtOi8Dh/59hXik=
|
||||||
|
go.arsenm.dev/infinitime v0.0.0-20211126043306-522c10a9c0a7/go.mod h1:TzAhsz7TAqEm/vWhgMvmIxHS5jt46hqKkPvr6cqvVyA=
|
||||||
go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs=
|
go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs=
|
||||||
go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g=
|
go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g=
|
||||||
go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ=
|
go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ=
|
||||||
@@ -327,6 +379,7 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
|||||||
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||||
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
|
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
|
||||||
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
|
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
|
||||||
|
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
|
||||||
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
||||||
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
|
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
|
||||||
go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo=
|
go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo=
|
||||||
@@ -335,8 +388,10 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
|
|||||||
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
|
golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY=
|
||||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||||
|
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||||
@@ -349,8 +404,9 @@ golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EH
|
|||||||
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
|
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
|
||||||
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
||||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||||
golang.org/x/image v0.0.0-20200430140353-33d19683fad8 h1:6WW6V3x1P/jokJBpRQYUJnMHRP6isStQwCozxnU7XQw=
|
|
||||||
golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||||
|
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d h1:RNPAfi2nHY7C2srAV8A49jpsYr0ADedCk1wq6fTMTvs=
|
||||||
|
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
|
||||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||||
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||||
@@ -388,6 +444,7 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR
|
|||||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
@@ -409,8 +466,10 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v
|
|||||||
golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
|
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
|
||||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 h1:4nGaVu0QrbjT/AK2PRLuQfQuh6DJve+pELhqTdAj3x0=
|
|
||||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
||||||
|
golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
|
golang.org/x/net v0.0.0-20211011170408-caeb26a5c8c0 h1:qOfNqBm5gk93LjGZo1MJaKY6Bph39zOKz1Hz2ogHj1w=
|
||||||
|
golang.org/x/net v0.0.0-20211011170408-caeb26a5c8c0/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||||
@@ -423,6 +482,10 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ
|
|||||||
golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||||
golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||||
golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||||
|
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
@@ -438,6 +501,7 @@ golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5h
|
|||||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
@@ -446,14 +510,19 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w
|
|||||||
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
@@ -464,7 +533,6 @@ golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7w
|
|||||||
golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200720211630-cb9d2d5c5666/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
@@ -479,10 +547,18 @@ golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7w
|
|||||||
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf h1:2ucpDCmfkl8Bd/FsLtiD653Wf96cW37s+iGx93zsu4k=
|
golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac h1:oN6lz7iLW/YC7un8pq+9bOLyXrprv2+DKfkJY+2LJJw=
|
||||||
|
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
@@ -491,6 +567,7 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
|||||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
|
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
|
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
|
||||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
@@ -509,8 +586,8 @@ golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBn
|
|||||||
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||||
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||||
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||||
golang.org/x/tools v0.0.0-20190808195139-e713427fea3f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
|
||||||
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
@@ -531,7 +608,6 @@ golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapK
|
|||||||
golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
|
golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
|
||||||
golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
|
golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
|
||||||
golang.org/x/tools v0.0.0-20200328031815-3db5fc6bac03/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
|
|
||||||
golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
|
golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
|
||||||
golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
@@ -549,7 +625,11 @@ golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4f
|
|||||||
golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
|
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
|
||||||
|
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||||
golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||||
|
golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||||
|
golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||||
|
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
@@ -576,6 +656,12 @@ google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjR
|
|||||||
google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU=
|
google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU=
|
||||||
google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94=
|
google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94=
|
||||||
google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8=
|
google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8=
|
||||||
|
google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo=
|
||||||
|
google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4=
|
||||||
|
google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw=
|
||||||
|
google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU=
|
||||||
|
google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k=
|
||||||
|
google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE=
|
||||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||||
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||||
@@ -623,7 +709,18 @@ google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6D
|
|||||||
google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A=
|
google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A=
|
||||||
|
google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A=
|
||||||
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
|
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
|
||||||
|
google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
|
||||||
|
google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
|
||||||
|
google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24=
|
||||||
|
google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k=
|
||||||
|
google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k=
|
||||||
|
google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48=
|
||||||
|
google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48=
|
||||||
|
google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w=
|
||||||
|
google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
|
||||||
|
google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
|
||||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||||
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||||
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
||||||
@@ -643,7 +740,13 @@ google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA5
|
|||||||
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||||
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||||
google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||||
|
google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
|
||||||
|
google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
|
||||||
google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
|
google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
|
||||||
|
google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
|
||||||
|
google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
|
||||||
|
google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
|
||||||
|
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
|
||||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||||
@@ -656,13 +759,16 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj
|
|||||||
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||||
|
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
|
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
|
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
|
||||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||||
gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU=
|
|
||||||
gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||||
|
gopkg.in/ini.v1 v1.63.2 h1:tGK/CyBg7SMzb60vP1M03vNZ3VDu3wGQJwn7Sxi9r3c=
|
||||||
|
gopkg.in/ini.v1 v1.63.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
package types
|
package types
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"strconv"
|
||||||
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
ReqTypeHeartRate = iota
|
ReqTypeHeartRate = iota
|
||||||
ReqTypeBattLevel
|
ReqTypeBattLevel
|
||||||
@@ -10,6 +15,12 @@ const (
|
|||||||
ReqTypeSetTime
|
ReqTypeSetTime
|
||||||
ReqTypeWatchHeartRate
|
ReqTypeWatchHeartRate
|
||||||
ReqTypeWatchBattLevel
|
ReqTypeWatchBattLevel
|
||||||
|
ReqTypeMotion
|
||||||
|
ReqTypeWatchMotion
|
||||||
|
ReqTypeStepCount
|
||||||
|
ReqTypeWatchStepCount
|
||||||
|
ReqTypeCancel
|
||||||
|
ReqTypeFS
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -17,14 +28,31 @@ const (
|
|||||||
UpgradeTypeFiles
|
UpgradeTypeFiles
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
FSTypeWrite = iota
|
||||||
|
FSTypeRead
|
||||||
|
FSTypeMove
|
||||||
|
FSTypeDelete
|
||||||
|
FSTypeList
|
||||||
|
FSTypeMkdir
|
||||||
|
)
|
||||||
|
|
||||||
|
type ReqDataFS struct {
|
||||||
|
Type int `json:"type"`
|
||||||
|
Files []string `json:"files"`
|
||||||
|
Data string `json:"data,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
type ReqDataFwUpgrade struct {
|
type ReqDataFwUpgrade struct {
|
||||||
Type int
|
Type int
|
||||||
Files []string
|
Files []string
|
||||||
}
|
}
|
||||||
|
|
||||||
type Response struct {
|
type Response struct {
|
||||||
|
Type int `json:"type"`
|
||||||
Value interface{} `json:"value,omitempty"`
|
Value interface{} `json:"value,omitempty"`
|
||||||
Message string `json:"msg,omitempty"`
|
Message string `json:"msg,omitempty"`
|
||||||
|
ID string `json:"id,omitempty"`
|
||||||
Error bool `json:"error"`
|
Error bool `json:"error"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,4 +69,74 @@ type ReqDataNotify struct {
|
|||||||
type DFUProgress struct {
|
type DFUProgress struct {
|
||||||
Received int64 `mapstructure:"recvd"`
|
Received int64 `mapstructure:"recvd"`
|
||||||
Total int64 `mapstructure:"total"`
|
Total int64 `mapstructure:"total"`
|
||||||
|
Sent int64 `mapstructure:"sent"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type MotionValues struct {
|
||||||
|
X int16
|
||||||
|
Y int16
|
||||||
|
Z int16
|
||||||
|
}
|
||||||
|
|
||||||
|
type FileInfo struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
Size int64 `json:"size"`
|
||||||
|
IsDir bool `json:"isDir"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fi FileInfo) String() string {
|
||||||
|
var isDirChar rune
|
||||||
|
if fi.IsDir {
|
||||||
|
isDirChar = 'd'
|
||||||
|
} else {
|
||||||
|
isDirChar = '-'
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get human-readable value for file size
|
||||||
|
val, unit := bytesHuman(fi.Size)
|
||||||
|
prec := 0
|
||||||
|
// If value is less than 10, set precision to 1
|
||||||
|
if val < 10 {
|
||||||
|
prec = 1
|
||||||
|
}
|
||||||
|
// Convert float to string
|
||||||
|
valStr := strconv.FormatFloat(val, 'f', prec, 64)
|
||||||
|
|
||||||
|
// Return string formatted like so:
|
||||||
|
// - 10 kB file
|
||||||
|
// or:
|
||||||
|
// d 0 B .
|
||||||
|
return fmt.Sprintf(
|
||||||
|
"%c %3s %-2s %s",
|
||||||
|
isDirChar,
|
||||||
|
valStr,
|
||||||
|
unit,
|
||||||
|
fi.Name,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// bytesHuman returns a human-readable string for
|
||||||
|
// the amount of bytes inputted.
|
||||||
|
func bytesHuman(b int64) (float64, string) {
|
||||||
|
const unit = 1000
|
||||||
|
// Set possible units prefixes (PineTime flash is 4MB)
|
||||||
|
units := [2]rune{'k', 'M'}
|
||||||
|
// If amount of bytes is less than smallest unit
|
||||||
|
if b < unit {
|
||||||
|
// Return unchanged with unit "B"
|
||||||
|
return float64(b), "B"
|
||||||
|
}
|
||||||
|
|
||||||
|
div, exp := int64(unit), 0
|
||||||
|
// Get decimal values and unit prefix index
|
||||||
|
for n := b / unit; n >= unit; n /= unit {
|
||||||
|
div *= unit
|
||||||
|
exp++
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create string for full unit
|
||||||
|
unitStr := string([]rune{units[exp], 'B'})
|
||||||
|
|
||||||
|
// Return decimal with unit string
|
||||||
|
return float64(b) / float64(div), unitStr
|
||||||
}
|
}
|
||||||
|
|||||||
8
itd.toml
8
itd.toml
@@ -1,13 +1,13 @@
|
|||||||
# This is temporary, it is to show a notice
|
|
||||||
# to people still using the old config
|
|
||||||
cfg.version = 2
|
|
||||||
|
|
||||||
[socket]
|
[socket]
|
||||||
path = "/tmp/itd/socket"
|
path = "/tmp/itd/socket"
|
||||||
|
|
||||||
[conn]
|
[conn]
|
||||||
reconnect = true
|
reconnect = true
|
||||||
|
|
||||||
|
[conn.whitelist]
|
||||||
|
enabled = false
|
||||||
|
devices = []
|
||||||
|
|
||||||
[on.connect]
|
[on.connect]
|
||||||
notify = true
|
notify = true
|
||||||
|
|
||||||
|
|||||||
21
main.go
21
main.go
@@ -26,19 +26,22 @@ import (
|
|||||||
"go.arsenm.dev/infinitime"
|
"go.arsenm.dev/infinitime"
|
||||||
)
|
)
|
||||||
|
|
||||||
var firmwareUpdating = false
|
var (
|
||||||
|
firmwareUpdating = false
|
||||||
|
// The FS must be updated when the watch is reconnected
|
||||||
|
updateFS = false
|
||||||
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
if viper.GetInt("cfg.version") != 2 {
|
infinitime.Init()
|
||||||
log.Fatal().Msg("Please update your config to the newest format, only v2 configs supported.")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Cleanly exit after function
|
// Cleanly exit after function
|
||||||
defer infinitime.Exit()
|
defer infinitime.Exit()
|
||||||
|
|
||||||
// Connect to InfiniTime with default options
|
// Connect to InfiniTime with default options
|
||||||
dev, err := infinitime.Connect(&infinitime.Options{
|
dev, err := infinitime.Connect(&infinitime.Options{
|
||||||
AttemptReconnect: viper.GetBool("conn.reconnect"),
|
AttemptReconnect: viper.GetBool("conn.reconnect"),
|
||||||
|
WhitelistEnabled: viper.GetBool("conn.whitelist.enabled"),
|
||||||
|
Whitelist: viper.GetStringSlice("conn.whitelist.devices"),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error().Err(err).Msg("Error connecting to InfiniTime")
|
log.Error().Err(err).Msg("Error connecting to InfiniTime")
|
||||||
@@ -62,6 +65,8 @@ func main() {
|
|||||||
log.Error().Err(err).Msg("Error sending notification to InfiniTime")
|
log.Error().Err(err).Msg("Error sending notification to InfiniTime")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateFS = true
|
||||||
})
|
})
|
||||||
|
|
||||||
// Get firmware version
|
// Get firmware version
|
||||||
@@ -94,6 +99,12 @@ func main() {
|
|||||||
log.Error().Err(err).Msg("Error initializing music control")
|
log.Error().Err(err).Msg("Error initializing music control")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Start control socket
|
||||||
|
err = initCallNotifs(dev)
|
||||||
|
if err != nil {
|
||||||
|
log.Error().Err(err).Msg("Error starting socket")
|
||||||
|
}
|
||||||
|
|
||||||
// Initialize notification relay
|
// Initialize notification relay
|
||||||
err = initNotifRelay(dev)
|
err = initNotifRelay(dev)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
47
music.go
47
music.go
@@ -26,45 +26,22 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func initMusicCtrl(dev *infinitime.Device) error {
|
func initMusicCtrl(dev *infinitime.Device) error {
|
||||||
// On player status change, set status
|
player.Init()
|
||||||
err := player.Status(func(newStatus bool) {
|
|
||||||
if !firmwareUpdating {
|
|
||||||
dev.Music.SetStatus(newStatus)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// On player title change, set track
|
player.OnChange(func(ct player.ChangeType, val string) {
|
||||||
err = player.Metadata("title", func(newTitle string) {
|
|
||||||
if !firmwareUpdating {
|
if !firmwareUpdating {
|
||||||
dev.Music.SetTrack(newTitle)
|
switch ct {
|
||||||
|
case player.ChangeTypeStatus:
|
||||||
|
dev.Music.SetStatus(val == "Playing")
|
||||||
|
case player.ChangeTypeTitle:
|
||||||
|
dev.Music.SetTrack(val)
|
||||||
|
case player.ChangeTypeAlbum:
|
||||||
|
dev.Music.SetAlbum(val)
|
||||||
|
case player.ChangeTypeArtist:
|
||||||
|
dev.Music.SetArtist(val)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// On player album change, set album
|
|
||||||
err = player.Metadata("album", func(newAlbum string) {
|
|
||||||
if !firmwareUpdating {
|
|
||||||
dev.Music.SetAlbum(newAlbum)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// On player artist change, set artist
|
|
||||||
err = player.Metadata("artist", func(newArtist string) {
|
|
||||||
if !firmwareUpdating {
|
|
||||||
dev.Music.SetArtist(newArtist)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Watch for music events
|
// Watch for music events
|
||||||
musicEvtCh, err := dev.Music.WatchEvents()
|
musicEvtCh, err := dev.Music.WatchEvents()
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import (
|
|||||||
|
|
||||||
func initNotifRelay(dev *infinitime.Device) error {
|
func initNotifRelay(dev *infinitime.Device) error {
|
||||||
// Connect to dbus session bus
|
// Connect to dbus session bus
|
||||||
bus, err := dbus.SessionBus()
|
bus, err := newSessionBusConn()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
393
socket.go
393
socket.go
@@ -22,21 +22,47 @@ import (
|
|||||||
"bufio"
|
"bufio"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io"
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/google/uuid"
|
||||||
"github.com/mitchellh/mapstructure"
|
"github.com/mitchellh/mapstructure"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
"go.arsenm.dev/infinitime"
|
"go.arsenm.dev/infinitime"
|
||||||
|
"go.arsenm.dev/infinitime/blefs"
|
||||||
"go.arsenm.dev/itd/internal/types"
|
"go.arsenm.dev/itd/internal/types"
|
||||||
"go.arsenm.dev/itd/translit"
|
"go.arsenm.dev/itd/translit"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type DoneMap map[string]chan struct{}
|
||||||
|
|
||||||
|
func (dm DoneMap) Exists(key string) bool {
|
||||||
|
_, ok := dm[key]
|
||||||
|
return ok
|
||||||
|
}
|
||||||
|
|
||||||
|
func (dm DoneMap) Done(key string) {
|
||||||
|
ch := dm[key]
|
||||||
|
ch <- struct{}{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (dm DoneMap) Create(key string) {
|
||||||
|
dm[key] = make(chan struct{}, 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (dm DoneMap) Remove(key string) {
|
||||||
|
close(dm[key])
|
||||||
|
delete(dm, key)
|
||||||
|
}
|
||||||
|
|
||||||
|
var done = DoneMap{}
|
||||||
|
|
||||||
func startSocket(dev *infinitime.Device) error {
|
func startSocket(dev *infinitime.Device) error {
|
||||||
// Make socket directory if non-existent
|
// Make socket directory if non-existant
|
||||||
err := os.MkdirAll(filepath.Dir(viper.GetString("socket.path")), 0755)
|
err := os.MkdirAll(filepath.Dir(viper.GetString("socket.path")), 0755)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -54,6 +80,11 @@ func startSocket(dev *infinitime.Device) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fs, err := dev.FS()
|
||||||
|
if err != nil {
|
||||||
|
log.Warn().Err(err).Msg("Error getting BLE filesystem")
|
||||||
|
}
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
for {
|
for {
|
||||||
// Accept socket connection
|
// Accept socket connection
|
||||||
@@ -63,7 +94,7 @@ func startSocket(dev *infinitime.Device) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Concurrently handle connection
|
// Concurrently handle connection
|
||||||
go handleConnection(conn, dev)
|
go handleConnection(conn, dev, fs)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
@@ -73,12 +104,21 @@ func startSocket(dev *infinitime.Device) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleConnection(conn net.Conn, dev *infinitime.Device) {
|
func handleConnection(conn net.Conn, dev *infinitime.Device, fs *blefs.FS) {
|
||||||
defer conn.Close()
|
defer conn.Close()
|
||||||
// If firmware is updating, return error
|
|
||||||
if firmwareUpdating {
|
// If an FS update is required (reconnect ocurred)
|
||||||
connErr(conn, nil, "Firmware update in progress")
|
if updateFS {
|
||||||
return
|
// Get new FS
|
||||||
|
newFS, err := dev.FS()
|
||||||
|
if err != nil {
|
||||||
|
fs = nil
|
||||||
|
log.Warn().Err(err).Msg("Error updating BLE filesystem")
|
||||||
|
}
|
||||||
|
// Set FS pointer to new FS
|
||||||
|
*fs = *newFS
|
||||||
|
// Reset updateFS
|
||||||
|
updateFS = false
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create new scanner on connection
|
// Create new scanner on connection
|
||||||
@@ -88,86 +128,203 @@ func handleConnection(conn net.Conn, dev *infinitime.Device) {
|
|||||||
// Decode scanned message into types.Request
|
// Decode scanned message into types.Request
|
||||||
err := json.Unmarshal(scanner.Bytes(), &req)
|
err := json.Unmarshal(scanner.Bytes(), &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
connErr(conn, err, "Error decoding JSON input")
|
connErr(conn, req.Type, err, "Error decoding JSON input")
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If firmware is updating, return error
|
||||||
|
if firmwareUpdating {
|
||||||
|
connErr(conn, req.Type, nil, "Firmware update in progress")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
switch req.Type {
|
switch req.Type {
|
||||||
case types.ReqTypeHeartRate:
|
case types.ReqTypeHeartRate:
|
||||||
// Get heart rate from watch
|
// Get heart rate from watch
|
||||||
heartRate, err := dev.HeartRate()
|
heartRate, err := dev.HeartRate()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
connErr(conn, err, "Error getting heart rate")
|
connErr(conn, req.Type, err, "Error getting heart rate")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
// Encode heart rate to connection
|
// Encode heart rate to connection
|
||||||
json.NewEncoder(conn).Encode(types.Response{
|
json.NewEncoder(conn).Encode(types.Response{
|
||||||
|
Type: req.Type,
|
||||||
Value: heartRate,
|
Value: heartRate,
|
||||||
})
|
})
|
||||||
case types.ReqTypeWatchHeartRate:
|
case types.ReqTypeWatchHeartRate:
|
||||||
heartRateCh, err := dev.WatchHeartRate()
|
heartRateCh, cancel, err := dev.WatchHeartRate()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
connErr(conn, err, "Error getting heart rate channel")
|
connErr(conn, req.Type, err, "Error getting heart rate channel")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
reqID := uuid.New().String()
|
||||||
go func() {
|
go func() {
|
||||||
|
done.Create(reqID)
|
||||||
|
// For every heart rate value
|
||||||
for heartRate := range heartRateCh {
|
for heartRate := range heartRateCh {
|
||||||
json.NewEncoder(conn).Encode(types.Response{
|
select {
|
||||||
Value: heartRate,
|
case <-done[reqID]:
|
||||||
})
|
// Stop notifications if done signal received
|
||||||
}
|
cancel()
|
||||||
}()
|
done.Remove(reqID)
|
||||||
case types.ReqTypeWatchBattLevel:
|
return
|
||||||
battLevelCh, err := dev.WatchBatteryLevel()
|
default:
|
||||||
if err != nil {
|
// Encode response to connection if no done signal received
|
||||||
connErr(conn, err, "Error getting heart rate channel")
|
json.NewEncoder(conn).Encode(types.Response{
|
||||||
break
|
Type: req.Type,
|
||||||
}
|
ID: reqID,
|
||||||
go func() {
|
Value: heartRate,
|
||||||
for battLevel := range battLevelCh {
|
})
|
||||||
json.NewEncoder(conn).Encode(types.Response{
|
}
|
||||||
Value: battLevel,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
case types.ReqTypeBattLevel:
|
case types.ReqTypeBattLevel:
|
||||||
// Get battery level from watch
|
// Get battery level from watch
|
||||||
battLevel, err := dev.BatteryLevel()
|
battLevel, err := dev.BatteryLevel()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
connErr(conn, err, "Error getting battery level")
|
connErr(conn, req.Type, err, "Error getting battery level")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
// Encode battery level to connection
|
// Encode battery level to connection
|
||||||
json.NewEncoder(conn).Encode(types.Response{
|
json.NewEncoder(conn).Encode(types.Response{
|
||||||
|
Type: req.Type,
|
||||||
Value: battLevel,
|
Value: battLevel,
|
||||||
})
|
})
|
||||||
|
case types.ReqTypeWatchBattLevel:
|
||||||
|
battLevelCh, cancel, err := dev.WatchBatteryLevel()
|
||||||
|
if err != nil {
|
||||||
|
connErr(conn, req.Type, err, "Error getting battery level channel")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
reqID := uuid.New().String()
|
||||||
|
go func() {
|
||||||
|
done.Create(reqID)
|
||||||
|
// For every battery level value
|
||||||
|
for battLevel := range battLevelCh {
|
||||||
|
select {
|
||||||
|
case <-done[reqID]:
|
||||||
|
// Stop notifications if done signal received
|
||||||
|
cancel()
|
||||||
|
done.Remove(reqID)
|
||||||
|
return
|
||||||
|
default:
|
||||||
|
// Encode response to connection if no done signal received
|
||||||
|
json.NewEncoder(conn).Encode(types.Response{
|
||||||
|
Type: req.Type,
|
||||||
|
ID: reqID,
|
||||||
|
Value: battLevel,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
case types.ReqTypeMotion:
|
||||||
|
// Get battery level from watch
|
||||||
|
motionVals, err := dev.Motion()
|
||||||
|
if err != nil {
|
||||||
|
connErr(conn, req.Type, err, "Error getting motion values")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
// Encode battery level to connection
|
||||||
|
json.NewEncoder(conn).Encode(types.Response{
|
||||||
|
Type: req.Type,
|
||||||
|
Value: motionVals,
|
||||||
|
})
|
||||||
|
case types.ReqTypeWatchMotion:
|
||||||
|
motionValCh, cancel, err := dev.WatchMotion()
|
||||||
|
if err != nil {
|
||||||
|
connErr(conn, req.Type, err, "Error getting heart rate channel")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
reqID := uuid.New().String()
|
||||||
|
go func() {
|
||||||
|
done.Create(reqID)
|
||||||
|
// For every motion event
|
||||||
|
for motionVals := range motionValCh {
|
||||||
|
select {
|
||||||
|
case <-done[reqID]:
|
||||||
|
// Stop notifications if done signal received
|
||||||
|
cancel()
|
||||||
|
done.Remove(reqID)
|
||||||
|
|
||||||
|
return
|
||||||
|
default:
|
||||||
|
// Encode response to connection if no done signal received
|
||||||
|
json.NewEncoder(conn).Encode(types.Response{
|
||||||
|
Type: req.Type,
|
||||||
|
ID: reqID,
|
||||||
|
Value: motionVals,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
case types.ReqTypeStepCount:
|
||||||
|
// Get battery level from watch
|
||||||
|
stepCount, err := dev.StepCount()
|
||||||
|
if err != nil {
|
||||||
|
connErr(conn, req.Type, err, "Error getting step count")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
// Encode battery level to connection
|
||||||
|
json.NewEncoder(conn).Encode(types.Response{
|
||||||
|
Type: req.Type,
|
||||||
|
Value: stepCount,
|
||||||
|
})
|
||||||
|
case types.ReqTypeWatchStepCount:
|
||||||
|
stepCountCh, cancel, err := dev.WatchStepCount()
|
||||||
|
if err != nil {
|
||||||
|
connErr(conn, req.Type, err, "Error getting heart rate channel")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
reqID := uuid.New().String()
|
||||||
|
go func() {
|
||||||
|
done.Create(reqID)
|
||||||
|
// For every step count value
|
||||||
|
for stepCount := range stepCountCh {
|
||||||
|
select {
|
||||||
|
case <-done[reqID]:
|
||||||
|
// Stop notifications if done signal received
|
||||||
|
cancel()
|
||||||
|
done.Remove(reqID)
|
||||||
|
return
|
||||||
|
default:
|
||||||
|
// Encode response to connection if no done signal received
|
||||||
|
json.NewEncoder(conn).Encode(types.Response{
|
||||||
|
Type: req.Type,
|
||||||
|
ID: reqID,
|
||||||
|
Value: stepCount,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}()
|
||||||
case types.ReqTypeFwVersion:
|
case types.ReqTypeFwVersion:
|
||||||
// Get firmware version from watch
|
// Get firmware version from watch
|
||||||
version, err := dev.Version()
|
version, err := dev.Version()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
connErr(conn, err, "Error getting battery level")
|
connErr(conn, req.Type, err, "Error getting firmware version")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
// Encode version to connection
|
// Encode version to connection
|
||||||
json.NewEncoder(conn).Encode(types.Response{
|
json.NewEncoder(conn).Encode(types.Response{
|
||||||
|
Type: req.Type,
|
||||||
Value: version,
|
Value: version,
|
||||||
})
|
})
|
||||||
case types.ReqTypeBtAddress:
|
case types.ReqTypeBtAddress:
|
||||||
// Encode bluetooth address to connection
|
// Encode bluetooth address to connection
|
||||||
json.NewEncoder(conn).Encode(types.Response{
|
json.NewEncoder(conn).Encode(types.Response{
|
||||||
|
Type: req.Type,
|
||||||
Value: dev.Address(),
|
Value: dev.Address(),
|
||||||
})
|
})
|
||||||
case types.ReqTypeNotify:
|
case types.ReqTypeNotify:
|
||||||
// If no data, return error
|
// If no data, return error
|
||||||
if req.Data == nil {
|
if req.Data == nil {
|
||||||
connErr(conn, nil, "Data required for notify request")
|
connErr(conn, req.Type, nil, "Data required for notify request")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
var reqData types.ReqDataNotify
|
var reqData types.ReqDataNotify
|
||||||
// Decode data map to notify request data
|
// Decode data map to notify request data
|
||||||
err = mapstructure.Decode(req.Data, &reqData)
|
err = mapstructure.Decode(req.Data, &reqData)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
connErr(conn, err, "Error decoding request data")
|
connErr(conn, req.Type, err, "Error decoding request data")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
maps := viper.GetStringSlice("notifs.translit.use")
|
maps := viper.GetStringSlice("notifs.translit.use")
|
||||||
@@ -177,21 +334,21 @@ func handleConnection(conn net.Conn, dev *infinitime.Device) {
|
|||||||
// Send notification to watch
|
// Send notification to watch
|
||||||
err = dev.Notify(title, body)
|
err = dev.Notify(title, body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
connErr(conn, err, "Error sending notification")
|
connErr(conn, req.Type, err, "Error sending notification")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
// Encode empty types.Response to connection
|
// Encode empty types.Response to connection
|
||||||
json.NewEncoder(conn).Encode(types.Response{})
|
json.NewEncoder(conn).Encode(types.Response{Type: req.Type})
|
||||||
case types.ReqTypeSetTime:
|
case types.ReqTypeSetTime:
|
||||||
// If no data, return error
|
// If no data, return error
|
||||||
if req.Data == nil {
|
if req.Data == nil {
|
||||||
connErr(conn, nil, "Data required for settime request")
|
connErr(conn, req.Type, nil, "Data required for settime request")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
// Get string from data or return error
|
// Get string from data or return error
|
||||||
reqTimeStr, ok := req.Data.(string)
|
reqTimeStr, ok := req.Data.(string)
|
||||||
if !ok {
|
if !ok {
|
||||||
connErr(conn, nil, "Data for settime request must be RFC3339 formatted time string")
|
connErr(conn, req.Type, nil, "Data for settime request must be RFC3339 formatted time string")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,69 +359,71 @@ func handleConnection(conn net.Conn, dev *infinitime.Device) {
|
|||||||
// Parse time as RFC3339/ISO8601
|
// Parse time as RFC3339/ISO8601
|
||||||
reqTime, err = time.Parse(time.RFC3339, reqTimeStr)
|
reqTime, err = time.Parse(time.RFC3339, reqTimeStr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
connErr(conn, err, "Invalid time format. Time string must be formatted as ISO8601 or the word `now`")
|
connErr(conn, req.Type, err, "Invalid time format. Time string must be formatted as ISO8601 or the word `now`")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Set time on watch
|
// Set time on watch
|
||||||
err = dev.SetTime(reqTime)
|
err = dev.SetTime(reqTime)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
connErr(conn, err, "Error setting device time")
|
connErr(conn, req.Type, err, "Error setting device time")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
// Encode empty types.Response to connection
|
// Encode empty types.Response to connection
|
||||||
json.NewEncoder(conn).Encode(types.Response{})
|
json.NewEncoder(conn).Encode(types.Response{Type: req.Type})
|
||||||
case types.ReqTypeFwUpgrade:
|
case types.ReqTypeFwUpgrade:
|
||||||
// If no data, return error
|
// If no data, return error
|
||||||
if req.Data == nil {
|
if req.Data == nil {
|
||||||
connErr(conn, nil, "Data required for firmware upgrade request")
|
connErr(conn, req.Type, nil, "Data required for firmware upgrade request")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
var reqData types.ReqDataFwUpgrade
|
var reqData types.ReqDataFwUpgrade
|
||||||
// Decode data map to firmware upgrade request data
|
// Decode data map to firmware upgrade request data
|
||||||
err = mapstructure.Decode(req.Data, &reqData)
|
err = mapstructure.Decode(req.Data, &reqData)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
connErr(conn, err, "Error decoding request data")
|
connErr(conn, req.Type, err, "Error decoding request data")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
// Reset DFU to prepare for next update
|
||||||
|
dev.DFU.Reset()
|
||||||
switch reqData.Type {
|
switch reqData.Type {
|
||||||
case types.UpgradeTypeArchive:
|
case types.UpgradeTypeArchive:
|
||||||
// If less than one file, return error
|
// If less than one file, return error
|
||||||
if len(reqData.Files) < 1 {
|
if len(reqData.Files) < 1 {
|
||||||
connErr(conn, nil, "Archive upgrade requires one file with .zip extension")
|
connErr(conn, req.Type, nil, "Archive upgrade requires one file with .zip extension")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
// If file is not zip archive, return error
|
// If file is not zip archive, return error
|
||||||
if filepath.Ext(reqData.Files[0]) != ".zip" {
|
if filepath.Ext(reqData.Files[0]) != ".zip" {
|
||||||
connErr(conn, nil, "Archive upgrade file must be a zip archive")
|
connErr(conn, req.Type, nil, "Archive upgrade file must be a zip archive")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
// Load DFU archive
|
// Load DFU archive
|
||||||
err := dev.DFU.LoadArchive(reqData.Files[0])
|
err := dev.DFU.LoadArchive(reqData.Files[0])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
connErr(conn, err, "Error loading archive file")
|
connErr(conn, req.Type, err, "Error loading archive file")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
case types.UpgradeTypeFiles:
|
case types.UpgradeTypeFiles:
|
||||||
// If less than two files, return error
|
// If less than two files, return error
|
||||||
if len(reqData.Files) < 2 {
|
if len(reqData.Files) < 2 {
|
||||||
connErr(conn, nil, "Files upgrade requires two files. First with .dat and second with .bin extension.")
|
connErr(conn, req.Type, nil, "Files upgrade requires two files. First with .dat and second with .bin extension.")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
// If first file is not init packet, return error
|
// If first file is not init packet, return error
|
||||||
if filepath.Ext(reqData.Files[0]) != ".dat" {
|
if filepath.Ext(reqData.Files[0]) != ".dat" {
|
||||||
connErr(conn, nil, "First file must be a .dat file")
|
connErr(conn, req.Type, nil, "First file must be a .dat file")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
// If second file is not firmware image, return error
|
// If second file is not firmware image, return error
|
||||||
if filepath.Ext(reqData.Files[1]) != ".bin" {
|
if filepath.Ext(reqData.Files[1]) != ".bin" {
|
||||||
connErr(conn, nil, "Second file must be a .bin file")
|
connErr(conn, req.Type, nil, "Second file must be a .bin file")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
// Load individual DFU files
|
// Load individual DFU files
|
||||||
err := dev.DFU.LoadFiles(reqData.Files[0], reqData.Files[1])
|
err := dev.DFU.LoadFiles(reqData.Files[0], reqData.Files[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
connErr(conn, err, "Error loading firmware files")
|
connErr(conn, req.Type, err, "Error loading firmware files")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -276,9 +435,11 @@ func handleConnection(conn net.Conn, dev *infinitime.Device) {
|
|||||||
for event := range progress {
|
for event := range progress {
|
||||||
// Encode event on connection
|
// Encode event on connection
|
||||||
json.NewEncoder(conn).Encode(types.Response{
|
json.NewEncoder(conn).Encode(types.Response{
|
||||||
|
Type: req.Type,
|
||||||
Value: event,
|
Value: event,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
firmwareUpdating = false
|
||||||
}()
|
}()
|
||||||
|
|
||||||
// Set firmwareUpdating
|
// Set firmwareUpdating
|
||||||
@@ -286,16 +447,148 @@ func handleConnection(conn net.Conn, dev *infinitime.Device) {
|
|||||||
// Start DFU
|
// Start DFU
|
||||||
err = dev.DFU.Start()
|
err = dev.DFU.Start()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
connErr(conn, err, "Error performing upgrade")
|
connErr(conn, req.Type, err, "Error performing upgrade")
|
||||||
firmwareUpdating = false
|
firmwareUpdating = false
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
firmwareUpdating = false
|
firmwareUpdating = false
|
||||||
|
case types.ReqTypeFS:
|
||||||
|
if fs == nil {
|
||||||
|
connErr(conn, req.Type, nil, "BLE filesystem is not available")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
// If no data, return error
|
||||||
|
if req.Data == nil {
|
||||||
|
connErr(conn, req.Type, nil, "Data required for filesystem operations")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
var reqData types.ReqDataFS
|
||||||
|
// Decode data map to firmware upgrade request data
|
||||||
|
err = mapstructure.Decode(req.Data, &reqData)
|
||||||
|
if err != nil {
|
||||||
|
connErr(conn, req.Type, err, "Error decoding request data")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
switch reqData.Type {
|
||||||
|
case types.FSTypeDelete:
|
||||||
|
if len(reqData.Files) == 0 {
|
||||||
|
connErr(conn, req.Type, nil, "Remove FS command requires at least one file")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
for _, file := range reqData.Files {
|
||||||
|
err := fs.Remove(file)
|
||||||
|
if err != nil {
|
||||||
|
connErr(conn, req.Type, err, "Error removing file")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
json.NewEncoder(conn).Encode(types.Response{Type: req.Type})
|
||||||
|
case types.FSTypeMove:
|
||||||
|
if len(reqData.Files) != 2 {
|
||||||
|
connErr(conn, req.Type, nil, "Move FS command requires an old path and new path in the files list")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
err := fs.Rename(reqData.Files[0], reqData.Files[1])
|
||||||
|
if err != nil {
|
||||||
|
connErr(conn, req.Type, err, "Error moving file")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
json.NewEncoder(conn).Encode(types.Response{Type: req.Type})
|
||||||
|
case types.FSTypeMkdir:
|
||||||
|
if len(reqData.Files) == 0 {
|
||||||
|
connErr(conn, req.Type, nil, "Mkdir FS command requires at least one file")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
for _, file := range reqData.Files {
|
||||||
|
err := fs.Mkdir(file)
|
||||||
|
if err != nil {
|
||||||
|
connErr(conn, req.Type, err, "Error creating directory")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
json.NewEncoder(conn).Encode(types.Response{Type: req.Type})
|
||||||
|
case types.FSTypeList:
|
||||||
|
if len(reqData.Files) != 1 {
|
||||||
|
connErr(conn, req.Type, nil, "List FS command requires a path to list in the files list")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
entries, err := fs.ReadDir(reqData.Files[0])
|
||||||
|
if err != nil {
|
||||||
|
connErr(conn, req.Type, err, "Error reading directory")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
var out []types.FileInfo
|
||||||
|
for _, entry := range entries {
|
||||||
|
info, err := entry.Info()
|
||||||
|
if err != nil {
|
||||||
|
connErr(conn, req.Type, err, "Error getting file info")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
out = append(out, types.FileInfo{
|
||||||
|
Name: info.Name(),
|
||||||
|
Size: info.Size(),
|
||||||
|
IsDir: info.IsDir(),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
json.NewEncoder(conn).Encode(types.Response{
|
||||||
|
Type: req.Type,
|
||||||
|
Value: out,
|
||||||
|
})
|
||||||
|
case types.FSTypeWrite:
|
||||||
|
if len(reqData.Files) != 1 {
|
||||||
|
connErr(conn, req.Type, nil, "Write FS command requires a path to the file to write")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
file, err := fs.Create(reqData.Files[0], uint32(len(reqData.Data)))
|
||||||
|
if err != nil {
|
||||||
|
connErr(conn, req.Type, err, "Error creating file")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
_, err = file.WriteString(reqData.Data)
|
||||||
|
if err != nil {
|
||||||
|
connErr(conn, req.Type, err, "Error writing to file")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
json.NewEncoder(conn).Encode(types.Response{Type: req.Type})
|
||||||
|
case types.FSTypeRead:
|
||||||
|
if len(reqData.Files) != 1 {
|
||||||
|
connErr(conn, req.Type, nil, "Read FS command requires a path to the file to read")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
file, err := fs.Open(reqData.Files[0])
|
||||||
|
if err != nil {
|
||||||
|
connErr(conn, req.Type, err, "Error opening file")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
data, err := io.ReadAll(file)
|
||||||
|
if err != nil {
|
||||||
|
connErr(conn, req.Type, err, "Error reading from file")
|
||||||
|
break
|
||||||
|
}
|
||||||
|
json.NewEncoder(conn).Encode(types.Response{
|
||||||
|
Type: req.Type,
|
||||||
|
Value: string(data),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
case types.ReqTypeCancel:
|
||||||
|
if req.Data == nil {
|
||||||
|
connErr(conn, req.Type, nil, "No data provided. Cancel request requires request ID string as data.")
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
reqID, ok := req.Data.(string)
|
||||||
|
if !ok {
|
||||||
|
connErr(conn, req.Type, nil, "Invalid data. Cancel request required request ID string as data.")
|
||||||
|
}
|
||||||
|
// Stop notifications
|
||||||
|
done.Done(reqID)
|
||||||
|
json.NewEncoder(conn).Encode(types.Response{Type: req.Type})
|
||||||
|
default:
|
||||||
|
connErr(conn, req.Type, nil, fmt.Sprintf("Unknown request type %d", req.Type))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func connErr(conn net.Conn, err error, msg string) {
|
func connErr(conn net.Conn, resType int, err error, msg string) {
|
||||||
var res types.Response
|
var res types.Response
|
||||||
// If error exists, add to types.Response, otherwise don't
|
// If error exists, add to types.Response, otherwise don't
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -303,7 +596,7 @@ func connErr(conn net.Conn, err error, msg string) {
|
|||||||
res = types.Response{Message: fmt.Sprintf("%s: %s", msg, err)}
|
res = types.Response{Message: fmt.Sprintf("%s: %s", msg, err)}
|
||||||
} else {
|
} else {
|
||||||
log.Error().Msg(msg)
|
log.Error().Msg(msg)
|
||||||
res = types.Response{Message: msg}
|
res = types.Response{Message: msg, Type: resType}
|
||||||
}
|
}
|
||||||
res.Error = true
|
res.Error = true
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,9 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ArmenianTranslit struct{}
|
type ArmenianTranslit struct {
|
||||||
|
initComplete bool
|
||||||
|
}
|
||||||
|
|
||||||
var armenianMap = []string{
|
var armenianMap = []string{
|
||||||
"աու", "au",
|
"աու", "au",
|
||||||
@@ -120,16 +122,26 @@ var armenianMap = []string{
|
|||||||
"ւ", "",
|
"ւ", "",
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func (at *ArmenianTranslit) Init() {
|
||||||
lower := armenianMap
|
if !at.initComplete {
|
||||||
for i, val := range lower {
|
// Copy map as original will be changed
|
||||||
if i%2 == 1 {
|
lower := armenianMap
|
||||||
continue
|
// For every value in copied map
|
||||||
}
|
for i, val := range lower {
|
||||||
capital := strings.Title(val)
|
// If index is odd, skip
|
||||||
if capital != val {
|
if i%2 == 1 {
|
||||||
armenianMap = append(armenianMap, capital, strings.Title(armenianMap[i+1]))
|
continue
|
||||||
|
}
|
||||||
|
// Capitalize first letter
|
||||||
|
capital := strings.Title(val)
|
||||||
|
// If capital is not the same as lowercase
|
||||||
|
if capital != val {
|
||||||
|
// Add capital to map
|
||||||
|
armenianMap = append(armenianMap, capital, strings.Title(armenianMap[i+1]))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
// Set init complete to true so it is not run again
|
||||||
|
at.initComplete = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import (
|
|||||||
// conversion library.
|
// conversion library.
|
||||||
type ChineseTranslit struct{}
|
type ChineseTranslit struct{}
|
||||||
|
|
||||||
|
func (ChineseTranslit) Init() {}
|
||||||
|
|
||||||
func (ct *ChineseTranslit) Transliterate(s string) string {
|
func (ct *ChineseTranslit) Transliterate(s string) string {
|
||||||
// Create buffer for final output
|
// Create buffer for final output
|
||||||
outBuf := &bytes.Buffer{}
|
outBuf := &bytes.Buffer{}
|
||||||
@@ -37,6 +39,15 @@ func (ct *ChineseTranslit) Transliterate(s string) string {
|
|||||||
outBuf.WriteRune(char)
|
outBuf.WriteRune(char)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// If buffer contains characters
|
||||||
|
if tmpBuf.Len() > 0 {
|
||||||
|
// Convert to pinyin (without tones)
|
||||||
|
out := pinyin.LazyConvert(tmpBuf.String(), nil)
|
||||||
|
// Write space-separated string to output
|
||||||
|
outBuf.WriteString(strings.Join(out, " "))
|
||||||
|
// Reset temporary buffer
|
||||||
|
tmpBuf.Reset()
|
||||||
|
}
|
||||||
// Return output string
|
// Return output string
|
||||||
return outBuf.String()
|
return outBuf.String()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,8 @@ var compatJamoBlock = &unicode.RangeTable{
|
|||||||
// This was translated to Go from the code in https://codeberg.org/Freeyourgadget/Gadgetbridge
|
// This was translated to Go from the code in https://codeberg.org/Freeyourgadget/Gadgetbridge
|
||||||
type KoreanTranslit struct{}
|
type KoreanTranslit struct{}
|
||||||
|
|
||||||
|
func (KoreanTranslit) Init() {}
|
||||||
|
|
||||||
// User input consisting of isolated jamo is usually mapped to the KS X 1001 compatibility
|
// User input consisting of isolated jamo is usually mapped to the KS X 1001 compatibility
|
||||||
// block, but jamo resulting from decomposed syllables are mapped to the modern one. This
|
// block, but jamo resulting from decomposed syllables are mapped to the modern one. This
|
||||||
// function maps compat jamo to modern ones where possible and returns all other characters
|
// function maps compat jamo to modern ones where possible and returns all other characters
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ func Transliterate(s string, useMaps ...string) string {
|
|||||||
// Create variable to store modified string
|
// Create variable to store modified string
|
||||||
out := s
|
out := s
|
||||||
// If custom map exists
|
// If custom map exists
|
||||||
if customMap, ok := Transliterators["custom"]; ok {
|
if custom, ok := Transliterators["custom"]; ok {
|
||||||
// Perform transliteration with it
|
// Perform transliteration with it
|
||||||
out = customMap.Transliterate(out)
|
out = custom.Transliterate(out)
|
||||||
}
|
}
|
||||||
// For every map to use
|
// For every map to use
|
||||||
for _, useMap := range useMaps {
|
for _, useMap := range useMaps {
|
||||||
@@ -20,12 +20,13 @@ func Transliterate(s string, useMaps ...string) string {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// Get requested map
|
// Get requested map
|
||||||
translitMap, ok := Transliterators[useMap]
|
transliterator, ok := Transliterators[useMap]
|
||||||
if !ok {
|
if !ok {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
transliterator.Init()
|
||||||
// Perform transliteration
|
// Perform transliteration
|
||||||
out = translitMap.Transliterate(out)
|
out = transliterator.Transliterate(out)
|
||||||
}
|
}
|
||||||
// Return result
|
// Return result
|
||||||
return out
|
return out
|
||||||
@@ -36,10 +37,11 @@ func Transliterate(s string, useMaps ...string) string {
|
|||||||
// and returns the resulting string.
|
// and returns the resulting string.
|
||||||
type Transliterator interface {
|
type Transliterator interface {
|
||||||
Transliterate(string) string
|
Transliterate(string) string
|
||||||
|
Init()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Map implements Transliterator using a slice where
|
// Map implements Transliterator using a slice where
|
||||||
// every odd element is a key and every even one is a value
|
// every even element is a key and every odd one is a value
|
||||||
// which replaces the key.
|
// which replaces the key.
|
||||||
type Map []string
|
type Map []string
|
||||||
|
|
||||||
@@ -47,6 +49,8 @@ func (mt Map) Transliterate(s string) string {
|
|||||||
return strings.NewReplacer(mt...).Replace(s)
|
return strings.NewReplacer(mt...).Replace(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (Map) Init() {}
|
||||||
|
|
||||||
// Transliterators stores transliterator implementations for each supported language.
|
// Transliterators stores transliterator implementations for each supported language.
|
||||||
// Some of these were sourced from https://codeberg.org/Freeyourgadget/Gadgetbridge
|
// Some of these were sourced from https://codeberg.org/Freeyourgadget/Gadgetbridge
|
||||||
var Transliterators = map[string]Transliterator{
|
var Transliterators = map[string]Transliterator{
|
||||||
@@ -151,7 +155,7 @@ var Transliterators = map[string]Transliterator{
|
|||||||
"Ζ", "Z",
|
"Ζ", "Z",
|
||||||
"Η", "I",
|
"Η", "I",
|
||||||
"Ή", "I",
|
"Ή", "I",
|
||||||
"Θ", "TH",
|
"Θ", "Th",
|
||||||
"Ι", "I",
|
"Ι", "I",
|
||||||
"Ί", "I",
|
"Ί", "I",
|
||||||
"Ϊ", "I",
|
"Ϊ", "I",
|
||||||
@@ -159,7 +163,7 @@ var Transliterators = map[string]Transliterator{
|
|||||||
"Λ", "L",
|
"Λ", "L",
|
||||||
"Μ", "M",
|
"Μ", "M",
|
||||||
"Ν", "N",
|
"Ν", "N",
|
||||||
"Ξ", "KS",
|
"Ξ", "Ks",
|
||||||
"Ο", "O",
|
"Ο", "O",
|
||||||
"Ό", "O",
|
"Ό", "O",
|
||||||
"Π", "P",
|
"Π", "P",
|
||||||
@@ -170,8 +174,8 @@ var Transliterators = map[string]Transliterator{
|
|||||||
"Ύ", "Y",
|
"Ύ", "Y",
|
||||||
"Ϋ", "Y",
|
"Ϋ", "Y",
|
||||||
"Φ", "F",
|
"Φ", "F",
|
||||||
"Χ", "CH",
|
"Χ", "Ch",
|
||||||
"Ψ", "PS",
|
"Ψ", "Ps",
|
||||||
"Ω", "O",
|
"Ω", "O",
|
||||||
"Ώ", "O",
|
"Ώ", "O",
|
||||||
},
|
},
|
||||||
@@ -184,8 +188,8 @@ var Transliterators = map[string]Transliterator{
|
|||||||
"є", "je",
|
"є", "je",
|
||||||
"і", "i",
|
"і", "i",
|
||||||
"ї", "ji",
|
"ї", "ji",
|
||||||
"Ґ", "GH",
|
"Ґ", "Gh",
|
||||||
"Є", "JE",
|
"Є", "Je",
|
||||||
"І", "I",
|
"І", "I",
|
||||||
"Ї", "JI",
|
"Ї", "JI",
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user