github

package
v0.0.0-...-3d30972 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccessToken

func AccessToken(token string) func(*Client) error

AccessToken sets the access token used to query the API

func DisableSSLVerification

func DisableSSLVerification() func(*Client) error

DisableSSLVerification does exactly that

func Endpoint

func Endpoint(endpoint string) func(*Client) error

Endpoint is used for accessing GitHub Enterprise

func PreviewSchema

func PreviewSchema(schema string) func(*Client) error

PreviewSchema sets the Accept header to access preview schemas of the GitHub API, multiple schemas can be accessed via comma separated string

Types

type Client

type Client struct {
	Repository string
	Owner      string
	// contains filtered or unexported fields
}

Client for handling requests to the Github GraphQL API

func NewClient

func NewClient(repository string, options ...func(*Client) error) (*Client, error)

NewClient builds the client used to access the API

func (*Client) Query

func (c *Client) Query(q interface{}, vars map[string]interface{}) error

Query sends a query to the GitHub API

type PreviewSchemaTransport

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

PreviewSchemaTransport is used to access GraphQL schema's hidden behind an Accept header by GitHub

func (*PreviewSchemaTransport) RoundTrip

func (t *PreviewSchemaTransport) RoundTrip(r *http.Request) (*http.Response, error)

RoundTrip appends the Accept header and then executes the parent RoundTrip Transport

Jump to

Keyboard shortcuts

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