Documentation ¶
Overview ¶
package soter implements a remote API interface for a running ipfs daemon
Index ¶
- Constants
- type Error
- type Request
- type RequestBuilder
- func (r *RequestBuilder) Arguments(args ...string) *RequestBuilder
- func (r *RequestBuilder) Body(body io.Reader) *RequestBuilder
- func (r *RequestBuilder) BodyBytes(body []byte) *RequestBuilder
- func (r *RequestBuilder) BodyString(body string) *RequestBuilder
- func (r *RequestBuilder) ExecGet(ctx context.Context, res interface{}) error
- func (r *RequestBuilder) ExecPost(ctx context.Context, res interface{}) error
- func (r *RequestBuilder) Get(ctx context.Context) (*Response, error)
- func (r *RequestBuilder) Header(name, value string) *RequestBuilder
- func (r *RequestBuilder) Option(key string, value interface{}) *RequestBuilder
- func (r *RequestBuilder) Send(ctx context.Context) (*Response, error)
- type Response
- type Soter
Constants ¶
View Source
const ( DefaultPathName = ".ipfs" DefaultPathRoot = "~/" + DefaultPathName DefaultApiFile = "api" EnvDir = "IPFS_PATH" )
View Source
const ( TRaw = iota TDirectory TFile TMetadata TSymlink )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
type Request struct { Ctx context.Context ApiBase string Command string Args []string Opts map[string]string Body io.Reader Headers map[string]string // contains filtered or unexported fields }
func NewRequest ¶
type RequestBuilder ¶
type RequestBuilder struct {
// contains filtered or unexported fields
}
RequestBuilder is an IPFS commands request builder.
func (*RequestBuilder) Arguments ¶
func (r *RequestBuilder) Arguments(args ...string) *RequestBuilder
Arguments adds the arguments to the args.
func (*RequestBuilder) Body ¶
func (r *RequestBuilder) Body(body io.Reader) *RequestBuilder
Body sets the request body to the given reader.
func (*RequestBuilder) BodyBytes ¶
func (r *RequestBuilder) BodyBytes(body []byte) *RequestBuilder
BodyBytes sets the request body to the given buffer.
func (*RequestBuilder) BodyString ¶
func (r *RequestBuilder) BodyString(body string) *RequestBuilder
BodyString sets the request body to the given string.
func (*RequestBuilder) ExecGet ¶
func (r *RequestBuilder) ExecGet(ctx context.Context, res interface{}) error
Exec sends the request a request and decodes the response.
func (*RequestBuilder) ExecPost ¶
func (r *RequestBuilder) ExecPost(ctx context.Context, res interface{}) error
Exec sends the request a request and decodes the response.
func (*RequestBuilder) Get ¶
func (r *RequestBuilder) Get(ctx context.Context) (*Response, error)
Send sends the request and return the response.
func (*RequestBuilder) Header ¶
func (r *RequestBuilder) Header(name, value string) *RequestBuilder
Header sets the given header.
func (*RequestBuilder) Option ¶
func (r *RequestBuilder) Option(key string, value interface{}) *RequestBuilder
Option sets the given option.
type Response ¶
type Response struct { Output io.ReadCloser Error *Error }
type Soter ¶
type Soter struct {
// contains filtered or unexported fields
}
func NewSoterWithClient ¶
func (*Soter) Cat ¶
func (s *Soter) Cat(path string) (io.ReadCloser, error)
Cat the content at the given path. Callers need to drain and close the returned reader after usage.
func (*Soter) QueryUserBalance ¶
func (*Soter) SetTimeout ¶
Click to show internal directories.
Click to hide internal directories.