Documentation ¶
Index ¶
- type Client
- func (c *Client) CreateServer(server Server) (*Server, error)
- func (c *Client) DeleteServer(id int) error
- func (c *Client) Do(req *http.Request) (*http.Response, error)
- func (c *Client) DoJSON(req *http.Request, v interface{}) (*http.Response, error)
- func (c *Client) DoJSONRequest(method string, path string, body interface{}, v interface{}) (*http.Response, error)
- func (c *Client) GetCredentialByID(id int) (*Credential, error)
- func (c *Client) GetCredentialByName(name string) (*Credential, error)
- func (c *Client) GetServerByID(id int) (*Server, error)
- func (c *Client) GetServerByName(name string) (*Server, error)
- func (c *Client) ListCredentials() ([]Credential, error)
- func (c *Client) ListServers() ([]Server, error)
- func (c *Client) NewRequest(method string, path string, body interface{}) (*http.Request, error)
- func (c *Client) SetUserAgent(ua string) error
- type Credential
- type CredentialsListResponse
- type Server
- type ServerResponse
- type ServersListResponse
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 (*Client) DeleteServer ¶
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) GetCredentialByID ¶
func (c *Client) GetCredentialByID(id int) (*Credential, error)
func (*Client) GetCredentialByName ¶
func (c *Client) GetCredentialByName(name string) (*Credential, error)
func (*Client) ListCredentials ¶
func (c *Client) ListCredentials() ([]Credential, error)
ListCredentials
func (*Client) NewRequest ¶
NewRequest returns a new pre-configured HTTP Request
func (*Client) SetUserAgent ¶
SetUserAgent adds an additional user agent string to all requests
type Credential ¶
Credential
type CredentialsListResponse ¶
type CredentialsListResponse struct {
Credentials []Credential `json:"credentials"`
}
CredentialsListResponse
type Server ¶
type Server struct { ID int `json:"id,omitempty"` CredentialID int `json:"credential_id"` Platform string `json:"provider"` PlatformID string `json:"provider_id,omitempty"` Name string `json:"name"` Size string `json:"size"` Region string `json:"region"` //"ams2", PHPVersion string `json:"php_version"` IPAddress string `json:"ip_address,omitempty"` //null, PrivateIPAddress string `json:"private_ip_address,omitempty"` //null, BlackFireStatus string `json:"blackfire_status,omitempty"` //null, PaperTrailStatus string `json:"papertrail_status,omitempty"` //null, Revoked bool `json:"revoked,omitempty"` //false, CreatedAt string `json:"created_at,omitempty"` //"2016-12-15 15:04:05", IsReady bool `json:"is_ready,omitempty"` SSHPort int `json:"ssh_port,omitempty"` Tags []string `json:"tags,omitempty"` Network []int `json:"network,omitempty"` SudoPassword string `json:"sudo_password,omitempty"` DatabasePassword string `json:"database_password,omitempty"` }
Server
type ServerResponse ¶
type ServersListResponse ¶
type ServersListResponse struct {
Servers []Server `json:"servers"`
}
ServersListResponse
Click to show internal directories.
Click to hide internal directories.