client

package
v0.1.3093 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2018 License: MIT, Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v0.1.2969

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

A Client is an HTTP client for our GraphQL endpoint.

func NewClient

func NewClient(endpoint string, logger *logger.Logger) *Client

NewClient returns a reference to a Client.

func (*Client) Run added in v0.1.2969

func (c *Client) Run(ctx context.Context, request *Request, resp interface{}) error

Run sends an HTTP request to the GraphQL server and deserializes the response or returns an error.

type Request added in v0.1.2969

type Request struct {
	Query     string                 `json:"query"`
	Variables map[string]interface{} `json:"variables"`

	// Header represent any request headers that will be set
	// when the request is made.
	Header http.Header `json:"-"`
}

Request is a GraphQL request.

func NewAuthorizedRequest

func NewAuthorizedRequest(token, query string) *Request

NewAuthorizedRequest returns a new GraphQL request with the authorization headers set for CircleCI auth.

func NewRequest added in v0.1.2969

func NewRequest(query string) *Request

NewRequest makes a new Request with the specified query string.

func (*Request) Var added in v0.1.2969

func (request *Request) Var(key string, value interface{})

Var sets a variable.

Jump to

Keyboard shortcuts

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