api

package
v9.1.54+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2020 License: MIT Imports: 16 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// AgentService is the agent service endpoint
	AgentService = "agent.api"
	// AuthService is the auth service endpoint
	AuthService = "auth.api"
	// EventService is the event service endpoint
	EventService = "event.api"
)
View Source
const AuthorizationHeader = "Authorization"

AuthorizationHeader is the name of the authorization header to use

Variables

This section is empty.

Functions

func BackendURL

func BackendURL(subdomain string, channel string) string

BackendURL return the base url to the API server

func Get

func Get(ctx context.Context, channel string, service string, basepath string, apiKey string) (*http.Response, error)

Get will invoke api for channel and basepath

func NewHTTPAPIClient

func NewHTTPAPIClient(config *httpclient.Config) (httpclient.Client, error)

NewHTTPAPIClient will return a new HTTP client for talking with the Pinpoint API it will only allow a trusted TLS connection with a valid TLS certificate signed by a trusted Certificate Authority and for a DNS name that is owned by Pinpoint

func NewHTTPAPIClientDefault

func NewHTTPAPIClientDefault() (httpclient.Client, error)

NewHTTPAPIClientDefault will return a new HTTP client for talking with the Pinpoint API it will only allow a trusted TLS connection with a valid TLS certificate signed by a trusted Certificate Authority and for a DNS name that is owned by Pinpoint the client will retry requests by default with a expotential backoff

func Post

func Post(ctx context.Context, channel string, service string, basepath string, apiKey string, obj interface{}) (*http.Response, error)

Post will invoke api for channel and basepath as JSON post

func SetAuthorization

func SetAuthorization(req *http.Request, apikey string)

SetAuthorization will set the authorization header

func SetUserAgent

func SetUserAgent(req *http.Request)

SetUserAgent will set the agent user agent

Types

This section is empty.

Jump to

Keyboard shortcuts

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