Documentation ¶
Index ¶
- Constants
- Variables
- type APIError
- type Addon
- type AddonClient
- func (a *AddonClient) Create(opts *AddonCreateOpts) (addon *Addon, err error)
- func (a *AddonClient) Delete(addon *Addon) error
- func (a *AddonClient) Get(id string) (addon *Addon, err error)
- func (a *AddonClient) Head(id string) error
- func (a *AddonClient) List() (addons []*Addon, err error)
- func (a *AddonClient) Update(id string, opts *AddonUpdateOpts) (addon *Addon, err error)
- type AddonCreateOpts
- type AddonService
- type AddonUpdateOpts
- type App
- type AppClient
- type AppCreateOpts
- type AppService
- type Attachment
- type AttachmentClient
- type AttachmentCreateOpts
- type AttachmentService
- type Backup
- type Client
- type ConnHandler
- type Container
- type ContainerClient
- type ContainerService
- type Disk
- type DiskClient
- func (d *DiskClient) Create(appID string, opts *DiskCreateOpts) (disk *Disk, err error)
- func (d *DiskClient) Delete(disk *Disk) error
- func (d *DiskClient) Get(appID, diskID string) (disk *Disk, err error)
- func (d *DiskClient) Head(appID, diskID string) error
- func (d *DiskClient) List(appID string) (disks []*Disk, err error)
- func (d *DiskClient) Update(appID, diskID string, opts *DiskUpdateOpts) (disk *Disk, err error)
- type DiskCreateOpts
- type DiskService
- type DiskUpdateOpts
- type Domain
- type DomainClient
- func (d *DomainClient) Create(appID string, opts *DomainCreateOpts) (domain *Domain, err error)
- func (d *DomainClient) Delete(domain *Domain) error
- func (d *DomainClient) Get(appID, domainID string) (domain *Domain, err error)
- func (d *DomainClient) Head(appID, domainID string) error
- func (d *DomainClient) List(appID string) (domains []*Domain, err error)
- type DomainCreateOpts
- type DomainService
- type Env
- type EnvClient
- type EnvService
- type EnvSetOpts
- type EnvUnsetOpts
- type File
- type LogClient
- type LogEntry
- type LogHandler
- type LogService
- type LogStreamOpts
- type Plan
- type PlanClient
- type PlanOpts
- type PlanService
- type Process
- type ProcessClient
- func (p *ProcessClient) Attach(appID string, number int, handler ConnHandler) error
- func (r *ProcessClient) Create(appID string, opts *ProcessCreateOpts) (process *Process, err error)
- func (p *ProcessClient) List(appID string) (processes []*Process, err error)
- func (p *ProcessClient) Resize(appID string, number int, opts *ProcessResizeOpts) error
- func (p *ProcessClient) Update(appID string, opts *ProcessUpdateOpts) (processes []*Process, err error)
- type ProcessCreateOpts
- type ProcessResizeOpts
- type ProcessService
- type ProcessUpdateOpts
- type Quota
- type QuotaClient
- type QuotaService
- type Region
- type RegionClient
- type RegionService
- type Release
- type ReleaseClient
- type ReleaseCreateOpts
- type ReleaseService
- type Repo
- type Service
- type ServiceClient
- type ServiceService
- type User
- type UserClient
- type UserService
Constants ¶
View Source
const (
DefaultClientID = "lade-client"
)
Variables ¶
View Source
var ( DefaultScopes = []string{"app", "user", "offline"} Endpoint = oauth2.Endpoint{ AuthURL: defaultAPIURL + "/login/oauth2/authorize", TokenURL: defaultAPIURL + "/login/oauth2/token", AuthStyle: oauth2.AuthStyleInHeader, } )
View Source
var ErrNotFound = &APIError{ Type: "not_found", Message: "Resource not found", Status: http.StatusNotFound, }
View Source
var ErrServerError = &APIError{ Type: "server_error", Message: "Unexpected server error", Status: http.StatusInternalServerError, }
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type Addon ¶
type Addon struct { ID int `json:"id"` Name string `json:"name"` Owner *User `json:"owner"` Service *Service `json:"service"` PlanID string `json:"plan_id"` Region *Region `json:"region"` Release string `json:"release"` Public bool `json:"public"` Status string `json:"status"` Hostname string `json:"hostname"` Port int `json:"port"` Database string `json:"database"` Username string `json:"username"` Password string `json:"password"` BackupLimit int `json:"backup_limit"` BackupWindow string `json:"backup_window"` CreatedAt time.Time `json:"created_at"` }
type AddonClient ¶
type AddonClient struct {
// contains filtered or unexported fields
}
func (*AddonClient) Create ¶
func (a *AddonClient) Create(opts *AddonCreateOpts) (addon *Addon, err error)
func (*AddonClient) Delete ¶
func (a *AddonClient) Delete(addon *Addon) error
func (*AddonClient) Head ¶ added in v0.1.3
func (a *AddonClient) Head(id string) error
func (*AddonClient) List ¶
func (a *AddonClient) List() (addons []*Addon, err error)
func (*AddonClient) Update ¶
func (a *AddonClient) Update(id string, opts *AddonUpdateOpts) (addon *Addon, err error)
type AddonCreateOpts ¶
type AddonService ¶
type AddonUpdateOpts ¶
type AppCreateOpts ¶
type AppService ¶
type Attachment ¶
type AttachmentClient ¶
type AttachmentClient struct {
// contains filtered or unexported fields
}
func (*AttachmentClient) Create ¶
func (a *AttachmentClient) Create(appID, addonID string, opts *AttachmentCreateOpts) ( attachments []*Attachment, err error)
func (*AttachmentClient) Delete ¶
func (a *AttachmentClient) Delete(appID, addonID string) error
func (*AttachmentClient) List ¶
func (a *AttachmentClient) List(appID, addonID string) (attachments []*Attachment, err error)
type AttachmentCreateOpts ¶
type AttachmentCreateOpts struct {
Name string `json:"name"`
}
type AttachmentService ¶
type AttachmentService interface { Create(appID, addonID string, opts *AttachmentCreateOpts) ([]*Attachment, error) Delete(appID, addonID string) error List(appID, addonID string) ([]*Attachment, error) }
type Client ¶
type Client struct { Addon AddonService App AppService Attachment AttachmentService Container ContainerService Disk DiskService Domain DomainService Env EnvService Log LogService Plan PlanService Process ProcessService Quota QuotaService Region RegionService Release ReleaseService Service ServiceService User UserService // contains filtered or unexported fields }
func (*Client) SetUserAgent ¶
type ConnHandler ¶
type ContainerClient ¶
type ContainerClient struct {
// contains filtered or unexported fields
}
type ContainerService ¶
type DiskClient ¶ added in v0.1.4
type DiskClient struct {
// contains filtered or unexported fields
}
func (*DiskClient) Create ¶ added in v0.1.4
func (d *DiskClient) Create(appID string, opts *DiskCreateOpts) (disk *Disk, err error)
func (*DiskClient) Delete ¶ added in v0.1.4
func (d *DiskClient) Delete(disk *Disk) error
func (*DiskClient) Get ¶ added in v0.1.4
func (d *DiskClient) Get(appID, diskID string) (disk *Disk, err error)
func (*DiskClient) Head ¶ added in v0.1.4
func (d *DiskClient) Head(appID, diskID string) error
func (*DiskClient) List ¶ added in v0.1.4
func (d *DiskClient) List(appID string) (disks []*Disk, err error)
func (*DiskClient) Update ¶ added in v0.1.4
func (d *DiskClient) Update(appID, diskID string, opts *DiskUpdateOpts) (disk *Disk, err error)
type DiskCreateOpts ¶ added in v0.1.4
type DiskService ¶ added in v0.1.4
type DiskUpdateOpts ¶ added in v0.1.4
type DiskUpdateOpts struct {
PlanID string `json:"plan_id"`
}
type DomainClient ¶
type DomainClient struct {
// contains filtered or unexported fields
}
func (*DomainClient) Create ¶
func (d *DomainClient) Create(appID string, opts *DomainCreateOpts) (domain *Domain, err error)
func (*DomainClient) Delete ¶
func (d *DomainClient) Delete(domain *Domain) error
func (*DomainClient) Get ¶
func (d *DomainClient) Get(appID, domainID string) (domain *Domain, err error)
func (*DomainClient) Head ¶ added in v0.1.3
func (d *DomainClient) Head(appID, domainID string) error
type DomainCreateOpts ¶
type DomainCreateOpts struct {
Hostname string `json:"hostname"`
}
type DomainService ¶
type EnvClient ¶
type EnvClient struct {
// contains filtered or unexported fields
}
type EnvService ¶
type EnvService interface { List(appID string) ([]*Env, error) Set(appID string, opts *EnvSetOpts) ([]*Env, error) Unset(appID string, opts *EnvUnsetOpts) error }
type EnvSetOpts ¶
type EnvSetOpts struct {
Envs []*Env `json:"envs"`
}
func (*EnvSetOpts) AddEnv ¶
func (e *EnvSetOpts) AddEnv(name, value string)
type EnvUnsetOpts ¶
type EnvUnsetOpts struct {
Names []string `json:"names"`
}
type File ¶
func GetTarFile ¶
type LogClient ¶
type LogClient struct {
// contains filtered or unexported fields
}
func (*LogClient) AddonStream ¶
func (l *LogClient) AddonStream(addonID string, opts *LogStreamOpts, handler LogHandler) error
func (*LogClient) AppStream ¶
func (l *LogClient) AppStream(appID string, opts *LogStreamOpts, handler LogHandler) error
func (*LogClient) ReleaseStream ¶
func (l *LogClient) ReleaseStream(release *Release, opts *LogStreamOpts, handler LogHandler) error
type LogHandler ¶
type LogHandler func(context.CancelFunc, *LogEntry)
type LogService ¶
type LogService interface { AppStream(appID string, opts *LogStreamOpts, handler LogHandler) error AddonStream(addonID string, opts *LogStreamOpts, handler LogHandler) error ReleaseStream(release *Release, opts *LogStreamOpts, handler LogHandler) error }
type LogStreamOpts ¶
type PlanClient ¶
type PlanClient struct {
// contains filtered or unexported fields
}
type PlanService ¶
type Process ¶
type Process struct { ID int `json:"id"` Type string `json:"type"` AppID int `json:"app_id"` ReleaseID int `json:"release_id"` PlanID string `json:"plan_id"` Command string `json:"command"` Count int `json:"count"` Number int `json:"number"` Replicas int `json:"replicas"` CreatedAt time.Time `json:"created_at"` }
type ProcessClient ¶
type ProcessClient struct {
// contains filtered or unexported fields
}
func (*ProcessClient) Attach ¶
func (p *ProcessClient) Attach(appID string, number int, handler ConnHandler) error
func (*ProcessClient) Create ¶
func (r *ProcessClient) Create(appID string, opts *ProcessCreateOpts) (process *Process, err error)
func (*ProcessClient) List ¶
func (p *ProcessClient) List(appID string) (processes []*Process, err error)
func (*ProcessClient) Resize ¶
func (p *ProcessClient) Resize(appID string, number int, opts *ProcessResizeOpts) error
func (*ProcessClient) Update ¶
func (p *ProcessClient) Update(appID string, opts *ProcessUpdateOpts) (processes []*Process, err error)
type ProcessCreateOpts ¶
type ProcessResizeOpts ¶
type ProcessService ¶
type ProcessService interface { Attach(appID string, number int, handler ConnHandler) error Create(appID string, opts *ProcessCreateOpts) (*Process, error) List(appID string) ([]*Process, error) Resize(appID string, number int, opts *ProcessResizeOpts) error Update(appID string, opts *ProcessUpdateOpts) ([]*Process, error) }
type ProcessUpdateOpts ¶
type ProcessUpdateOpts struct {
Processes []*Process `json:"processes"`
}
func (*ProcessUpdateOpts) AddProcess ¶
func (p *ProcessUpdateOpts) AddProcess(ptype, planID string, replicas int)
type QuotaClient ¶ added in v0.1.1
type QuotaClient struct {
// contains filtered or unexported fields
}
func (*QuotaClient) Max ¶ added in v0.1.1
func (q *QuotaClient) Max() (quota *Quota, err error)
type QuotaService ¶ added in v0.1.1
type RegionClient ¶
type RegionClient struct {
// contains filtered or unexported fields
}
func (*RegionClient) List ¶
func (r *RegionClient) List() (regions []*Region, err error)
type RegionService ¶
type ReleaseClient ¶
type ReleaseClient struct {
// contains filtered or unexported fields
}
func (*ReleaseClient) Create ¶
func (r *ReleaseClient) Create(appID string, opts *ReleaseCreateOpts) (release *Release, err error)
type ReleaseCreateOpts ¶
type ReleaseCreateOpts struct {
Source *File `json:"source,omitnested"`
}
type ReleaseService ¶
type ServiceClient ¶
type ServiceClient struct {
// contains filtered or unexported fields
}
func (*ServiceClient) List ¶
func (s *ServiceClient) List() (services []*Service, err error)
type ServiceService ¶
type UserClient ¶
type UserClient struct {
// contains filtered or unexported fields
}
func (*UserClient) Me ¶ added in v0.1.1
func (u *UserClient) Me() (user *User, err error)
type UserService ¶
Click to show internal directories.
Click to hide internal directories.