Add LoadResources() to API
This commit is contained in:
26
api/resources.go
Normal file
26
api/resources.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user