client

package
v0.1.3277 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2018 License: MIT, Apache-2.0 Imports: 7 Imported by: 0

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