Documentation
¶
Index ¶
- Constants
- Variables
- func AddonDestroy(app, addonID string) error
- func AppsDestroy(name string, currentName string) (*http.Response, error)
- func AppsList() (*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 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, stream bool, n int) (*http.Response, error)
- func LogsURL(app string) (*http.Response, 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 App
- type AppsPsRes
- type AppsRestartParams
- type AppsScaleParams
- type Container
- type CreateAppParams
- type Domain
- type DomainCreate
- type DomainRes
- type DomainsRes
- type Key
- type KeyIndex
- type ListAddonsParams
- type ListParams
- type LoginError
- type LoginResponse
- type NotFoundError
- type Operation
- type OperationResponse
- type PaymentRequiredError
- type Plan
- type PlansParams
- type ProvisionAddonParams
- type RequestFailedError
- type SelfResults
- type Statuses
- type UnprocessableEntity
- type UpgradeAddonParams
- type Variable
- type VariableSetParams
- type Variables
- type VariablesListParams
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)
func AuthFromConfig ¶ 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 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{}
}
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"`
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 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 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"`
SSL bool `json:"ssl"`
Validity time.Time `json:"validity"`
}
func DomainsAdd ¶ added in v1.1.0
func DomainsAdd(app string, d *DomainCreate) (Domain, error)
func DomainsList ¶ added in v1.1.0
func DomainsUpdate ¶ added in v1.1.0
type DomainCreate ¶
type DomainsRes ¶ added in v1.1.0
type DomainsRes struct {
Domains []Domain `json:"domains"`
}
type ListAddonsParams ¶
type ListAddonsParams struct {
Addons []*Addon `json:"addons"`
}
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 ProvisionAddonParams ¶
type ProvisionAddonParams struct {
Addon *Addon `json:"addon"`
Message string `json:"message,omitempty"`
Variables []string `json:"variables,omitempty"`
}
func AddonProvision ¶ added in v1.1.0
func AddonProvision(app, addon, planID string) (*ProvisionAddonParams, error)
type RequestFailedError ¶ added in v1.1.0
func NewRequestFailedError ¶ added in v1.1.0
func NewRequestFailedError(code int, msg string, req *http.Request) *RequestFailedError
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 UpgradeAddonParams ¶
type UpgradeAddonParams ProvisionAddonParams
func AddonUpgrade ¶ added in v1.1.0
func AddonUpgrade(app, addonID, planID string) (*UpgradeAddonParams, error)
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 VariablesListParams ¶
type VariablesListParams struct {
Variables Variables `json:"variables"`
}
Click to show internal directories.
Click to hide internal directories.