transport

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2019 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EmptyBody string = ""
)

Variables

View Source
var RmapiUserAGent = "rmapi"
View Source
var UnAuthorizedError = errors.New("401 Unauthorized Error")

Functions

This section is empty.

Types

type AuthType

type AuthType int
const (
	EmptyBearer AuthType = iota
	DeviceBearer
	UserBearer
)

type BodyString

type BodyString struct {
	Content string
}

type HttpClientCtx

type HttpClientCtx struct {
	Client *http.Client
	Tokens model.AuthTokens
}

func CreateHttpClientCtx

func CreateHttpClientCtx(tokens model.AuthTokens) HttpClientCtx

func (HttpClientCtx) Delete

func (ctx HttpClientCtx) Delete(authType AuthType, url string, reqBody, resp interface{}) error

func (HttpClientCtx) Get

func (ctx HttpClientCtx) Get(authType AuthType, url string, body interface{}, target interface{}) error

func (HttpClientCtx) GetStream

func (ctx HttpClientCtx) GetStream(authType AuthType, url string) (io.ReadCloser, error)

func (HttpClientCtx) Post

func (ctx HttpClientCtx) Post(authType AuthType, url string, reqBody, resp interface{}) error

func (HttpClientCtx) Put

func (ctx HttpClientCtx) Put(authType AuthType, url string, reqBody, resp interface{}) error

func (HttpClientCtx) PutStream

func (ctx HttpClientCtx) PutStream(authType AuthType, url string, reqBody io.Reader) error

func (HttpClientCtx) Request

func (ctx HttpClientCtx) Request(authType AuthType, verb, url string, body io.Reader) (*http.Response, error)

Jump to

Keyboard shortcuts

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