Add LoadResources() to API

This commit is contained in:
2022-08-30 12:13:22 -07:00
parent e50c8430be
commit ec6d216346
4 changed files with 54 additions and 3 deletions

26
api/resources.go Normal file
View File

@@ -0,0 +1,26 @@
package api
import (
"context"
"go.arsenm.dev/infinitime"
)
// LoadResources loads resources onto the watch from the given
// file path to the resources zip
func (c *Client) LoadResources(ctx context.Context, path string) (<-chan infinitime.ResourceLoadProgress, error) {
progCh := make(chan infinitime.ResourceLoadProgress)
err := c.client.Call(
ctx,
"FS",
"LoadResources",
path,
progCh,
)
if err != nil {
return nil, err
}
return progCh, nil
}