client

package
v0.0.0-...-bcded96 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HealthcheckHealthPath

func HealthcheckHealthPath() string

HealthcheckHealthPath computes a request path to the healthcheck action of health.

func ListKeysPath

func ListKeysPath() string

ListKeysPath computes a request path to the list action of keys.

Types

type Client

type Client struct {
	*goaclient.Client
	Encoder *goa.HTTPEncoder
	Decoder *goa.HTTPDecoder
}

Client is the GitHub SSH Keys service client.

func New

func New(c goaclient.Doer) *Client

New instantiates the client.

func (*Client) DecodeErrorResponse

func (c *Client) DecodeErrorResponse(resp *http.Response) (*goa.ErrorResponse, error)

DecodeErrorResponse decodes the ErrorResponse instance encoded in resp body.

func (*Client) DecodeUser

func (c *Client) DecodeUser(resp *http.Response) (*User, error)

DecodeUser decodes the User instance encoded in resp body.

func (*Client) DecodeUserCollection

func (c *Client) DecodeUserCollection(resp *http.Response) (UserCollection, error)

DecodeUserCollection decodes the UserCollection instance encoded in resp body.

func (*Client) HealthcheckHealth

func (c *Client) HealthcheckHealth(ctx context.Context, path string) (*http.Response, error)

Returns a 200 if service is available.

func (*Client) ListKeys

func (c *Client) ListKeys(ctx context.Context, path string, payload ListKeysPayload) (*http.Response, error)

Given a list of GitHub usernames, responds with list of public SSH keys for each User (associated to their GitHub account).

func (*Client) NewHealthcheckHealthRequest

func (c *Client) NewHealthcheckHealthRequest(ctx context.Context, path string) (*http.Request, error)

NewHealthcheckHealthRequest create the request corresponding to the healthcheck action endpoint of the health resource.

func (*Client) NewListKeysRequest

func (c *Client) NewListKeysRequest(ctx context.Context, path string, payload ListKeysPayload) (*http.Request, error)

NewListKeysRequest create the request corresponding to the list action endpoint of the keys resource.

type ListKeysPayload

type ListKeysPayload []string

ListKeysPayload is the keys list action payload.

type User

type User struct {
	// The list of the Github user's public SSH keys.
	Keys []*UserKey `form:"keys" json:"keys" xml:"keys"`
	// The username of the GitHub user.
	Username string `form:"username" json:"username" xml:"username"`
}

Response Type for a GitHub User's list of public SSH Keys (default view)

Identifier: application/vnd.user+json; view=default

func (*User) Validate

func (mt *User) Validate() (err error)

Validate validates the User media type instance.

type UserCollection

type UserCollection []*User

UserCollection is the media type for an array of User (default view)

Identifier: application/vnd.user+json; type=collection; view=default

func (UserCollection) Validate

func (mt UserCollection) Validate() (err error)

Validate validates the UserCollection media type instance.

type UserKey

type UserKey struct {
	// The ID of the public SSH key on GitHub.
	ID int `form:"id" json:"id" xml:"id"`
	// The public SSH key
	Key string `form:"key" json:"key" xml:"key"`
}

Type for a GitHub user's public SSH Key

func (*UserKey) Validate

func (ut *UserKey) Validate() (err error)

Validate validates the UserKey type instance.

Jump to

Keyboard shortcuts

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