This repository has been archived by the owner on Oct 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
/
api.go
109 lines (79 loc) · 2.85 KB
/
api.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
// Deprecated: This repo has moved inside Kubo in order to make it easier to
// keep kubo and the http-client in sync, please use github.com/ipfs/kubo/client/rpc instead.
package httpapi
import (
"context"
"net/http"
"github.com/ipfs/kubo/client/rpc"
ma "github.com/multiformats/go-multiaddr"
)
// Deprecated: use [rpc.DefaultPathName] instead.
const DefaultPathName = rpc.DefaultPathName
// Deprecated: use [rpc.DefaultPathRoot] instead.
const DefaultPathRoot = rpc.DefaultPathRoot
// Deprecated: use [rpc.DefaultApiFile] instead.
const DefaultApiFile = rpc.DefaultApiFile
// Deprecated: use [rpc.EnvDir] instead.
const EnvDir = rpc.EnvDir
// Deprecated: use [rpc.ErrApiNotFound] instead.
var ErrApiNotFound = rpc.ErrApiNotFound
// Deprecated: use [rpc.HttpApi] instead.
type HttpApi = rpc.HttpApi
// Deprecated: use [rpc.BlockAPI] instead.
type BlockAPI = rpc.BlockAPI
// Deprecated: use [rpc.HttpDagServ] instead.
type HttpDagServ = rpc.HttpDagServ
// Deprecated: use [rpc.DhtAPI] instead.
type DhtAPI = rpc.DhtAPI
// Deprecated: use [rpc.KeyAPI] instead.
type KeyAPI = rpc.KeyAPI
// Deprecated: use [rpc.NameAPI] instead.
type NameAPI = rpc.NameAPI
// Deprecated: use [rpc.ObjectAPI] instead.
type ObjectAPI = rpc.ObjectAPI
// Deprecated: use [rpc.PinAPI] instead.
type PinAPI = rpc.PinAPI
// Deprecated: use [rpc.PubsubAPI] instead.
type PubsubAPI = rpc.PubsubAPI
// Deprecated: use [rpc.RoutingAPI] instead.
type RoutingAPI = rpc.RoutingAPI
// Deprecated: use [rpc.SwarmAPI] instead.
type SwarmAPI = rpc.SwarmAPI
// Deprecated: use [rpc.UnixfsAPI] instead.
type UnixfsAPI = rpc.UnixfsAPI
// Deprecated: use [rpc.NewLocalApi] instead.
func NewLocalApi() (*HttpApi, error) {
return rpc.NewLocalApi()
}
// Deprecated: use [rpc.NewPathApi] instead.
func NewPathApi(ipfspath string) (*HttpApi, error) {
return rpc.NewPathApi(ipfspath)
}
// Deprecated: use [rpc.ApiAddr] instead.
func ApiAddr(ipfspath string) (ma.Multiaddr, error) {
return rpc.ApiAddr(ipfspath)
}
// Deprecated: use [rpc.NewApi] instead.
func NewApi(a ma.Multiaddr) (*HttpApi, error) {
return rpc.NewApi(a)
}
// Deprecated: use [rpc.NewApiWithClient] instead.
func NewApiWithClient(a ma.Multiaddr, c *http.Client) (*HttpApi, error) {
return rpc.NewApiWithClient(a, c)
}
// Deprecated: use [rpc.NewURLApiWithClient] instead.
func NewURLApiWithClient(url string, c *http.Client) (*HttpApi, error) {
return rpc.NewURLApiWithClient(url, c)
}
// Deprecated: use [rpc.Request] instead.
type Request = rpc.Request
// Deprecated: use [rpc.NewRequest] instead.
func NewRequest(ctx context.Context, url, command string, args ...string) *Request {
return rpc.NewRequest(ctx, url, command, args...)
}
// Deprecated: use [rpc.RequestBuilder] instead.
type RequestBuilder = rpc.RequestBuilder
// Deprecated: use [rpc.Error] instead.
type Error = rpc.Error
// Deprecated: use [rpc.Response] instead.
type Response = rpc.Response