-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinput_ipfs_repeat.go
65 lines (52 loc) · 1.16 KB
/
input_ipfs_repeat.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package main
import (
"fmt"
"net/url"
)
type IpfsSwarmPeersInput struct {
RepeatHttpParams
Verbose_ bool
Streams bool
Latency bool
Direction bool
}
func (i IpfsSwarmPeersInput) name() string {
return "ipfs_swarm_peers"
}
func (i IpfsSwarmPeersInput) info() string {
return i.RepeatHttpParams.info() + "_" + i.Tag
}
func (i IpfsSwarmPeersInput) paramsUrl() string {
values := url.Values{
"Verbose": {fmt.Sprintf("%v", i.Verbose_)},
"streams": {fmt.Sprintf("%v", i.Streams)},
"latency": {fmt.Sprintf("%v", i.Latency)},
"direction": {fmt.Sprintf("%v", i.Direction)},
}
return "?" + values.Encode()
}
type IpfsIdInput struct {
RepeatHttpParams
}
func (i IpfsIdInput) name() string {
return "ipfs_id"
}
func (i IpfsIdInput) info() string {
return i.RepeatHttpParams.info() + "_" + i.Tag
}
func (i IpfsIdInput) paramsUrl() string {
return ""
}
type IpfsRepoStat struct {
RepeatHttpParams
SizeOnly, Human bool
}
func (i IpfsRepoStat) name() string {
return "ipfs_repo_stat"
}
func (i IpfsRepoStat) info() string {
return i.RepeatHttpParams.info() + "_" + i.Tag
}
func (i IpfsRepoStat) paramsUrl() string {
return "?size-only=false&human=false"
}