goforge

package
v0.0.0-...-e72bf43 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {

	// Base URL for API requests.
	BaseURL *url.URL

	// User agent for client
	UserAgent string
	// contains filtered or unexported fields
}

Client enables communication with the Laravel Forge API

func NewClient

func NewClient(httpClient *http.Client) (*Client, error)

NewClient returns a new API client.

func (*Client) CredentialsList

func (c *Client) CredentialsList() ([]Credential, error)

CredentialsList

func (*Client) Do

func (c *Client) Do(req *http.Request) (*http.Response, error)

Do performs a request and returns the response

func (*Client) DoJSON

func (c *Client) DoJSON(req *http.Request, v interface{}) (*http.Response, error)

DoJSON performs a request and returns the response

func (*Client) DoJSONRequest

func (c *Client) DoJSONRequest(method string, path string, body interface{}, v interface{}) (*http.Response, error)

DoJSONRequest is a convenience method

func (*Client) NewRequest

func (c *Client) NewRequest(method string, path string, body interface{}) (*http.Request, error)

NewRequest returns a new pre-configured HTTP Request

func (*Client) ServersList

func (c *Client) ServersList() ([]Server, error)

ServersList

func (*Client) SetUserAgent

func (c *Client) SetUserAgent(ua string) error

SetUserAgent adds an additional user agent string to all requests

type Credential

type Credential struct {
	ID   int    `json:"id"`
	Type string `json:"type"`
	Name string `json:"name"`
}

Credential

type CredentialsListResponse

type CredentialsListResponse struct {
	Credentials []Credential `json:"credentials"`
}

CredentialsListResponse

type Server

type Server struct {
	ID           int    `json:"id"`
	CredentialID int    `json:"credential_id"`
	Name         string `json:"name"`
	PHPVersion   string `json:"php_version"`
	IsReady      bool   `json:"is_ready"`
}

Server

type ServersListResponse

type ServersListResponse struct {
	Servers []Server `json:"servers"`
}

ServersListResponse

Jump to

Keyboard shortcuts

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