api

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// RxAPIKey is the regexp a valid API key should match.
	RxAPIKey = regexp.MustCompile("^[A-Za-z0-9]{22}$")
)

Functions

This section is empty.

Types

type ReqQuick

type ReqQuick struct {
	Data pgmetrics.Model `json:"data"`
}

ReqQuick is the request structure for RestV1.Quick.

func (*ReqQuick) IsValid

func (r *ReqQuick) IsValid() bool

IsValid returns true if this the fields in this object look valid.

type RespQuick

type RespQuick struct {
	URL  string `json:"url"`
	Code string `json:"code"`
}

RespQuick is the response structure for RestV1.Quick.

type RestV1

type RestV1 interface {
	Quick(ctx context.Context, req ReqQuick) (resp RespQuick, code int)
}

RestV1 is the interface definition of the public REST API, v1.

type RestV1Client

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

RestV1Client is a client for RestV1 servers.

func NewRestV1Client

func NewRestV1Client(base string, timeout time.Duration, retries int) *RestV1Client

NewRestV1Client creates a new client to talk to the specified base URL and with the given timeout.

func (*RestV1Client) Quick

func (c *RestV1Client) Quick(req ReqQuick) (resp RespQuick, err error)

Quick calls RestV1.Quick

Jump to

Keyboard shortcuts

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