Documentation ¶
Index ¶
- Constants
- Variables
- func AddonDestroy(app, addonID string) error
- func AppsDestroy(name string, currentName string) (*http.Response, error)
- func AppsRestart(app string, scope *AppsRestartParams) (*http.Response, error)
- func AppsScale(app string, params *AppsScaleParams) (*http.Response, error)
- func AppsShow(app string) (*http.Response, error)
- func AuthFromConfig() (*users.User, error)
- func AuthUser(login, passwd string) (*users.User, error)
- func CollaboratorRemove(app string, id string) error
- func DomainsRemove(app string, id string) error
- func IsRequestFailedError(err error) bool
- func KeysDelete(id string) error
- func Login(email, password string) (*http.Response, error)
- func Logs(logsURL string, n int, filter string) (*http.Response, error)
- func LogsURL(app string) (*http.Response, error)
- func NewRequestFailedError(res *http.Response, req *APIRequest) error
- func ParseJSON(res *http.Response, data interface{}) error
- func Run(app string, command []string, env map[string]string) (*http.Response, error)
- func Self() (*users.User, error)
- func SignUp(email, password string) error
- func VariableUnset(app string, id string) error
- type APIRequest
- type Addon
- type AddonProvider
- type AddonRes
- type AddonsRes
- type App
- type AppsPsRes
- type AppsRestartParams
- type AppsScaleParams
- type Authenticator
- type BadRequestError
- type Collaborator
- type CollaboratorRes
- type CollaboratorsRes
- type Container
- type CreateAppParams
- type Domain
- type DomainRes
- type DomainsRes
- type Key
- type KeyIndex
- type ListParams
- type LoginError
- type LoginResponse
- type NotFoundError
- type Operation
- type OperationResponse
- type PaymentRequiredError
- type Plan
- type PlansParams
- type RequestFailedError
- type SelfResults
- type Statuses
- type UnprocessableEntity
- type Variable
- type VariableSetParams
- type Variables
- type VariablesRes
Constants ¶
View Source
const ( EnvNameMaxLength = 64 EnvValueMaxLength = 1024 )
Variables ¶
View Source
var ( ErrLoginAborted = errors.New("canceled by user.") ApiAuthenticator Authenticator ApiUrl string ApiVersion string )
View Source
var CurrentUser *users.User
Functions ¶
func AddonDestroy ¶
func AppsRestart ¶
func AppsRestart(app string, scope *AppsRestartParams) (*http.Response, error)
func AppsScale ¶
func AppsScale(app string, params *AppsScaleParams) (*http.Response, error)
Handling 422 error as not a standard 422 error
{ "errors": { "web": { "amount": ["is negative"] } } }
func AuthFromConfig ¶
func CollaboratorRemove ¶
func DomainsRemove ¶
func IsRequestFailedError ¶
func KeysDelete ¶
func NewRequestFailedError ¶
func NewRequestFailedError(res *http.Response, req *APIRequest) error
func VariableUnset ¶
Types ¶
type APIRequest ¶
type APIRequest struct { NoAuth bool URL string Method string Endpoint string Token string Expected Statuses Params interface{} HTTPRequest *http.Request }
func (*APIRequest) BuildQueryFromParams ¶
func (req *APIRequest) BuildQueryFromParams() (url.Values, error)
func (*APIRequest) Do ¶
func (req *APIRequest) Do() (*http.Response, error)
Execute an API request and return its response/error
func (*APIRequest) FillDefaultValues ¶
func (req *APIRequest) FillDefaultValues() error
type Addon ¶
type Addon struct { ID string `json:"id"` ResourceID string `json:"resource_id"` PlanID string `json:"plan_id"` AddonProviderID string `json:"addon_provider_id"` Plan *Plan `json:"plan"` AddonProvider *AddonProvider `json:"addon_provider"` }
func AddonsList ¶
type AddonProvider ¶
type AddonProvider struct { ID string `json:"id"` LogoURL string `json:"logo_url"` Name string `json:"name"` }
func AddonProvidersList ¶
func AddonProvidersList() ([]*AddonProvider, error)
type AddonRes ¶
type AddonRes struct { Addon Addon `json:"addon"` Message string `json:"message,omitempty"` Variables []string `json:"variables,omitempty"` }
func AddonProvision ¶
func AddonUpgrade ¶
type App ¶
type App struct { Id string `json:"_id"` Name string `json:"name"` Owner struct { Username string `json:"username"` Email string `json:"email"` } `json:"owner"` GitUrl string `json:"git_url"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"update_at"` }
func AppsCreate ¶
type AppsRestartParams ¶
type AppsRestartParams struct {
Scope []string `json:"scope"`
}
type AppsScaleParams ¶
type AppsScaleParams struct {
Containers []Container `json:"containers"`
}
type Authenticator ¶
type BadRequestError ¶
type BadRequestError struct {
ErrMessage string `json:"error"`
}
func (BadRequestError) Error ¶
func (err BadRequestError) Error() string
type Collaborator ¶
type Collaborator struct { ID string `json:"id"` Username string `json:"username"` Email string `json:"email"` Status string `json:"status"` }
func CollaboratorAdd ¶
func CollaboratorAdd(app string, email string) (Collaborator, error)
func CollaboratorsList ¶
func CollaboratorsList(app string) ([]Collaborator, error)
type CollaboratorRes ¶
type CollaboratorRes struct {
Collaborator Collaborator `json:"collaborator"`
}
type CollaboratorsRes ¶
type CollaboratorsRes struct {
Collaborators []Collaborator `json:"collaborators"`
}
type Container ¶
type CreateAppParams ¶
type CreateAppParams struct {
App *App `json:"app"`
}
type Domain ¶
type Domain struct { ID string `json:"id"` Name string `json:"name"` TlsCert string `json:"tlscert,omitempty"` TlsKey string `json:"tlskey,omitempty"` SSL bool `json:"ssl"` Validity time.Time `json:"validity"` }
func DomainsList ¶
func DomainsUpdate ¶
type DomainsRes ¶
type DomainsRes struct {
Domains []Domain `json:"domains"`
}
type ListParams ¶
type ListParams struct {
AddonProviders []*AddonProvider `json:"addon_providers"`
}
type LoginError ¶
func (*LoginError) Error ¶
func (err *LoginError) Error() string
type LoginResponse ¶
type NotFoundError ¶
func (NotFoundError) Error ¶
func (err NotFoundError) Error() string
type Operation ¶
type Operation struct { ID string `json:"id"` CreatedAt time.Time `json:"created_at"` FinishedAt time.Time `json:"finished_at"` Status string `json:"status"` Type string `json:"type"` Error string `json:"error"` }
func (*Operation) ElapsedDuration ¶
type OperationResponse ¶
type OperationResponse struct {
Op Operation `json:"operation"`
}
type PaymentRequiredError ¶
func (PaymentRequiredError) Error ¶
func (err PaymentRequiredError) Error() string
type Plan ¶
type Plan struct { ID string `json:"id"` LogoURL string `json:"logo_url"` DisplayName string `json:"display_name"` Name string `json:"name"` ShortDescription string `json:"short_description"` Description string `json:"description"` }
func AddonProviderPlansList ¶
type PlansParams ¶
type PlansParams struct {
Plans []*Plan `json:"plans"`
}
type RequestFailedError ¶
type RequestFailedError struct { Code int APIError error Req *APIRequest }
func (*RequestFailedError) Error ¶
func (err *RequestFailedError) Error() string
func (*RequestFailedError) String ¶
func (err *RequestFailedError) String() string
type SelfResults ¶
type UnprocessableEntity ¶
func (UnprocessableEntity) Error ¶
func (err UnprocessableEntity) Error() string
type Variable ¶
type VariableSetParams ¶
type VariableSetParams struct {
Variable *Variable `json:"variable"`
}
type Variables ¶
type Variables []*Variable
func VariableMultipleSet ¶
func VariablesList ¶
type VariablesRes ¶
type VariablesRes struct {
Variables Variables `json:"variables"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.