Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/liut/kedge-go
Client library of kedge with Golang
https://github.com/liut/kedge-go
bt golang
Last synced: 2 days ago
JSON representation
Client library of kedge with Golang
- Host: GitHub
- URL: https://github.com/liut/kedge-go
- Owner: liut
- License: mit
- Created: 2021-08-31T08:42:47.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-09-22T15:15:06.000Z (over 3 years ago)
- Last Synced: 2024-06-21T09:42:25.216Z (7 months ago)
- Topics: bt, golang
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kedgecli
Client library of [kedge](https://github.com/liut/kedge) with Golang
## interfaces
```go
type ClientI interface {
Add(rd io.Reader, hat string) error
Drop(hash string) error
DropWithData(hash string) error
Exist(hash string) bool
GetHashes() Hashes
GetTorrents() ([]TorrentStatus, error)
GetTorrent(hash string) (*TorrentStatus, error)
Session() (*TeSession, error)
Stats() (*TeStatistics, error)
}```
## usage
```go
root := "/var/lib/store/root"
uri := "http://localhost:16180"
c := kedgecli.New(root, uri)// read metainfo as mi *MetaInfo
var buf bytes.Buffer
if err := mi.Write(&buf); err != nil {
return
}
err := c.Add(buf, "subdir")```