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 Auth() (*users.User, 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 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 CurrentUser *users.User
View Source
var (
LoginAbortedErr = errors.New("canceled by user.")
)
Functions ¶
func AddonDestroy ¶ added in v1.1.0
func AppsRestart ¶ added in v1.1.0
func AppsRestart(app string, scope *AppsRestartParams) (*http.Response, error)
func AppsScale ¶ added in v1.1.0
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 ¶ added in v1.1.0
func CollaboratorRemove ¶ added in v1.1.0
func DomainsRemove ¶ added in v1.1.0
func IsRequestFailedError ¶ added in v1.1.0
func KeysDelete ¶ added in v1.1.0
func NewRequestFailedError ¶ added in v1.1.0
func NewRequestFailedError(res *http.Response, req *APIRequest) error
func VariableUnset ¶ added in v1.1.0
Types ¶
type APIRequest ¶ added in v1.1.0
type APIRequest struct {
NoAuth bool
URL string
Method string
Endpoint string
Token string
Expected Statuses
Params interface{}
HTTPRequest *http.Request
}
func (*APIRequest) BuildQueryFromParams ¶ added in v1.1.0
func (req *APIRequest) BuildQueryFromParams() (url.Values, error)
func (*APIRequest) Do ¶ added in v1.1.0
func (req *APIRequest) Do() (*http.Response, error)
Execute an API request and return its response/error
func (*APIRequest) FillDefaultValues ¶ added in v1.1.0
func (req *APIRequest) FillDefaultValues() error
type Addon ¶ added in v1.1.0
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 ¶ added in v1.1.0
type AddonProvider ¶ added in v1.1.0
type AddonProvider struct {
ID string `json:"id"`
LogoURL string `json:"logo_url"`
Name string `json:"name"`
}
func AddonProvidersList ¶ added in v1.1.0
func AddonProvidersList() ([]*AddonProvider, error)
type AddonRes ¶ added in v1.1.0
type AddonRes struct {
Addon Addon `json:"addon"`
Message string `json:"message,omitempty"`
Variables []string `json:"variables,omitempty"`
}
func AddonProvision ¶ added in v1.1.0
func AddonUpgrade ¶ added in v1.1.0
type App ¶ added in v1.1.0
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 AppsPsRes ¶ added in v1.1.0
type AppsPsRes struct {
Containers []Container `json:"containers"`
}
type AppsRestartParams ¶ added in v1.1.0
type AppsRestartParams struct {
Scope []string `json:"scope"`
}
type AppsScaleParams ¶ added in v1.1.0
type AppsScaleParams struct {
Containers []Container `json:"containers"`
}
type BadRequestError ¶
type BadRequestError struct {
ErrMessage string `json:"error"`
}
func (BadRequestError) Error ¶ added in v1.1.0
func (err BadRequestError) Error() string
type Collaborator ¶ added in v1.1.0
type Collaborator struct {
ID string `json:"id"`
Username string `json:"username"`
Email string `json:"email"`
Status string `json:"status"`
}
func CollaboratorAdd ¶ added in v1.1.0
func CollaboratorAdd(app string, email string) (Collaborator, error)
func CollaboratorsList ¶ added in v1.1.0
func CollaboratorsList(app string) ([]Collaborator, error)
type CollaboratorRes ¶ added in v1.1.0
type CollaboratorRes struct {
Collaborator Collaborator `json:"collaborator"`
}
type CollaboratorsRes ¶ added in v1.1.0
type CollaboratorsRes struct {
Collaborators []Collaborator `json:"collaborators"`
}
type Container ¶ added in v1.1.0
type CreateAppParams ¶ added in v1.1.0
type CreateAppParams struct {
App *App `json:"app"`
}
type Domain ¶ added in v1.1.0
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 ¶ added in v1.1.0
func DomainsUpdate ¶ added in v1.1.0
type DomainsRes ¶ added in v1.1.0
type DomainsRes struct {
Domains []Domain `json:"domains"`
}
type ListParams ¶ added in v1.1.0
type ListParams struct {
AddonProviders []*AddonProvider `json:"addon_providers"`
}
type LoginError ¶ added in v1.1.0
func (*LoginError) Error ¶ added in v1.1.0
func (err *LoginError) Error() string
type LoginResponse ¶ added in v1.1.0
type NotFoundError ¶ added in v1.1.0
func (NotFoundError) Error ¶ added in v1.1.0
func (err NotFoundError) Error() string
type Operation ¶ added in v1.1.0
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 OperationsShow ¶ added in v1.1.0
func (*Operation) ElapsedDuration ¶ added in v1.1.0
type OperationResponse ¶ added in v1.1.0
type OperationResponse struct {
Op Operation `json:"operation"`
}
type PaymentRequiredError ¶ added in v1.1.0
func (PaymentRequiredError) Error ¶ added in v1.1.0
func (err PaymentRequiredError) Error() string
type Plan ¶ added in v1.1.0
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 ¶ added in v1.1.0
type PlansParams ¶ added in v1.1.0
type PlansParams struct {
Plans []*Plan `json:"plans"`
}
type RequestFailedError ¶ added in v1.1.0
type RequestFailedError struct {
Code int
APIError error
Req *APIRequest
}
func (*RequestFailedError) Error ¶ added in v1.1.0
func (err *RequestFailedError) Error() string
func (*RequestFailedError) String ¶ added in v1.1.0
func (err *RequestFailedError) String() string
type SelfResults ¶ added in v1.1.0
type UnprocessableEntity ¶ added in v1.1.0
func (UnprocessableEntity) Error ¶ added in v1.1.0
func (err UnprocessableEntity) Error() string
type Variable ¶ added in v1.1.0
type VariableSetParams ¶ added in v1.1.0
type VariableSetParams struct {
Variable *Variable `json:"variable"`
}
type Variables ¶ added in v1.1.0
type Variables []*Variable
func VariablesList ¶ added in v1.1.0
func VariablesListWithoutAlias ¶ added in v1.1.0
type VariablesRes ¶ added in v1.1.0
type VariablesRes struct {
Variables Variables `json:"variables"`
}
Click to show internal directories.
Click to hide internal directories.