apikit

package module
v0.0.0-...-396ab03 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2017 License: MIT Imports: 13 Imported by: 12

README

ApiKit GoDoc License Build Status

A golang library for Open APIs.

Install

$ go get github.com/douglarek/apikit

License

Licensed under the MIT License.

Documentation

Index

Constants

View Source
const (
	MediaJSON = "application/json;charset=utf-8"
	MediaForm = "application/x-www-form-urlencoded;charset=utf-8"
	MediaXML  = "application/xml;charset=utf-8"
)

Variables

This section is empty.

Functions

func Params

func Params(m0 map[string]interface{}) (m map[string]string)

Params expands a nested map.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

A Client manages communication with API.

func NewClient

func NewClient(httpClient *http.Client) *Client

NewClient returns a new API client.

func (*Client) AddHeader

func (c *Client) AddHeader(key, val string)

AddHeader adds a header mapping.

func (*Client) Do

func (c *Client) Do(req *http.Request, v interface{}) (*http.Response, error)

Do sends an API request and returns the API response.

func (*Client) NewRequest

func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)

NewRequest creates an API request.

func (*Client) SetHeader

func (c *Client) SetHeader(h H)

SetHeader sets a header.

type H

type H map[string]string

H is a map shortcut.

Directories

Path Synopsis
pay
Package pay provides several pay services API access.
Package pay provides several pay services API access.
ali
Package push provides several push services API access.
Package push provides several push services API access.
lc
xg
sms
Package sms provides several sms services API access.
Package sms provides several sms services API access.

Jump to

Keyboard shortcuts

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