goaci

package module
v0.0.0-...-b006f51 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

README

go-aci

Go ACI client library. WIP--don't use (yet).

Documentation

Overview

Package goaci is a a Cisco ACI client library for Go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NoRefresh

func NoRefresh(req *Request)

NoRefresh prevents token refresh check.

func Query

func Query(k, v string) func(req *Request)

Query sets query parameters.

func RequestTimeout

func RequestTimeout(x time.Duration) func(*Client)

RequestTimeout modifies the request timeout from the default.

Types

type Client

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

Client is an API client.

func NewClient

func NewClient(url, usr, pwd string, mods ...func(*Client)) (Client, error)

NewClient creates a new API client.

func (Client) Get

func (c Client) Get(path string, mods ...func(*Request)) (Response, error)

Get makes a GET request and returns a GJSON result.

func (Client) GetClass

func (c Client) GetClass(class string, mods ...func(*Request)) (Response, error)

GetClass makes a GET request by class and unwraps the results.

func (Client) GetDn

func (c Client) GetDn(dn string, mods ...func(*Request)) (Response, error)

GetDn makes a GET request by DN and unwraps the result.

func (Client) Login

func (c Client) Login() error

Login authenticates to the APIC.

func (Client) Post

func (c Client) Post(path, data string, mods ...func(*Request)) (Response, error)

Post makes a POST request and returns a GJSON result.

func (Client) Refresh

func (c Client) Refresh() error

Refresh refreshes the authentication token.

type Request

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

Request is an API request wrapper around http.Request.

func NewRequest

func NewRequest(method, uri string, body io.Reader, mods ...func(*Request)) Request

NewRequest creates a new Request against this client.

type Response

type Response = gjson.Result

Response is an API response returned by HTTP requests.

Jump to

Keyboard shortcuts

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