http

package
v0.0.0-...-a6ec481 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2017 License: MIT Imports: 7 Imported by: 1

Documentation

Overview

Package http implements http communication with the aria2 daemon

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAdapter

func NewAdapter(address, secret string) rpc.Adapter

NewAdapter creates a Caller with the http.DefaultClient

func NewClient

func NewClient(address, secret string) argo.Client

NewClient creates a Client with the http.DefaultClient

Types

type Poster

type Poster struct {
	Client SubPoster
	URL    string
}

Poster allows to send rpc.Request via http(s)

func NewPoster

func NewPoster(add string) Poster

NewPoster creates a Poster with the http.DefaultClient

func (Poster) Close

func (j Poster) Close() (err error)

Close gracefully closes the connection

func (Poster) Post

func (j Poster) Post(v rpc.Request) (reply rpc.Response, err error)

Post performs the Request

type SubPoster

type SubPoster interface {
	Post(url string, contentType string, body io.Reader) (*http.Response, error)
}

SubPoster allows to POST an io.Reader to an URL

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL