Documentation
¶
Index ¶
- Variables
- func String() string
- type Client
- func (c *Client) GetMicroVM(ctx context.Context, vmid string) (*MicroVM, *Response, error)
- func (c *Client) GetPool(ctx context.Context, id string) (*Pool, *Response, error)
- func (c *Client) ListMicroVMs(ctx context.Context, pool string) (*MicroVMs, *Response, error)
- func (c *Client) ListPools(ctx context.Context, opts *ListOptions) (Pools, *Response, error)
- func (c *Client) PausePool(ctx context.Context, id string) (*Response, error)
- func (c *Client) Reload(ctx context.Context) (*Response, error)
- func (c *Client) ResumePool(ctx context.Context, id string) (*Response, error)
- func (c *Client) ScalePool(ctx context.Context, id string, replicas int) (*Response, error)
- type ClientOpt
- type Error
- type ListOptions
- type MicroVM
- type MicroVMs
- type Pool
- type PoolState
- type PoolStatus
- type Pools
- type Response
Constants ¶
This section is empty.
Variables ¶
var ( // Version is the version of the Fireactions. Version = "0.0.0" // Date is the date when the binary was built. Date = "1970-01-01T00:00:00Z" // Commit is the Git SHA of the commit that was built. Commit = "" )
var ( // ErrPoolNotFound is returned when a pool is not found ErrPoolNotFound = errors.New("pool not found") )
Functions ¶
Types ¶
type Client ¶
type Client struct {
// Endpoint is the Fireactions API endpoint.
Endpoint string
// UserAgent is the User-Agent header to send when communicating with the
// Fireactions API.
UserAgent string
// Username is the username to use when authenticating with the Fireactions API
Username string
// Password is the password to use when authenticating with the Fireactions API
Password string
// contains filtered or unexported fields
}
Client is a client for the Fireactions API.
func (*Client) GetMicroVM ¶ added in v0.4.0
GetMicroVM returns a MicroVM by VMID.
func (*Client) ListMicroVMs ¶ added in v0.3.0
ListMicroVMs returns a list of MicroVM(s). If pool is empty, returns all MicroVMs across all pools. If pool is specified, returns only MicroVMs from that pool.
func (*Client) ResumePool ¶
ResumePool resumes a pool by ID.
type ClientOpt ¶
type ClientOpt func(*Client)
ClientOpt is an option for a new Fireactions client.
func WithEndpoint ¶
WithEndpoint returns a ClientOpt that specifies the Fireactions API endpoint to use when making requests to the Fireactions API.
func WithHTTPClient ¶
WithHTTPClient returns a ClientOpt that specifies the HTTP client to use when making requests to the Fireactions API.
func WithPassword ¶
WithPassword returns a ClientOpt that specifies the password to use when authenticating with the Fireactions API.
func WithUserAgent ¶
WithUserAgent returns a ClientOpt that specifies the User-Agent header to use when making requests to the Fireactions API.
func WithUsername ¶
WithUsername returns a ClientOpt that specifies the username to use when authenticating with the Fireactions API.
type Error ¶
type Error struct {
Message string `json:"error"`
}
Error represents an error returned by the Fireactions API.
type ListOptions ¶
ListOptions specifies the optional parameters to various List methods that support pagination.
func (*ListOptions) Apply ¶
func (o *ListOptions) Apply(req *http.Request)
Apply modifies the request to include the optional pagination parameters.
type MicroVM ¶ added in v0.3.0
type MicroVM struct {
VMID string `json:"VMID"`
Pool string `json:"Pool"`
IPAddr string `json:"IPAddr"`
CreatedAt time.Time `json:"CreatedAt"`
}
MicroVM represents a Firecracker based virtual machine
type Pool ¶
type Pool struct {
Name string `json:"name"`
Replicas int `json:"replicas"`
CurrentReplicas int `json:"current_replicas"`
DesiredReplicas int `json:"desired_replicas"`
Organization string `json:"organization"`
GroupID int64 `json:"group_id"`
Labels []string `json:"labels"`
Image string `json:"image"`
Status PoolStatus `json:"status"`
}
Pool represents a pool of GitHub runners
type PoolStatus ¶
PoolStatus represents the status of a pool
type Response ¶
Response wraps an HTTP response.
func (*Response) HasNextPage ¶
HasNextPage returns true if the response has a next page.

