client

package
v0.0.0-...-f55361a Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2020 License: MIT Imports: 4 Imported by: 5

Documentation

Index

Constants

View Source
const (
	// BitlyBaseURL is the base URL for the Bitly v4 API
	BitlyBaseURL = "https://api-ssl.bitly.com/v4/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// Many of Bitly's API methods require an OAuth access token for authentication.
	// You can generate a generic access token by confirming your password on https://bitly.is/accesstoken.
	AccessToken string
}

Client contains all the functions to communicate between Bitly and your app.

func NewClient

func NewClient() *Client

NewClient returns a new Client pointer that can be chained with builder methods to set multiple configuration values inline without using pointers.

func (*Client) Call

func (c *Client) Call(urlSuffix string, httpMethod string, payload []byte) ([]byte, error)

Call sends a request to Bitly and receives the response.

func (*Client) WithAccessToken

func (c *Client) WithAccessToken(accessToken string) *Client

WithAccessToken sets a config AccessToken value returning a Client pointer for chaining.

Directories

Path Synopsis
Package bitlinks contains the methods to interact with the Bitlinks in Bitly Package bitlinks contains the methods to interact with the Bitlinks in Bitly
Package bitlinks contains the methods to interact with the Bitlinks in Bitly Package bitlinks contains the methods to interact with the Bitlinks in Bitly
Package bsds contains the methods to interact with the Branded Short Domains in Bitly Package bsds contains the methods to interact with the Branded Short Domains in Bitly
Package bsds contains the methods to interact with the Branded Short Domains in Bitly Package bsds contains the methods to interact with the Branded Short Domains in Bitly
Package groups contains the methods to interact with the Groups in Bitly Package groups contains the methods to interact with the Groups in Bitly
Package groups contains the methods to interact with the Groups in Bitly Package groups contains the methods to interact with the Groups in Bitly
Package organizations contains the methods to interact with the Organizations in Bitly Package organizations contains the methods to interact with the Organizations in Bitly
Package organizations contains the methods to interact with the Organizations in Bitly Package organizations contains the methods to interact with the Organizations in Bitly
Package users contains the methods to interact with the Users in Bitly Package users contains the methods to interact with the Users in Bitly
Package users contains the methods to interact with the Users in Bitly Package users contains the methods to interact with the Users in Bitly

Jump to

Keyboard shortcuts

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