scalingo

package module
v4.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2022 License: BSD-4-Clause Imports: 21 Imported by: 1

README

Codeship Status for Scalingo/go-scalingo

Go client for Scalingo API v4.16.0

This repository is the Go client for the Scalingo APIs.

Getting Started

package main

import (
	"github.com/Scalingo/go-scalingo/v4"
)

func getClient() (*scalingo.Client, error) {
	config := scalingo.ClientConfig{
		APIEndpoint: "https://api.osc-fr1.scalingo.com", // Possible endpoints can be found at https://developers.scalingo.com/#endpoints
		APIToken: "tk-us-XYZXYZYZ", // You can create a token in the dashboard at Profile > Token > Create new token
	}
	return scalingo.New(config)
}

func main() {
	client, err := getClient()
	if err != nil {
		panic(err)
	}
	apps, err := client.AppsList()
	if err != nil {
		panic(err)
	}
	for _, app := range apps {
		println("App: " + app.Name)
	}
}

Explore

As this Go client maps all the public Scalingo APIs, you can explore the API documentation. If you need an implementation example, you can take a look at the Scalingo CLI code.

Repository Processes

Add Support for a New Event

A couple of files must be updated when adding support for a new event type. For instance if your event type is named my_event:

  • events_struct.go:
    • Add the EventMyEvent constant
    • Add the EventMyEventTypeData structure
    • Add EventMyEventType structure which embeds a field TypeData of the type EventMyEventTypeData.
    • Implement function String for EventMyEventType
    • Add support for this event type in the Specialize function
    • [optional] Implement Who function for EventMyEventType. E.g. if the event type can be created by an addon.
  • events_boilerplate.go: implement the TypeDataPtr function for the new EventMyEventType structure.
Client HTTP Errors

HTTP errors are managed in the file http/errors.go. It follows the Scalingo standards detailed in the developers documentation.

Release a New Version

Bump new version number in:

  • CHANGELOG.md
  • README.md
  • version.go

Commit, tag and create a new release:

git add CHANGELOG.md README.md version.go
git commit -m "Bump v4.16.0"
git tag v4.16.0
git push origin master v4.16.0
gh release create v4.16.0

The title of the release should be the version number and the text of the release is the same as the changelog.

Documentation

Overview

Package scalingo is a generated GoMock package.

Index

Constants

View Source
const (
	AppStatusNew        = AppStatus("new")
	AppStatusRunning    = AppStatus("running")
	AppStatusStopped    = AppStatus("stopped")
	AppStatusScaling    = AppStatus("scaling")
	AppStatusRestarting = AppStatus("restarting")
)
View Source
const (
	MetricMemory                = "memory"
	MetricSwap                  = "swap"
	MetricCPU                   = "cpu"
	MetricRouter5XX             = "5XX"
	MetricRouterAll             = "all"
	MetricRouterServersAmount   = "servers_amount"
	MetricRouterRPMPerContainer = "rpm_per_container"
	MetricRouterP95ResponseTime = "p95_response_time"
)

These constants contain the string repsentation for all metric available on Scalingo

View Source
const (
	RegionMigrationStatusCreated          RegionMigrationStatus = "created"
	RegionMigrationStatusPreflightSuccess RegionMigrationStatus = "preflight-success"
	RegionMigrationStatusPreflightError   RegionMigrationStatus = "preflight-error"
	RegionMigrationStatusRunning          RegionMigrationStatus = "running"
	RegionMigrationStatusPrepared         RegionMigrationStatus = "prepared"
	RegionMigrationStatusDataMigrated     RegionMigrationStatus = "data-migrated"
	RegionMigrationStatusAborting         RegionMigrationStatus = "aborting"
	RegionMigrationStatusAborted          RegionMigrationStatus = "aborted"
	RegionMigrationStatusError            RegionMigrationStatus = "error"
	RegionMigrationStatusDone             RegionMigrationStatus = "done"

	RegionMigrationStepAbort     RegionMigrationStep = "abort"
	RegionMigrationStepPreflight RegionMigrationStep = "preflight"
	RegionMigrationStepPrepare   RegionMigrationStep = "prepare"
	RegionMigrationStepData      RegionMigrationStep = "data"
	RegionMigrationStepFinalize  RegionMigrationStep = "finalize"

	StepStatusRunning StepStatus = "running"
	StepStatusDone    StepStatus = "done"
	StepStatusError   StepStatus = "error"
)

Variables

View Source
var ErrOTPRequired = errors.New("OTP Required")
View Source
var (
	ErrRegionNotFound = errgo.New("Region not found")
)
View Source
var (
	GithubLinkNotFoundErr = errors.New("No github SCM Repo Link")
)
View Source
var NotifierPlatformNames = map[string]string{
	"email":       "E-mail",
	"rocker_chat": "Rocket Chat",
	"slack":       "Slack",
	"webhook":     "Webhook",
}
View Source
var SCMTypeDisplay = map[SCMType]string{
	SCMGithubType:           "GitHub",
	SCMGitlabType:           "GitLab",
	SCMGithubEnterpriseType: "GitHub Enterprise",
	SCMGitlabSelfHostedType: "GitLab self-hosted",
}
View Source
var Version = "4.16.0"

Functions

func HasFailedString

func HasFailedString(status DeploymentStatus) bool

func IsFinishedString

func IsFinishedString(status DeploymentStatus) bool

func IsOTPRequired

func IsOTPRequired(err error) bool

IsOTPRequired tests if the authentication backend return an OTP Required error

func MockAuth

func MockAuth(ctrl *gomock.Controller) *httpmock.MockClient

Types

type ACMEErrorVariables

type ACMEErrorVariables struct {
	DNSProvider string   `json:"dns_provider"`
	Variables   []string `json:"variables"`
}

type Addon

type Addon struct {
	ID              string         `json:"id"`
	AppID           string         `json:"app_id"`
	ResourceID      string         `json:"resource_id"`
	Status          AddonStatus    `json:"status"`
	Plan            *Plan          `json:"plan"`
	AddonProvider   *AddonProvider `json:"addon_provider"`
	ProvisionedAt   time.Time      `json:"provisioned_at"`
	DeprovisionedAt time.Time      `json:"deprovisioned_at"`
}

type AddonLogsURLRes

type AddonLogsURLRes struct {
	URL string `json:"url"`
}

type AddonProvider

type AddonProvider struct {
	ID      string `json:"id"`
	LogoURL string `json:"logo_url"`
	Name    string `json:"name"`
}

type AddonProvidersService

type AddonProvidersService interface {
	AddonProvidersList() ([]*AddonProvider, error)
	AddonProviderPlansList(addon string) ([]*Plan, error)
}

type AddonProvisionParams

type AddonProvisionParams struct {
	AddonProviderID string            `json:"addon_provider_id"`
	PlanID          string            `json:"plan_id"`
	Options         map[string]string `json:"options"`
}

AddonProvisionParams gathers all arguments which can be sent to provision an addon

type AddonProvisionParamsWrapper

type AddonProvisionParamsWrapper struct {
	Addon AddonProvisionParams `json:"addon"`
}

type AddonRes

type AddonRes struct {
	Addon     Addon    `json:"addon"`
	Message   string   `json:"message,omitempty"`
	Variables []string `json:"variables,omitempty"`
}

type AddonStatus

type AddonStatus string
const (
	AddonStatusRunning      AddonStatus = "running"
	AddonStatusProvisioning AddonStatus = "provisioning"
	AddonStatusSuspended    AddonStatus = "suspended"
)

type AddonToken

type AddonToken struct {
	Token string `json:"token"`
}

type AddonTokenRes

type AddonTokenRes struct {
	Addon AddonToken `json:"addon"`
}

type AddonUpgradeParams

type AddonUpgradeParams struct {
	PlanID string `json:"plan_id"`
}

type AddonUpgradeParamsWrapper

type AddonUpgradeParamsWrapper struct {
	Addon AddonUpgradeParams `json:"addon"`
}

type AddonsRes

type AddonsRes struct {
	Addons []*Addon `json:"addons"`
}

type AddonsService

type AddonsService interface {
	AddonsList(app string) ([]*Addon, error)
	AddonProvision(app string, params AddonProvisionParams) (AddonRes, error)
	AddonDestroy(app, addonID string) error
	AddonUpgrade(app, addonID string, params AddonUpgradeParams) (AddonRes, error)
	AddonToken(app, addonID string) (string, error)
	AddonLogsURL(app, addonID string) (string, error)
	AddonLogsArchives(app, addonId string, page int) (*LogsArchivesResponse, error)
}

type Alert

type Alert struct {
	ID                    string        `json:"id"`
	AppID                 string        `json:"app_id"`
	ContainerType         string        `json:"container_type"`
	Metric                string        `json:"metric"`
	Limit                 float64       `json:"limit"`
	Disabled              bool          `json:"disabled"`
	SendWhenBelow         bool          `json:"send_when_below"`
	DurationBeforeTrigger time.Duration `json:"duration_before_trigger"`
	RemindEvery           string        `json:"remind_every"`
}

type AlertAddParams

type AlertAddParams struct {
	ContainerType         string
	Metric                string
	Limit                 float64
	RemindEvery           *time.Duration
	DurationBeforeTrigger *time.Duration
	SendWhenBelow         bool
	Notifiers             []string
}

type AlertRes

type AlertRes struct {
	Alert *Alert `json:"alert"`
}

type AlertUpdateParams

type AlertUpdateParams struct {
	ContainerType         *string        `json:"container_type,omitempty"`
	Metric                *string        `json:"metric,omitempty"`
	Limit                 *float64       `json:"limit,omitempty"`
	Disabled              *bool          `json:"disabled,omitempty"`
	DurationBeforeTrigger *time.Duration `json:"duration_before_trigger,omitempty"`
	RemindEvery           *time.Duration `json:"remind_every,omitempty"`
	SendWhenBelow         *bool          `json:"send_when_below,omitempty"`
	Notifiers             *[]string      `json:"notifiers,omitempty"`
}

type AlertsRes

type AlertsRes struct {
	Alerts []*Alert `json:"alerts"`
}

type AlertsService

type AlertsService interface {
	AlertsList(app string) ([]*Alert, error)
	AlertAdd(app string, params AlertAddParams) (*Alert, error)
	AlertShow(app, id string) (*Alert, error)
	AlertUpdate(app, id string, params AlertUpdateParams) (*Alert, error)
	AlertRemove(app, id string) error
}

type App

type App struct {
	Id     string `json:"id"`
	Name   string `json:"name"`
	Region string `json:"region"`
	Owner  struct {
		ID       string `json:"id"`
		Username string `json:"username"`
		Email    string `json:"email"`
	} `json:"owner"`
	GitUrl         string                 `json:"git_url"`
	Url            string                 `json:"url"`
	BaseURL        string                 `json:"base_url"`
	Status         AppStatus              `json:"status"`
	LastDeployedAt *time.Time             `json:"last_deployed_at"`
	LastDeployedBy string                 `json:"last_deployed_by"`
	CreatedAt      *time.Time             `json:"created_at"`
	UpdatedAt      *time.Time             `json:"updated_at"`
	Links          *AppLinks              `json:"links"`
	StackID        string                 `json:"stack_id"`
	StickySession  bool                   `json:"sticky_session"`
	ForceHTTPS     bool                   `json:"force_https"`
	RouterLogs     bool                   `json:"router_logs"`
	Flags          map[string]bool        `json:"flags"`
	Limits         map[string]interface{} `json:"limits"`
}

func (App) String

func (app App) String() string
type AppLinks struct {
	DeploymentsStream string `json:"deployments_stream"`
}

type AppResponse

type AppResponse struct {
	App *App `json:"app"`
}

type AppStatsRes

type AppStatsRes struct {
	Stats []*ContainerStat `json:"stats"`
}

type AppStatus

type AppStatus string

type AppsContainerTypesRes added in v4.13.0

type AppsContainerTypesRes struct {
	Containers []ContainerType `json:"containers"`
}

type AppsCreateOpts

type AppsCreateOpts struct {
	Name      string `json:"name"`
	ParentApp string `json:"parent_id,omitempty"`
	StackID   string `json:"stack_id,omitempty"`
}

type AppsPsRes

type AppsPsRes struct {
	Containers []Container `json:"containers"`
}

type AppsRestartParams

type AppsRestartParams struct {
	Scope []string `json:"scope"`
}

type AppsScaleParams

type AppsScaleParams struct {
	Containers []ContainerType `json:"containers"`
}

type AppsService

type AppsService interface {
	AppsList() ([]*App, error)
	AppsShow(appName string) (*App, error)
	AppsDestroy(name string, currentName string) error
	AppsRename(name string, newName string) (*App, error)
	AppsTransfer(name string, email string) (*App, error)
	AppsSetStack(name string, stackID string) (*App, error)
	AppsRestart(app string, scope *AppsRestartParams) (*http.Response, error)
	AppsCreate(opts AppsCreateOpts) (*App, error)
	AppsStats(app string) (*AppStatsRes, error)
	AppsContainerTypes(app string) ([]ContainerType, error)
	// Deprecated: Use AppsContainerTypes instead
	AppsPs(app string) ([]ContainerType, error)
	AppsContainersPs(app string) ([]Container, error)
	AppsScale(app string, params *AppsScaleParams) (*http.Response, error)
	AppsForceHTTPS(name string, enable bool) (*App, error)
	AppsStickySession(name string, enable bool) (*App, error)
	AppsRouterLogs(name string, enable bool) (*App, error)
}

type AuthStruct

type AuthStruct struct {
	Type string             `json:"type"`
	Data AuthenticationData `json:"data"`
}

type AuthenticationData

type AuthenticationData struct {
	Token string `json:"token"`
}

type Autoscaler

type Autoscaler struct {
	ID            string  `json:"id"`
	AppID         string  `json:"app_id"`
	ContainerType string  `json:"container_type"`
	Metric        string  `json:"metric"`
	Target        float64 `json:"target"`
	MinContainers int     `json:"min_containers"`
	MaxContainers int     `json:"max_containers"`
	Disabled      bool    `json:"disabled"`
}

type AutoscalerAddParams

type AutoscalerAddParams struct {
	ContainerType string  `json:"container_type"`
	Metric        string  `json:"metric"`
	Target        float64 `json:"target"`
	MinContainers int     `json:"min_containers"`
	MaxContainers int     `json:"max_containers"`
}

type AutoscalerRes

type AutoscalerRes struct {
	Autoscaler Autoscaler `json:"autoscaler"`
}

type AutoscalerUpdateParams

type AutoscalerUpdateParams struct {
	Metric        *string  `json:"metric,omitempty"`
	Target        *float64 `json:"target,omitempty"`
	MinContainers *int     `json:"min_containers,omitempty"`
	MaxContainers *int     `json:"max_containers,omitempty"`
	Disabled      *bool    `json:"disabled,omitempty"`
}

type AutoscalersRes

type AutoscalersRes struct {
	Autoscalers []Autoscaler `json:"autoscalers"`
}

type AutoscalersService

type AutoscalersService interface {
	AutoscalersList(app string) ([]Autoscaler, error)
	AutoscalerAdd(app string, params AutoscalerAddParams) (*Autoscaler, error)
	AutoscalerRemove(app string, id string) error
}

type Backup

type Backup struct {
	ID         string       `json:"id"`
	CreatedAt  time.Time    `json:"created_at"`
	Name       string       `json:"name"`
	Size       uint64       `json:"size"`
	Status     BackupStatus `json:"status"`
	DatabaseID string       `json:"database_id"`
	Direct     bool         `json:"direct"`
}

type BackupRes

type BackupRes struct {
	Backup Backup `json:"database_backup"`
}

type BackupStatus

type BackupStatus string
const (
	BackupStatusScheduled BackupStatus = "scheduled"
	BackupStatusRunning   BackupStatus = "running"
	BackupStatusDone      BackupStatus = "done"
	BackupStatusError     BackupStatus = "error"
)

type BackupsRes

type BackupsRes struct {
	Backups []Backup `json:"database_backups"`
}

type BackupsService

type BackupsService interface {
	BackupList(app, addonID string) ([]Backup, error)
	BackupCreate(app, addonID string) (*Backup, error)
	BackupShow(app, addonID, backupID string) (*Backup, error)
	BackupDownloadURL(app, addonID, backupID string) (string, error)
}

type BearerTokenRes

type BearerTokenRes struct {
	Token string `json:"token"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(cfg ClientConfig) (*Client, error)

func (*Client) AddonDestroy

func (c *Client) AddonDestroy(app, addonID string) error

func (*Client) AddonLogsArchives added in v4.15.0

func (c *Client) AddonLogsArchives(app, addonID string, page int) (*LogsArchivesResponse, error)

func (*Client) AddonLogsURL

func (c *Client) AddonLogsURL(app, addonID string) (string, error)

func (*Client) AddonProviderPlansList

func (c *Client) AddonProviderPlansList(addon string) ([]*Plan, error)

func (*Client) AddonProvidersList

func (c *Client) AddonProvidersList() ([]*AddonProvider, error)

func (*Client) AddonProvision

func (c *Client) AddonProvision(app string, params AddonProvisionParams) (AddonRes, error)

func (*Client) AddonShow

func (c *Client) AddonShow(app, addonID string) (Addon, error)

func (*Client) AddonToken

func (c *Client) AddonToken(app, addonID string) (string, error)

func (*Client) AddonUpgrade

func (c *Client) AddonUpgrade(app, addonID string, params AddonUpgradeParams) (AddonRes, error)

func (*Client) AddonsList

func (c *Client) AddonsList(app string) ([]*Addon, error)

func (*Client) AlertAdd

func (c *Client) AlertAdd(app string, params AlertAddParams) (*Alert, error)

func (*Client) AlertRemove

func (c *Client) AlertRemove(app, id string) error

func (*Client) AlertShow

func (c *Client) AlertShow(app, id string) (*Alert, error)

func (*Client) AlertUpdate

func (c *Client) AlertUpdate(app, id string, params AlertUpdateParams) (*Alert, error)

func (*Client) AlertsList

func (c *Client) AlertsList(app string) ([]*Alert, error)

func (*Client) AppsContainerTypes added in v4.13.0

func (c *Client) AppsContainerTypes(app string) ([]ContainerType, error)

func (*Client) AppsContainersPs added in v4.13.0

func (c *Client) AppsContainersPs(app string) ([]Container, error)

func (*Client) AppsCreate

func (c *Client) AppsCreate(opts AppsCreateOpts) (*App, error)

func (*Client) AppsDestroy

func (c *Client) AppsDestroy(name string, currentName string) error

func (*Client) AppsForceHTTPS

func (c *Client) AppsForceHTTPS(name string, enable bool) (*App, error)

func (*Client) AppsList

func (c *Client) AppsList() ([]*App, error)

func (*Client) AppsPs deprecated

func (c *Client) AppsPs(app string) ([]ContainerType, error)

Deprecated: Use AppsContainerTypes instead

func (*Client) AppsRename

func (c *Client) AppsRename(name string, newName string) (*App, error)

func (*Client) AppsRestart

func (c *Client) AppsRestart(app string, scope *AppsRestartParams) (*http.Response, error)

func (*Client) AppsRouterLogs added in v4.15.0

func (c *Client) AppsRouterLogs(name string, enable bool) (*App, error)

func (*Client) AppsScale

func (c *Client) AppsScale(app string, params *AppsScaleParams) (*http.Response, error)

func (*Client) AppsSetStack

func (c *Client) AppsSetStack(app string, stackID string) (*App, error)

func (*Client) AppsShow

func (c *Client) AppsShow(appName string) (*App, error)

func (*Client) AppsStats

func (c *Client) AppsStats(app string) (*AppStatsRes, error)

func (*Client) AppsStickySession

func (c *Client) AppsStickySession(name string, enable bool) (*App, error)

func (*Client) AppsTransfer

func (c *Client) AppsTransfer(name string, email string) (*App, error)

func (*Client) AuthAPI

func (c *Client) AuthAPI() http.Client

func (*Client) AutoscalerAdd

func (c *Client) AutoscalerAdd(app string, params AutoscalerAddParams) (*Autoscaler, error)

func (*Client) AutoscalerRemove

func (c *Client) AutoscalerRemove(app, id string) error

func (*Client) AutoscalerShow

func (c *Client) AutoscalerShow(app, id string) (*Autoscaler, error)

func (*Client) AutoscalerUpdate

func (c *Client) AutoscalerUpdate(app, id string, params AutoscalerUpdateParams) (*Autoscaler, error)

func (*Client) AutoscalersList

func (c *Client) AutoscalersList(app string) ([]Autoscaler, error)

func (*Client) BackupCreate

func (c *Client) BackupCreate(app, addonID string) (*Backup, error)

func (*Client) BackupDownloadURL

func (c *Client) BackupDownloadURL(app, addonID, backupID string) (string, error)

func (*Client) BackupList

func (c *Client) BackupList(app string, addonID string) ([]Backup, error)

func (*Client) BackupShow

func (c *Client) BackupShow(app, addonID, backup string) (*Backup, error)

func (*Client) CollaboratorAdd

func (c *Client) CollaboratorAdd(app string, email string) (Collaborator, error)

func (*Client) CollaboratorRemove

func (c *Client) CollaboratorRemove(app string, id string) error

func (*Client) CollaboratorsList

func (c *Client) CollaboratorsList(app string) ([]Collaborator, error)

func (*Client) ContainerSizesList added in v4.15.0

func (c *Client) ContainerSizesList() ([]ContainerSize, error)

func (*Client) ContainersStop added in v4.13.0

func (c *Client) ContainersStop(appName, containerID string) error

func (*Client) CreateRegionMigration

func (c *Client) CreateRegionMigration(appID string, params RegionMigrationParams) (RegionMigration, error)

func (*Client) CronTasksGet added in v4.13.1

func (c *Client) CronTasksGet(app string) (CronTasks, error)

func (*Client) DBAPI

func (c *Client) DBAPI(app, addon string) http.Client

func (*Client) DatabaseShow

func (c *Client) DatabaseShow(app, addonID string) (Database, error)

func (Client) DatabaseTypeVersion

func (c Client) DatabaseTypeVersion(appID, addonID, versionID string) (DatabaseTypeVersion, error)

func (*Client) Deployment

func (c *Client) Deployment(app string, deploy string) (*Deployment, error)

func (*Client) DeploymentCacheReset

func (c *Client) DeploymentCacheReset(app string) error

func (*Client) DeploymentList

func (c *Client) DeploymentList(app string) ([]*Deployment, error)

func (*Client) DeploymentListWithPagination added in v4.14.0

func (c *Client) DeploymentListWithPagination(app string, opts PaginationOpts) ([]*Deployment, PaginationMeta, error)

func (*Client) DeploymentLogs

func (c *Client) DeploymentLogs(deployURL string) (*http.Response, error)

func (*Client) DeploymentStream

func (c *Client) DeploymentStream(deployURL string) (*websocket.Conn, error)

DeploymentStream returns a websocket connection to follow the various deployment events happening on an application. The type of the data sent on this connection is DeployEvent.

func (*Client) DeploymentsCreate

func (c *Client) DeploymentsCreate(app string, params *DeploymentsCreateParams) (*Deployment, error)

func (*Client) DomainSetCanonical

func (c *Client) DomainSetCanonical(app, id string) (Domain, error)

func (*Client) DomainSetCertificate added in v4.16.0

func (c *Client) DomainSetCertificate(app, id, tlsCert, tlsKey string) (Domain, error)

func (*Client) DomainUnsetCanonical

func (c *Client) DomainUnsetCanonical(app string) (Domain, error)

func (*Client) DomainUnsetCertificate added in v4.16.0

func (c *Client) DomainUnsetCertificate(app, id string) (Domain, error)

func (*Client) DomainsAdd

func (c *Client) DomainsAdd(app string, d Domain) (Domain, error)

func (*Client) DomainsList

func (c *Client) DomainsList(app string) ([]Domain, error)

func (*Client) DomainsRemove

func (c *Client) DomainsRemove(app, id string) error

func (*Client) DomainsShow

func (c *Client) DomainsShow(app, id string) (Domain, error)

func (*Client) DomainsUpdate deprecated

func (c *Client) DomainsUpdate(app, id, tlsCert, tlsKey string) (Domain, error)

Deprecated: use DomainsSetCanonical, DomainUnsetCanonical, DomainSetCertificate or DomainUnsetCertificate

func (*Client) EventCategoriesList

func (c *Client) EventCategoriesList() ([]EventCategory, error)

func (*Client) EventTypesList

func (c *Client) EventTypesList() ([]EventType, error)

func (*Client) EventsList

func (c *Client) EventsList(app string, opts PaginationOpts) (Events, PaginationMeta, error)

func (*Client) GetAccessToken

func (c *Client) GetAccessToken() (string, error)

func (*Client) GithubLinkAdd

func (c *Client) GithubLinkAdd(app string, params GithubLinkParams) (*GithubLink, error)

func (*Client) GithubLinkDelete

func (c *Client) GithubLinkDelete(app, id string) error

func (*Client) GithubLinkManualDeploy

func (c *Client) GithubLinkManualDeploy(app, id, branch string) error

func (*Client) GithubLinkShow

func (c *Client) GithubLinkShow(app string) (*GithubLink, error)

func (*Client) GithubLinkUpdate

func (c *Client) GithubLinkUpdate(app, id string, params GithubLinkParams) (*GithubLink, error)

func (*Client) KeysAdd

func (c *Client) KeysAdd(name string, content string) (*Key, error)

func (*Client) KeysDelete

func (c *Client) KeysDelete(id string) error

func (*Client) KeysList

func (c *Client) KeysList() ([]Key, error)

func (*Client) ListRegionMigrations

func (c *Client) ListRegionMigrations(appID string) ([]RegionMigration, error)

func (*Client) LogDrainAdd

func (c *Client) LogDrainAdd(app string, params LogDrainAddParams) (*LogDrainRes, error)

func (*Client) LogDrainAddonAdd

func (c *Client) LogDrainAddonAdd(app string, addonID string, params LogDrainAddParams) (*LogDrainRes, error)

func (*Client) LogDrainAddonRemove

func (c *Client) LogDrainAddonRemove(app, addonID string, URL string) error

func (*Client) LogDrainRemove

func (c *Client) LogDrainRemove(app, URL string) error

func (*Client) LogDrainsAddonList

func (c *Client) LogDrainsAddonList(app string, addonID string) ([]LogDrain, error)

func (*Client) LogDrainsList

func (c *Client) LogDrainsList(app string) ([]LogDrain, error)

func (*Client) Login

func (c *Client) Login(email, password string) (*LoginResponse, error)

func (*Client) Logs

func (c *Client) Logs(logsURL string, n int, filter string) (*http.Response, error)

func (*Client) LogsArchives

func (c *Client) LogsArchives(app string, page int) (*LogsArchivesResponse, error)

func (*Client) LogsArchivesByCursor

func (c *Client) LogsArchivesByCursor(app string, cursor string) (*LogsArchivesResponse, error)

func (*Client) LogsURL

func (c *Client) LogsURL(app string) (*http.Response, error)

func (*Client) NotificationPlatformByName

func (c *Client) NotificationPlatformByName(name string) ([]*NotificationPlatform, error)

func (*Client) NotificationPlatformsList

func (c *Client) NotificationPlatformsList() ([]*NotificationPlatform, error)

func (*Client) NotifierByID

func (c *Client) NotifierByID(app, ID string) (*Notifier, error)

func (*Client) NotifierDestroy

func (c *Client) NotifierDestroy(app, ID string) error

func (*Client) NotifierProvision

func (c *Client) NotifierProvision(app string, params NotifierParams) (*Notifier, error)

func (*Client) NotifierUpdate

func (c *Client) NotifierUpdate(app, ID string, params NotifierParams) (*Notifier, error)

func (*Client) NotifiersList

func (c *Client) NotifiersList(app string) (Notifiers, error)

func (*Client) OperationsShow

func (c *Client) OperationsShow(app string, opID string) (*Operation, error)

func (*Client) OperationsShowFromURL

func (c *Client) OperationsShowFromURL(url string) (*Operation, error)

func (*Client) PeriodicBackupsConfig

func (c *Client) PeriodicBackupsConfig(app, addonID string, params PeriodicBackupsConfigParams) (Database, error)

func (*Client) RegionsList

func (c *Client) RegionsList() ([]Region, error)

func (*Client) Run

func (c *Client) Run(opts RunOpts) (*RunRes, error)

func (*Client) RunRegionMigrationStep

func (c *Client) RunRegionMigrationStep(appID, migrationID string, step RegionMigrationStep) error

func (*Client) SCMIntegrationsCreate

func (c *Client) SCMIntegrationsCreate(scmType SCMType, url string, accessToken string) (*SCMIntegration, error)

func (*Client) SCMIntegrationsDelete

func (c *Client) SCMIntegrationsDelete(id string) error

func (*Client) SCMIntegrationsImportKeys

func (c *Client) SCMIntegrationsImportKeys(id string) ([]Key, error)

func (*Client) SCMIntegrationsList

func (c *Client) SCMIntegrationsList() ([]SCMIntegration, error)

func (*Client) SCMIntegrationsShow

func (c *Client) SCMIntegrationsShow(id string) (*SCMIntegration, error)

func (*Client) SCMRepoLinkCreate

func (c *Client) SCMRepoLinkCreate(app string, params SCMRepoLinkCreateParams) (*SCMRepoLink, error)

func (*Client) SCMRepoLinkDelete

func (c *Client) SCMRepoLinkDelete(app string) error

func (*Client) SCMRepoLinkDeployments

func (c *Client) SCMRepoLinkDeployments(app string) ([]*Deployment, error)
func (c *Client) SCMRepoLinkList(opts PaginationOpts) ([]*SCMRepoLink, PaginationMeta, error)

func (*Client) SCMRepoLinkManualDeploy

func (c *Client) SCMRepoLinkManualDeploy(app, branch string) error

func (*Client) SCMRepoLinkManualReviewApp

func (c *Client) SCMRepoLinkManualReviewApp(app, pullRequestId string) error

func (*Client) SCMRepoLinkReviewApps

func (c *Client) SCMRepoLinkReviewApps(app string) ([]*ReviewApp, error)

func (*Client) SCMRepoLinkShow

func (c *Client) SCMRepoLinkShow(app string) (*SCMRepoLink, error)

func (*Client) SCMRepoLinkUpdate

func (c *Client) SCMRepoLinkUpdate(app string, params SCMRepoLinkUpdateParams) (*SCMRepoLink, error)

func (*Client) ScalingoAPI

func (c *Client) ScalingoAPI() http.Client

func (*Client) Self

func (c *Client) Self() (*User, error)

func (*Client) ShowRegionMigration

func (c *Client) ShowRegionMigration(appID, migrationID string) (RegionMigration, error)

func (*Client) SignUp

func (c *Client) SignUp(email, password string) error

func (*Client) SourcesCreate

func (c *Client) SourcesCreate() (*Source, error)

func (*Client) StacksList

func (c *Client) StacksList() ([]Stack, error)

func (*Client) TokenCreate

func (c *Client) TokenCreate(params TokenCreateParams) (Token, error)

func (*Client) TokenCreateWithLogin

func (c *Client) TokenCreateWithLogin(params TokenCreateParams, login LoginParams) (Token, error)

func (*Client) TokenExchange

func (c *Client) TokenExchange(token string) (string, error)

func (*Client) TokenShow

func (c *Client) TokenShow(id int) (Token, error)

func (*Client) TokensList

func (c *Client) TokensList() (Tokens, error)

func (*Client) UpdateUser

func (c *Client) UpdateUser(params UpdateUserParams) (*User, error)

func (*Client) UserEventsList

func (c *Client) UserEventsList(opts PaginationOpts) (Events, PaginationMeta, error)

func (*Client) UserStopFreeTrial

func (c *Client) UserStopFreeTrial() error

func (*Client) VariableMultipleSet

func (c *Client) VariableMultipleSet(app string, variables Variables) (Variables, int, error)

func (*Client) VariableSet

func (c *Client) VariableSet(app string, name string, value string) (*Variable, int, error)

func (*Client) VariableUnset

func (c *Client) VariableUnset(app string, id string) error

func (*Client) VariablesList

func (c *Client) VariablesList(app string) (Variables, error)

func (*Client) VariablesListWithoutAlias

func (c *Client) VariablesListWithoutAlias(app string) (Variables, error)

type ClientConfig

type ClientConfig struct {
	Timeout             time.Duration
	TLSConfig           *tls.Config
	APIEndpoint         string
	APIPrefix           string
	AuthEndpoint        string
	AuthPrefix          string
	DatabaseAPIEndpoint string
	DatabaseAPIPrefix   string
	APIToken            string
	Region              string
	UserAgent           string

	// StaticTokenGenerator is present for retrocompatibility with legacy tokens
	// DEPRECATED, Use standard APIToken field for normal operations
	StaticTokenGenerator *StaticTokenGenerator
}

type Collaborator

type Collaborator struct {
	ID       string             `json:"id"`
	AppID    string             `json:"app_id"`
	Username string             `json:"username"`
	Email    string             `json:"email"`
	Status   CollaboratorStatus `json:"status"`
	UserID   string             `json:"user_id"`
}

type CollaboratorRes

type CollaboratorRes struct {
	Collaborator Collaborator `json:"collaborator"`
}

type CollaboratorStatus

type CollaboratorStatus string
const (
	CollaboratorStatusPending  CollaboratorStatus = "pending"
	CollaboratorStatusAccepted CollaboratorStatus = "accepted"
	CollaboratorStatusDeleted  CollaboratorStatus = "user account deleted"
)

type CollaboratorsRes

type CollaboratorsRes struct {
	Collaborators []Collaborator `json:"collaborators"`
}

type CollaboratorsService

type CollaboratorsService interface {
	CollaboratorsList(app string) ([]Collaborator, error)
	CollaboratorAdd(app string, email string) (Collaborator, error)
	CollaboratorRemove(app string, id string) error
}

type Container

type Container struct {
	ID        string     `json:"id"`
	AppID     string     `json:"app_id"`
	CreatedAt *time.Time `json:"created_at"`
	DeletedAt *time.Time `json:"deleted_at"`
	Command   string     `json:"command"`
	Type      string     `json:"type"`
	TypeIndex int        `json:"type_index"`
	Label     string     `json:"label"`
	State     string     `json:"state"`
	App       *App       `json:"app"`
	// Size has been deprecated in favor of the more comprehensive `ContainerSize` attribute
	Size          string        `json:"size"`
	ContainerSize ContainerSize `json:"container_size"`
}

type ContainerSize added in v4.13.0

type ContainerSize struct {
	ID        string `json:"id"`
	SKU       string `json:"sku,omitempty"`
	Name      string `json:"name"`
	HumanName string `json:"human_name"`
	HumanCPU  string `json:"human_cpu"`
	Memory    int    `json:"memory"`
	PidsLimit int    `json:"pids_limit,omitempty"`

	HourlyPrice     int                          `json:"hourly_price"`
	ThirtydaysPrice int                          `json:"thirtydays_price"`
	Pricings        map[string]map[string]string `json:"pricings"`

	Swap    int `json:"swap"`
	Ordinal int `json:"ordinal"`
}

type ContainerSizesService added in v4.15.0

type ContainerSizesService interface {
	ContainerSizesList() ([]ContainerSize, error)
}

type ContainerStat

type ContainerStat struct {
	ID                 string `json:"id"`
	CpuUsage           int    `json:"cpu_usage"`
	MemoryUsage        int64  `json:"memory_usage"`
	SwapUsage          int64  `json:"swap_usage"`
	MemoryLimit        int64  `json:"memory_limit"`
	SwapLimit          int64  `json:"swap_limit"`
	HighestMemoryUsage int64  `json:"highest_memory_usage"`
	HighestSwapUsage   int64  `json:"highest_swap_usage"`
}

type ContainerType

type ContainerType struct {
	AppID   string `json:"app_id"`
	Name    string `json:"name"`
	Amount  int    `json:"amount"`
	Command string `json:"command"`
	Size    string `json:"size"`
}

type ContainersService added in v4.13.0

type ContainersService interface {
	ContainersStop(appName, containerID string) error
}

type CronTasks added in v4.13.1

type CronTasks struct {
	Jobs []Job `json:"jobs"`
}

type CronTasksService added in v4.13.1

type CronTasksService interface {
	CronTasksGet(app string) (CronTasks, error)
}

type Database

type Database struct {
	ID                         string              `json:"id"`
	CreatedAt                  time.Time           `json:"created_at"`
	ResourceID                 string              `json:"resource_id"`
	AppName                    string              `json:"app_name"`
	EncryptionAtRest           bool                `json:"encryption_at_rest"`
	Features                   []map[string]string `json:"features"`
	Plan                       string              `json:"plan"`
	Status                     DatabaseStatus      `json:"status"`
	TypeID                     string              `json:"type_id"`
	TypeName                   string              `json:"type_name"`
	VersionID                  string              `json:"version_id"`
	MongoReplSetName           string              `json:"mongo_repl_set_name"`
	Instances                  []Instance          `json:"instances"`
	NextVersionID              string              `json:"next_version_id"`
	ReadableVersion            string              `json:"readable_version"`
	Hostname                   string              `json:"hostname"`
	CurrentOperationID         string              `json:"current_operation_id"`
	Cluster                    bool                `json:"cluster"`
	PeriodicBackupsEnabled     bool                `json:"periodic_backups_enabled"`
	PeriodicBackupsScheduledAt []int               `json:"periodic_backups_scheduled_at"` // Hours of the day of the periodic backups (UTC)
}

type DatabaseRes

type DatabaseRes struct {
	Database Database `json:"database"`
}

type DatabaseStatus

type DatabaseStatus string
const (
	DatabaseStatusCreating  DatabaseStatus = "creating"
	DatabaseStatusRunning   DatabaseStatus = "running"
	DatabaseStatusMigrating DatabaseStatus = "migrating"
	DatabaseStatusUpdating  DatabaseStatus = "updating"
	DatabaseStatusUpgrading DatabaseStatus = "upgrading"
	DatabaseStatusStopped   DatabaseStatus = "stopped"
)

type DatabaseTypeVersion

type DatabaseTypeVersion struct {
	ID             string                      `json:"id"`
	DatabaseTypeID string                      `json:"database_type_id"`
	CreatedAt      time.Time                   `json:"created_at"`
	UpdatedAt      time.Time                   `json:"updated_at"`
	Features       []string                    `json:"features"`
	NextUpgrade    *DatabaseTypeVersion        `json:"next_upgrade"`
	AllowedPlugins []DatabaseTypeVersionPlugin `json:"allowed_plugins"`
	Major          int                         `json:"major"`
	Minor          int                         `json:"minor"`
	Patch          int                         `json:"patch"`
	Build          int                         `json:"build"`
}

func (DatabaseTypeVersion) String

func (v DatabaseTypeVersion) String() string

type DatabaseTypeVersionPlugin

type DatabaseTypeVersionPlugin struct {
	ID          string `json:"id"`
	FeatureName string `json:"feature_name"`
	InstallName string `json:"install_name"`
	DisplayName string `json:"display_name"`
	Description string `json:"description"`
}

type DatabaseTypeVersionShowResponse

type DatabaseTypeVersionShowResponse struct {
	DatabaseTypeVersion DatabaseTypeVersion `json:"database_type_version"`
}

type Deployment

type Deployment struct {
	ID             string           `json:"id"`
	AppID          string           `json:"app_id"`
	CreatedAt      *time.Time       `json:"created_at"`
	Status         DeploymentStatus `json:"status"`
	GitRef         string           `json:"git_ref"`
	Image          string           `json:"image"`
	Registry       string           `json:"registry"`
	Duration       int              `json:"duration"`
	PostdeployHook string           `json:"postdeploy_hook"`
	User           *User            `json:"pusher"`
	Links          *DeploymentLinks `json:"links"`
}

func (*Deployment) HasFailed

func (d *Deployment) HasFailed() bool

func (*Deployment) IsFinished

func (d *Deployment) IsFinished() bool

type DeploymentEvent added in v4.12.0

type DeploymentEvent struct {
	// ID of the deployment which this event belongs to
	ID   string              `json:"id"`
	Type DeploymentEventType `json:"type"`
	Data json.RawMessage     `json:"data"`
}

DeploymentEvent represents a deployment stream event sent on the websocket.

type DeploymentEventDataLog added in v4.12.0

type DeploymentEventDataLog struct {
	Content string `json:"content"`
}

DeploymentEventDataLog is the data type present in the DeploymentEvent.Data field if the DeploymentEvent.Type is DeploymentEventDataLog

type DeploymentEventDataStatus added in v4.12.0

type DeploymentEventDataStatus struct {
	Status DeploymentStatus `json:"status"`
}

DeploymentEventDataStatus is the data type present in the DeploymentEvent.Data field if the DeploymentEvent.Type is DeploymentEventDataStatus

type DeploymentEventType added in v4.12.0

type DeploymentEventType string

DeploymentEventType holds all different deployment stream types of event.

const (
	DeploymentEventTypePing   DeploymentEventType = "ping"
	DeploymentEventTypeNew    DeploymentEventType = "new"
	DeploymentEventTypeLog    DeploymentEventType = "log"
	DeploymentEventTypeStatus DeploymentEventType = "status"
)
type DeploymentLinks struct {
	Output string `json:"output"`
}

type DeploymentList

type DeploymentList struct {
	Deployments []*Deployment `json:"deployments"`
	Meta        struct {
		PaginationMeta PaginationMeta `json:"pagination"`
	}
}

type DeploymentStatus

type DeploymentStatus string
const (
	StatusSuccess      DeploymentStatus = "success"
	StatusQueued       DeploymentStatus = "queued"
	StatusBuilding     DeploymentStatus = "building"
	StatusStarting     DeploymentStatus = "starting"
	StatusPushing      DeploymentStatus = "pushing"
	StatusAborted      DeploymentStatus = "aborted"
	StatusBuildError   DeploymentStatus = "build-error"
	StatusCrashedError DeploymentStatus = "crashed-error"
	StatusTimeoutError DeploymentStatus = "timeout-error"
	StatusHookError    DeploymentStatus = "hook-error"
)

type DeploymentsCreateParams

type DeploymentsCreateParams struct {
	GitRef    *string `json:"git_ref"`
	SourceURL string  `json:"source_url"`
}

type DeploymentsCreateRes

type DeploymentsCreateRes struct {
	Deployment *Deployment `json:"deployment"`
}

type DeploymentsService

type DeploymentsService interface {
	DeploymentList(app string) ([]*Deployment, error)
	DeploymentListWithPagination(app string, opts PaginationOpts) ([]*Deployment, PaginationMeta, error)
	Deployment(app string, deploy string) (*Deployment, error)
	DeploymentLogs(deployURL string) (*http.Response, error)
	DeploymentStream(deployURL string) (*websocket.Conn, error)
	DeploymentsCreate(app string, params *DeploymentsCreateParams) (*Deployment, error)
}

type DetailedEvent

type DetailedEvent interface {
	fmt.Stringer
	GetEvent() *Event
	PrintableType() string
	When() string
	Who() string
	TypeDataPtr() interface{}
}

type DetailedNotifier

type DetailedNotifier interface {
	GetNotifier() *Notifier
	GetID() string
	GetName() string
	GetType() NotifierType
	GetSendAllEvents() bool
	GetSendAllAlerts() bool
	GetSelectedEventIDs() []string
	IsActive() bool
	When() string
	TypeDataPtr() interface{}
	TypeDataMap() map[string]interface{}
}

func NewDetailedNotifier

func NewDetailedNotifier(notifierType string, params NotifierParams) DetailedNotifier

type Domain

type Domain struct {
	ID                string             `json:"id"`
	AppID             string             `json:"app_id"`
	Name              string             `json:"name"`
	TLSCert           string             `json:"tlscert,omitempty"`
	TLSKey            string             `json:"tlskey,omitempty"`
	SSL               bool               `json:"ssl"`
	Validity          time.Time          `json:"validity"`
	Canonical         bool               `json:"canonical"`
	LetsEncrypt       bool               `json:"letsencrypt"`
	LetsEncryptStatus LetsEncryptStatus  `json:"letsencrypt_status"`
	SslStatus         SslStatus          `json:"ssl_status"`
	AcmeDNSFqdn       string             `json:"acme_dns_fqdn"`
	AcmeDNSValue      string             `json:"acme_dns_value"`
	AcmeDNSError      ACMEErrorVariables `json:"acme_dns_error"`
}

type DomainRes

type DomainRes struct {
	Domain Domain `json:"domain"`
}

type DomainsRes

type DomainsRes struct {
	Domains []Domain `json:"domains"`
}

type DomainsService

type DomainsService interface {
	DomainsList(app string) ([]Domain, error)
	DomainsAdd(app string, d Domain) (Domain, error)
	DomainsRemove(app string, id string) error
	DomainsUpdate(app, id, cert, key string) (Domain, error)
	DomainSetCanonical(app, id string) (Domain, error)
	DomainUnsetCanonical(app string) (Domain, error)
	DomainSetCertificate(app, id, tlsCert, tlsKey string) (Domain, error)
	DomainUnsetCertificate(app, id string) (Domain, error)
}

type DownloadURLRes

type DownloadURLRes struct {
	DownloadURL string `json:"download_url"`
}

type Event

type Event struct {
	ID          string                 `json:"id"`
	AppID       string                 `json:"app_id"`
	CreatedAt   time.Time              `json:"created_at"`
	User        EventUser              `json:"user"`
	Type        EventTypeName          `json:"type"`
	AppName     string                 `json:"app_name"`
	RawTypeData json.RawMessage        `json:"type_data"`
	TypeData    map[string]interface{} `json:"-"`
}

func (*Event) GetEvent

func (ev *Event) GetEvent() *Event

func (*Event) PrintableType

func (ev *Event) PrintableType() string

func (*Event) Specialize

func (pev *Event) Specialize() DetailedEvent

func (*Event) String

func (ev *Event) String() string

func (*Event) TypeDataPtr

func (ev *Event) TypeDataPtr() interface{}

func (*Event) When

func (ev *Event) When() string

func (*Event) Who

func (ev *Event) Who() string

type EventAcceptCollaboratorType

type EventAcceptCollaboratorType struct {
	Event
	TypeData EventAcceptCollaboratorTypeData `json:"type_data"`
}

func (*EventAcceptCollaboratorType) String

func (ev *EventAcceptCollaboratorType) String() string

func (*EventAcceptCollaboratorType) TypeDataPtr

func (e *EventAcceptCollaboratorType) TypeDataPtr() interface{}

type EventAcceptCollaboratorTypeData

type EventAcceptCollaboratorTypeData struct {
	Collaborator EventCollaborator `json:"collaborator"`
}

Inviter is filled there

type EventAddCreditType

type EventAddCreditType struct {
	Event
	TypeData EventAddCreditTypeData `json:"type_data"`
}

func (*EventAddCreditType) String

func (ev *EventAddCreditType) String() string

func (*EventAddCreditType) TypeDataPtr

func (e *EventAddCreditType) TypeDataPtr() interface{}

type EventAddCreditTypeData

type EventAddCreditTypeData struct {
	PaymentMethod string  `json:"payment_method"`
	Amount        float64 `json:"amount"`
}

type EventAddPaymentMethodType

type EventAddPaymentMethodType struct {
	Event
	TypeData EventAddPaymentMethodTypeData `json:"type_data"`
}

func (*EventAddPaymentMethodType) String

func (ev *EventAddPaymentMethodType) String() string

func (*EventAddPaymentMethodType) TypeDataPtr

func (e *EventAddPaymentMethodType) TypeDataPtr() interface{}

type EventAddPaymentMethodTypeData

type EventAddPaymentMethodTypeData struct {
	billing.Profile
}

type EventAddVoucherType

type EventAddVoucherType struct {
	Event
	TypeData EventAddVoucherTypeData `json:"type_data"`
}

func (*EventAddVoucherType) String

func (ev *EventAddVoucherType) String() string

func (*EventAddVoucherType) TypeDataPtr

func (e *EventAddVoucherType) TypeDataPtr() interface{}

type EventAddVoucherTypeData

type EventAddVoucherTypeData struct {
	Code string `json:"code"`
}

type EventAddon

type EventAddon struct {
	AddonProviderName string `json:"addon_provider_name"`
	PlanName          string `json:"plan_name"`
	ResourceID        string `json:"resource_id"`
}

type EventAddonUpdatedType

type EventAddonUpdatedType struct {
	Event
	TypeData EventAddonUpdatedTypeData `json:"type_data"`
}

func (*EventAddonUpdatedType) String

func (ev *EventAddonUpdatedType) String() string

func (*EventAddonUpdatedType) TypeDataPtr

func (e *EventAddonUpdatedType) TypeDataPtr() interface{}

type EventAddonUpdatedTypeData

type EventAddonUpdatedTypeData struct {
	AddonID           string `json:"addon_id"`
	AddonPlanName     string `json:"addon_plan_name"`
	AddonResourceID   string `json:"addon_resource_id"`
	AddonProviderID   string `json:"addon_provider_id"`
	AddonProviderName string `json:"addon_provider_name"`

	// Status has only two items when is updated, the old value and the new value, in this order
	Status []AddonStatus `json:"status"`
	// AttributesChanged contain names of changed attributes
	AttributesChanged []string `json:"attributes_changed"`
}

type EventAlertType

type EventAlertType struct {
	Event
	TypeData EventAlertTypeData `json:"type_data"`
}

func (*EventAlertType) String

func (ev *EventAlertType) String() string

func (*EventAlertType) TypeDataPtr

func (e *EventAlertType) TypeDataPtr() interface{}

type EventAlertTypeData

type EventAlertTypeData struct {
	SenderName    string  `json:"sender_name"`
	Metric        string  `json:"metric"`
	Limit         float64 `json:"limit"`
	LimitText     string  `json:"limit_text"`
	Value         float64 `json:"value"`
	ValueText     string  `json:"value_text"`
	Activated     bool    `json:"activated"`
	SendWhenBelow bool    `json:"send_when_below"`
	RawLimit      float64 `json:"raw_limit"`
	RawValue      float64 `json:"raw_value"`
}

type EventAuthorizeGithubType

type EventAuthorizeGithubType struct {
	Event
	TypeData EventAuthorizeGithubTypeData `json:"type_data"`
}

func (*EventAuthorizeGithubType) String

func (ev *EventAuthorizeGithubType) String() string

func (*EventAuthorizeGithubType) TypeDataPtr

func (e *EventAuthorizeGithubType) TypeDataPtr() interface{}

type EventAuthorizeGithubTypeData

type EventAuthorizeGithubTypeData struct {
	GithubUser struct {
		Login     string `json:"login"`
		AvatarURL string `json:"avatar_url"`
	} `json:"github_user"`
}

type EventCategory

type EventCategory struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Position int    `json:"position"`
}

type EventCollaborator

type EventCollaborator struct {
	EventUser
	Inviter EventUser `json:"inviter"`
}

type EventCrashType

type EventCrashType struct {
	Event
	TypeData EventCrashTypeData `json:"type_data"`
}

func (*EventCrashType) String

func (ev *EventCrashType) String() string

func (*EventCrashType) TypeDataPtr

func (e *EventCrashType) TypeDataPtr() interface{}

type EventCrashTypeData

type EventCrashTypeData struct {
	ContainerType string `json:"container_type"`
	CrashLogs     string `json:"crash_logs"`
	LogsUrl       string `json:"logs_url"`
}

type EventDeleteAddonLogDrainType

type EventDeleteAddonLogDrainType struct {
	Event
	TypeData EventDeleteAddonLogDrainTypeData `json:"type_data"`
}

func (*EventDeleteAddonLogDrainType) String

func (ev *EventDeleteAddonLogDrainType) String() string

func (*EventDeleteAddonLogDrainType) TypeDataPtr

func (e *EventDeleteAddonLogDrainType) TypeDataPtr() interface{}

type EventDeleteAddonLogDrainTypeData

type EventDeleteAddonLogDrainTypeData struct {
	URL       string `json:"url"`
	AddonUUID string `json:"addon_uuid"`
	AddonName string `json:"addon_name"`
}

Delete addon log drain

type EventDeleteAddonType

type EventDeleteAddonType struct {
	Event
	TypeData EventDeleteAddonTypeData `json:"type_data"`
}

func (*EventDeleteAddonType) String

func (ev *EventDeleteAddonType) String() string

func (*EventDeleteAddonType) TypeDataPtr

func (e *EventDeleteAddonType) TypeDataPtr() interface{}

type EventDeleteAddonTypeData

type EventDeleteAddonTypeData struct {
	EventAddon
}

type EventDeleteAlertType

type EventDeleteAlertType struct {
	Event
	TypeData EventDeleteAlertTypeData `json:"type_data"`
}

func (*EventDeleteAlertType) String

func (ev *EventDeleteAlertType) String() string

func (*EventDeleteAlertType) TypeDataPtr

func (e *EventDeleteAlertType) TypeDataPtr() interface{}

type EventDeleteAlertTypeData

type EventDeleteAlertTypeData struct {
	ContainerType string `json:"container_type"`
	Metric        string `json:"metric"`
}

type EventDeleteAppType

type EventDeleteAppType struct {
	Event
}

func (*EventDeleteAppType) String

func (ev *EventDeleteAppType) String() string

type EventDeleteAutoscalerType

type EventDeleteAutoscalerType struct {
	Event
	TypeData EventDeleteAutoscalerTypeData `json:"type_data"`
}

func (*EventDeleteAutoscalerType) String

func (ev *EventDeleteAutoscalerType) String() string

func (*EventDeleteAutoscalerType) TypeDataPtr

func (e *EventDeleteAutoscalerType) TypeDataPtr() interface{}

type EventDeleteAutoscalerTypeData

type EventDeleteAutoscalerTypeData struct {
	ContainerType string `json:"container_type"`
	Metric        string `json:"metric"`
}

type EventDeleteCollaboratorType

type EventDeleteCollaboratorType struct {
	Event
	TypeData EventDeleteCollaboratorTypeData `json:"type_data"`
}

func (*EventDeleteCollaboratorType) String

func (ev *EventDeleteCollaboratorType) String() string

func (*EventDeleteCollaboratorType) TypeDataPtr

func (e *EventDeleteCollaboratorType) TypeDataPtr() interface{}

type EventDeleteCollaboratorTypeData

type EventDeleteCollaboratorTypeData struct {
	Collaborator EventCollaborator `json:"collaborator"`
}

type EventDeleteDomainType

type EventDeleteDomainType struct {
	Event
	TypeData EventDeleteDomainTypeData `json:"type_data"`
}

func (*EventDeleteDomainType) String

func (ev *EventDeleteDomainType) String() string

func (*EventDeleteDomainType) TypeDataPtr

func (e *EventDeleteDomainType) TypeDataPtr() interface{}

type EventDeleteDomainTypeData

type EventDeleteDomainTypeData struct {
	Hostname string `json:"hostname"`
}

type EventDeleteIntegrationType

type EventDeleteIntegrationType struct {
	Event
	TypeData EventDeleteIntegrationTypeData `json:"type_data"`
}

func (*EventDeleteIntegrationType) String

func (ev *EventDeleteIntegrationType) String() string

func (*EventDeleteIntegrationType) TypeDataPtr

func (e *EventDeleteIntegrationType) TypeDataPtr() interface{}

type EventDeleteIntegrationTypeData

type EventDeleteIntegrationTypeData struct {
	IntegrationID   string  `json:"integration_id"`
	IntegrationType SCMType `json:"integration_type"`
	Data            struct {
		Login     string `json:"login"`
		AvatarURL string `json:"avatar_url"`
		URL       string `json:"url"`
	} `json:"data"`
}

type EventDeleteKeyType

type EventDeleteKeyType struct {
	Event
	TypeData EventDeleteKeyTypeData `json:"type_data"`
}

func (*EventDeleteKeyType) String

func (ev *EventDeleteKeyType) String() string

func (*EventDeleteKeyType) TypeDataPtr

func (e *EventDeleteKeyType) TypeDataPtr() interface{}

type EventDeleteKeyTypeData

type EventDeleteKeyTypeData struct {
	Name string `json:"name"`
}

type EventDeleteLogDrainType

type EventDeleteLogDrainType struct {
	Event
	TypeData EventDeleteLogDrainTypeData `json:"type_data"`
}

func (*EventDeleteLogDrainType) String

func (ev *EventDeleteLogDrainType) String() string

func (*EventDeleteLogDrainType) TypeDataPtr

func (e *EventDeleteLogDrainType) TypeDataPtr() interface{}

type EventDeleteLogDrainTypeData

type EventDeleteLogDrainTypeData struct {
	URL string `json:"url"`
}

Delete log drain

type EventDeleteNotifierType added in v4.13.0

type EventDeleteNotifierType struct {
	Event
	TypeData EventDeleteNotifierTypeData `json:"type_data"`
}

func (*EventDeleteNotifierType) String added in v4.13.0

func (ev *EventDeleteNotifierType) String() string

func (*EventDeleteNotifierType) TypeDataPtr added in v4.13.0

func (e *EventDeleteNotifierType) TypeDataPtr() interface{}

type EventDeleteNotifierTypeData added in v4.13.0

type EventDeleteNotifierTypeData struct {
	NotifierName     string                 `json:"notifier_name"`
	Active           bool                   `json:"active"`
	SendAllEvents    bool                   `json:"send_all_events"`
	SelectedEvents   []string               `json:"selected_events"`
	NotifierType     string                 `json:"notifier_type"`
	NotifierTypeData map[string]interface{} `json:"notifier_type_data"`
	PlatformName     string                 `json:"platform_name"`
}

Delete notifier

type EventDeleteVariableType

type EventDeleteVariableType struct {
	Event
	TypeData EventDeleteVariableTypeData `json:"type_data"`
}

func (*EventDeleteVariableType) String

func (ev *EventDeleteVariableType) String() string

func (*EventDeleteVariableType) TypeDataPtr

func (e *EventDeleteVariableType) TypeDataPtr() interface{}

type EventDeleteVariableTypeData

type EventDeleteVariableTypeData struct {
	EventVariable
}

type EventDeploymentType

type EventDeploymentType struct {
	Event
	TypeData EventDeploymentTypeData `json:"type_data"`
}

func (*EventDeploymentType) String

func (ev *EventDeploymentType) String() string

func (*EventDeploymentType) TypeDataPtr

func (e *EventDeploymentType) TypeDataPtr() interface{}

type EventDeploymentTypeData

type EventDeploymentTypeData struct {
	DeploymentID   string `json:"deployment_id"`
	Pusher         string `json:"pusher"`
	GitRef         string `json:"git_ref"`
	Status         string `json:"status"`
	Duration       int    `json:"duration"`
	DeploymentUUID string `json:"deployment_uuid"`
}

type EventEditAppType

type EventEditAppType struct {
	Event
	TypeData EventEditAppTypeData `json:"type_data"`
}

func (*EventEditAppType) String

func (ev *EventEditAppType) String() string

func (*EventEditAppType) TypeDataPtr

func (e *EventEditAppType) TypeDataPtr() interface{}

type EventEditAppTypeData

type EventEditAppTypeData struct {
	ForceHTTPS *bool `json:"force_https"`
}

type EventEditAutoscalerType added in v4.14.1

type EventEditAutoscalerType struct {
	Event
	TypeData EventEditAutoscalerTypeData `json:"type_data"`
}

func (*EventEditAutoscalerType) String added in v4.14.1

func (ev *EventEditAutoscalerType) String() string

func (*EventEditAutoscalerType) TypeDataPtr added in v4.14.1

func (e *EventEditAutoscalerType) TypeDataPtr() interface{}

type EventEditAutoscalerTypeData added in v4.14.1

type EventEditAutoscalerTypeData struct {
	ContainerType string  `json:"container_type"`
	MinContainers int     `json:"min_containers,string"`
	MaxContainers int     `json:"max_containers,string"`
	Metric        string  `json:"metric"`
	Target        float64 `json:"target"`
	TargetText    string  `json:"target_text"`
}

type EventEditDomainType

type EventEditDomainType struct {
	Event
	TypeData EventEditDomainTypeData `json:"type_data"`
}

func (*EventEditDomainType) String

func (ev *EventEditDomainType) String() string

func (*EventEditDomainType) TypeDataPtr

func (e *EventEditDomainType) TypeDataPtr() interface{}

type EventEditDomainTypeData

type EventEditDomainTypeData struct {
	Hostname string `json:"hostname"`
	SSL      bool   `json:"ssl"`
	OldSSL   bool   `json:"old_ssl"`
}

type EventEditNotifierType added in v4.13.0

type EventEditNotifierType struct {
	Event
	TypeData EventEditNotifierTypeData `json:"type_data"`
}

func (*EventEditNotifierType) String added in v4.13.0

func (ev *EventEditNotifierType) String() string

func (*EventEditNotifierType) TypeDataPtr added in v4.13.0

func (e *EventEditNotifierType) TypeDataPtr() interface{}

type EventEditNotifierTypeData added in v4.13.0

type EventEditNotifierTypeData struct {
	NotifierName     string                 `json:"notifier_name"`
	Active           bool                   `json:"active"`
	SendAllEvents    bool                   `json:"send_all_events"`
	SelectedEvents   []string               `json:"selected_events"`
	NotifierType     string                 `json:"notifier_type"`
	NotifierTypeData map[string]interface{} `json:"notifier_type_data"`
	PlatformName     string                 `json:"platform_name"`
}

Edit notifier

type EventEditVariableType

type EventEditVariableType struct {
	Event
	TypeData EventEditVariableTypeData `json:"type_data"`
}

func (*EventEditVariableType) String

func (ev *EventEditVariableType) String() string

func (*EventEditVariableType) TypeDataPtr

func (e *EventEditVariableType) TypeDataPtr() interface{}

func (*EventEditVariableType) Who

func (ev *EventEditVariableType) Who() string

type EventEditVariableTypeData

type EventEditVariableTypeData struct {
	EventVariable
	OldValue  string `json:"old_value"`
	AddonName string `json:"addon_name"`
}

type EventEditVariablesType

type EventEditVariablesType struct {
	Event
	TypeData EventEditVariablesTypeData `json:"type_data"`
}

func (*EventEditVariablesType) String

func (ev *EventEditVariablesType) String() string

func (*EventEditVariablesType) TypeDataPtr

func (e *EventEditVariablesType) TypeDataPtr() interface{}

type EventEditVariablesTypeData

type EventEditVariablesTypeData struct {
	NewVars     EventVariables `json:"new_vars"`
	UpdatedVars EventVariables `json:"updated_vars"`
	DeletedVars EventVariables `json:"deleted_vars"`
}

type EventLinkGithubType

type EventLinkGithubType struct {
	Event
	TypeData EventLinkGithubTypeData `json:"type_data"`
}

func (*EventLinkGithubType) String

func (ev *EventLinkGithubType) String() string

func (*EventLinkGithubType) TypeDataPtr

func (e *EventLinkGithubType) TypeDataPtr() interface{}

type EventLinkGithubTypeData

type EventLinkGithubTypeData struct {
	RepoName       string `json:"repo_name"`
	LinkerUsername string `json:"linker_username"`
	GithubSource   string `json:"github_source"`
}

type EventLinkSCMType

type EventLinkSCMType struct {
	Event
	TypeData EventLinkSCMTypeData `json:"type_data"`
}

func (*EventLinkSCMType) String

func (ev *EventLinkSCMType) String() string

func (*EventLinkSCMType) TypeDataPtr

func (e *EventLinkSCMType) TypeDataPtr() interface{}

type EventLinkSCMTypeData

type EventLinkSCMTypeData struct {
	RepoName       string `json:"repo_name"`
	LinkerUsername string `json:"linker_username"`
	Source         string `json:"source"`
}

type EventNewAddonLogDrainType

type EventNewAddonLogDrainType struct {
	Event
	TypeData EventNewAddonLogDrainTypeData `json:"type_data"`
}

func (*EventNewAddonLogDrainType) String

func (ev *EventNewAddonLogDrainType) String() string

func (*EventNewAddonLogDrainType) TypeDataPtr

func (e *EventNewAddonLogDrainType) TypeDataPtr() interface{}

type EventNewAddonLogDrainTypeData

type EventNewAddonLogDrainTypeData struct {
	URL       string `json:"url"`
	AddonUUID string `json:"addon_uuid"`
	AddonName string `json:"addon_name"`
}

New addon log drain

type EventNewAddonType

type EventNewAddonType struct {
	Event
	TypeData EventNewAddonTypeData `json:"type_data"`
}

func (*EventNewAddonType) String

func (ev *EventNewAddonType) String() string

func (*EventNewAddonType) TypeDataPtr

func (e *EventNewAddonType) TypeDataPtr() interface{}

type EventNewAddonTypeData

type EventNewAddonTypeData struct {
	EventAddon
}

type EventNewAlertType

type EventNewAlertType struct {
	Event
	TypeData EventNewAlertTypeData `json:"type_data"`
}

func (*EventNewAlertType) String

func (ev *EventNewAlertType) String() string

func (*EventNewAlertType) TypeDataPtr

func (e *EventNewAlertType) TypeDataPtr() interface{}

type EventNewAlertTypeData

type EventNewAlertTypeData struct {
	ContainerType string  `json:"container_type"`
	Metric        string  `json:"metric"`
	Limit         float64 `json:"limit"`
	LimitText     string  `json:"limit_text"`
	SendWhenBelow bool    `json:"send_when_below"`
}

type EventNewAppType

type EventNewAppType struct {
	Event
	TypeData EventNewAppTypeData `json:"type_data"`
}

func (*EventNewAppType) String

func (ev *EventNewAppType) String() string

func (*EventNewAppType) TypeDataPtr

func (e *EventNewAppType) TypeDataPtr() interface{}

type EventNewAppTypeData

type EventNewAppTypeData struct {
	GitSource string `json:"git_source"`
}

type EventNewAutoscalerType

type EventNewAutoscalerType struct {
	Event
	TypeData EventNewAutoscalerTypeData `json:"type_data"`
}

func (*EventNewAutoscalerType) String

func (ev *EventNewAutoscalerType) String() string

func (*EventNewAutoscalerType) TypeDataPtr

func (e *EventNewAutoscalerType) TypeDataPtr() interface{}

type EventNewAutoscalerTypeData

type EventNewAutoscalerTypeData struct {
	ContainerType string  `json:"container_type"`
	MinContainers int     `json:"min_containers,string"`
	MaxContainers int     `json:"max_containers,string"`
	Metric        string  `json:"metric"`
	Target        float64 `json:"target"`
	TargetText    string  `json:"target_text"`
}

type EventNewCollaboratorType

type EventNewCollaboratorType struct {
	Event
	TypeData EventNewCollaboratorTypeData `json:"type_data"`
}

func (*EventNewCollaboratorType) String

func (ev *EventNewCollaboratorType) String() string

func (*EventNewCollaboratorType) TypeDataPtr

func (e *EventNewCollaboratorType) TypeDataPtr() interface{}

type EventNewCollaboratorTypeData

type EventNewCollaboratorTypeData struct {
	Collaborator EventCollaborator `json:"collaborator"`
}

type EventNewDomainType

type EventNewDomainType struct {
	Event
	TypeData EventNewDomainTypeData `json:"type_data"`
}

func (*EventNewDomainType) String

func (ev *EventNewDomainType) String() string

func (*EventNewDomainType) TypeDataPtr

func (e *EventNewDomainType) TypeDataPtr() interface{}

type EventNewDomainTypeData

type EventNewDomainTypeData struct {
	Hostname string `json:"hostname"`
	SSL      bool   `json:"ssl"`
}

type EventNewIntegrationType

type EventNewIntegrationType struct {
	Event
	TypeData EventNewIntegrationTypeData `json:"type_data"`
}

func (*EventNewIntegrationType) String

func (ev *EventNewIntegrationType) String() string

func (*EventNewIntegrationType) TypeDataPtr

func (e *EventNewIntegrationType) TypeDataPtr() interface{}

type EventNewIntegrationTypeData

type EventNewIntegrationTypeData struct {
	IntegrationID   string  `json:"integration_id"`
	IntegrationType SCMType `json:"integration_type"`
	Data            struct {
		Login     string `json:"login"`
		AvatarURL string `json:"avatar_url"`
		URL       string `json:"url"`
	} `json:"data"`
}

type EventNewKeyType

type EventNewKeyType struct {
	Event
	TypeData EventNewKeyTypeData `json:"type_data"`
}

func (*EventNewKeyType) String

func (ev *EventNewKeyType) String() string

func (*EventNewKeyType) TypeDataPtr

func (e *EventNewKeyType) TypeDataPtr() interface{}

type EventNewKeyTypeData

type EventNewKeyTypeData struct {
	Name        string `json:"name"`
	Fingerprint string `json:"fingerprint"`
}

type EventNewLogDrainType

type EventNewLogDrainType struct {
	Event
	TypeData EventNewLogDrainTypeData `json:"type_data"`
}

func (*EventNewLogDrainType) String

func (ev *EventNewLogDrainType) String() string

func (*EventNewLogDrainType) TypeDataPtr

func (e *EventNewLogDrainType) TypeDataPtr() interface{}

type EventNewLogDrainTypeData

type EventNewLogDrainTypeData struct {
	URL string `json:"url"`
}

New log drain

type EventNewNotifierType added in v4.13.0

type EventNewNotifierType struct {
	Event
	TypeData EventNewNotifierTypeData `json:"type_data"`
}

func (*EventNewNotifierType) String added in v4.13.0

func (ev *EventNewNotifierType) String() string

func (*EventNewNotifierType) TypeDataPtr added in v4.13.0

func (e *EventNewNotifierType) TypeDataPtr() interface{}

type EventNewNotifierTypeData added in v4.13.0

type EventNewNotifierTypeData struct {
	NotifierName     string                 `json:"notifier_name"`
	Active           bool                   `json:"active"`
	SendAllEvents    bool                   `json:"send_all_events"`
	SelectedEvents   []string               `json:"selected_events"`
	NotifierType     string                 `json:"notifier_type"`
	NotifierTypeData map[string]interface{} `json:"notifier_type_data"`
	PlatformName     string                 `json:"platform_name"`
}

New notifier

type EventNewUserType

type EventNewUserType struct {
	Event
	TypeData EventNewUserTypeData `json:"type_data"`
}

func (*EventNewUserType) String

func (ev *EventNewUserType) String() string

func (*EventNewUserType) TypeDataPtr

func (e *EventNewUserType) TypeDataPtr() interface{}

type EventNewUserTypeData

type EventNewUserTypeData struct {
}

type EventNewVariableType

type EventNewVariableType struct {
	Event
	TypeData EventNewVariableTypeData `json:"type_data"`
}

func (*EventNewVariableType) String

func (ev *EventNewVariableType) String() string

func (*EventNewVariableType) TypeDataPtr

func (e *EventNewVariableType) TypeDataPtr() interface{}

func (*EventNewVariableType) Who

func (ev *EventNewVariableType) Who() string

type EventNewVariableTypeData

type EventNewVariableTypeData struct {
	AddonName string `json:"addon_name"`
	EventVariable
}

type EventPaymentAttemptType

type EventPaymentAttemptType struct {
	Event
	TypeData EventPaymentAttemptTypeData `json:"type_data"`
}

func (*EventPaymentAttemptType) String

func (ev *EventPaymentAttemptType) String() string

func (*EventPaymentAttemptType) TypeDataPtr

func (e *EventPaymentAttemptType) TypeDataPtr() interface{}

type EventPaymentAttemptTypeData

type EventPaymentAttemptTypeData struct {
	Amount        float32 `json:"amount"`
	PaymentMethod string  `json:"payment_method"`
	Status        string  `json:"status"`
}

type EventRenameAppType

type EventRenameAppType struct {
	Event
	TypeData EventRenameAppTypeData `json:"type_data"`
}

func (*EventRenameAppType) String

func (ev *EventRenameAppType) String() string

func (*EventRenameAppType) TypeDataPtr

func (e *EventRenameAppType) TypeDataPtr() interface{}

type EventRenameAppTypeData

type EventRenameAppTypeData struct {
	OldName string `json:"old_name"`
	NewName string `json:"new_name"`
}

type EventRepeatedCrashType added in v4.14.1

type EventRepeatedCrashType struct {
	Event
	TypeData EventRepeatedCrashTypeData `json:"type_data"`
}

func (*EventRepeatedCrashType) String added in v4.14.1

func (ev *EventRepeatedCrashType) String() string

func (*EventRepeatedCrashType) TypeDataPtr added in v4.14.1

func (e *EventRepeatedCrashType) TypeDataPtr() interface{}

type EventRepeatedCrashTypeData added in v4.14.1

type EventRepeatedCrashTypeData struct {
	ContainerType string `json:"container_type"`
	CrashLogs     string `json:"crash_logs"`
	LogsUrl       string `json:"logs_url"`
}

type EventRestartType

type EventRestartType struct {
	Event
	TypeData EventRestartTypeData `json:"type_data"`
}

func (*EventRestartType) String

func (ev *EventRestartType) String() string

func (*EventRestartType) TypeDataPtr

func (e *EventRestartType) TypeDataPtr() interface{}

func (*EventRestartType) Who

func (ev *EventRestartType) Who() string

type EventRestartTypeData

type EventRestartTypeData struct {
	Scope     []string `json:"scope"`
	AddonName string   `json:"addon_name"`
}

type EventResumeAddonType

type EventResumeAddonType struct {
	Event
	TypeData EventResumeAddonTypeData `json:"type_data"`
}

func (*EventResumeAddonType) String

func (ev *EventResumeAddonType) String() string

func (*EventResumeAddonType) TypeDataPtr

func (e *EventResumeAddonType) TypeDataPtr() interface{}

type EventResumeAddonTypeData

type EventResumeAddonTypeData struct {
	EventAddon
}

type EventRevokeGithubType

type EventRevokeGithubType struct {
	Event
}

func (*EventRevokeGithubType) String

func (ev *EventRevokeGithubType) String() string

func (*EventRevokeGithubType) TypeDataPtr

func (e *EventRevokeGithubType) TypeDataPtr() interface{}

type EventRunType

type EventRunType struct {
	Event
	TypeData EventRunTypeData `json:"type_data"`
}

func (*EventRunType) String

func (ev *EventRunType) String() string

func (*EventRunType) TypeDataPtr

func (e *EventRunType) TypeDataPtr() interface{}

type EventRunTypeData

type EventRunTypeData struct {
	Command    string `json:"command"`
	AuditLogID string `json:"audit_log_id"`
}

type EventScaleType

type EventScaleType struct {
	Event
	TypeData EventScaleTypeData `json:"type_data"`
}

func (*EventScaleType) String

func (ev *EventScaleType) String() string

func (*EventScaleType) TypeDataPtr

func (e *EventScaleType) TypeDataPtr() interface{}

type EventScaleTypeData

type EventScaleTypeData struct {
	PreviousContainers map[string]string `json:"previous_containers"`
	Containers         map[string]string `json:"containers"`
}

type EventStartRegionMigrationType

type EventStartRegionMigrationType struct {
	Event
	TypeData EventStartRegionMigrationTypeData `json:"type_data"`
}

func (*EventStartRegionMigrationType) String

func (*EventStartRegionMigrationType) TypeDataPtr

func (e *EventStartRegionMigrationType) TypeDataPtr() interface{}

type EventStartRegionMigrationTypeData

type EventStartRegionMigrationTypeData struct {
	MigrationID string `json:"migration_id"`
	Destination string `json:"destination"`
	Source      string `json:"source"`
	DstAppName  string `json:"dst_app_name"`
}

type EventStopAppType

type EventStopAppType struct {
	Event
	TypeData EventStopAppTypeData `json:"type_data"`
}

func (*EventStopAppType) String

func (ev *EventStopAppType) String() string

func (*EventStopAppType) TypeDataPtr

func (e *EventStopAppType) TypeDataPtr() interface{}

type EventStopAppTypeData

type EventStopAppTypeData struct {
	Reason string `json:"reason"`
}

type EventSuspendAddonType

type EventSuspendAddonType struct {
	Event
	TypeData EventSuspendAddonTypeData `json:"type_data"`
}

func (*EventSuspendAddonType) String

func (ev *EventSuspendAddonType) String() string

func (*EventSuspendAddonType) TypeDataPtr

func (e *EventSuspendAddonType) TypeDataPtr() interface{}

type EventSuspendAddonTypeData

type EventSuspendAddonTypeData struct {
	EventAddon
	Reason string `json:"reason"`
}

type EventTransferAppType

type EventTransferAppType struct {
	Event
	TypeData EventTransferAppTypeData `json:"type_data"`
}

func (*EventTransferAppType) String

func (ev *EventTransferAppType) String() string

func (*EventTransferAppType) TypeDataPtr

func (e *EventTransferAppType) TypeDataPtr() interface{}

type EventTransferAppTypeData

type EventTransferAppTypeData struct {
	OldOwner EventUser `json:"old_owner"`
	NewOwner EventUser `json:"new_owner"`
}

type EventType

type EventType struct {
	ID          string `json:"id"`
	CategoryID  string `json:"category_id"`
	Name        string `json:"name"`
	DisplayName string `json:"display_name"`
	Description string `json:"description"`
	Template    string `json:"template"`
}

type EventTypeName

type EventTypeName string
const (
	EventNewUser              EventTypeName = "new_user"
	EventNewApp               EventTypeName = "new_app"
	EventEditApp              EventTypeName = "edit_app"
	EventDeleteApp            EventTypeName = "delete_app"
	EventRenameApp            EventTypeName = "rename_app"
	EventTransferApp          EventTypeName = "transfer_app"
	EventRestart              EventTypeName = "restart"
	EventScale                EventTypeName = "scale"
	EventStopApp              EventTypeName = "stop_app"
	EventCrash                EventTypeName = "crash"
	EventRepeatedCrash        EventTypeName = "repeated_crash"
	EventDeployment           EventTypeName = "deployment"
	EventLinkSCM              EventTypeName = "link_scm"
	EventUnlinkSCM            EventTypeName = "unlink_scm"
	EventNewIntegration       EventTypeName = "new_integration"
	EventDeleteIntegration    EventTypeName = "delete_integration"
	EventAuthorizeGithub      EventTypeName = "authorize_github"
	EventRevokeGithub         EventTypeName = "revoke_github"
	EventRun                  EventTypeName = "run"
	EventNewDomain            EventTypeName = "new_domain"
	EventEditDomain           EventTypeName = "edit_domain"
	EventDeleteDomain         EventTypeName = "delete_domain"
	EventNewAddon             EventTypeName = "new_addon"
	EventUpgradeAddon         EventTypeName = "upgrade_addon"
	EventUpgradeDatabase      EventTypeName = "upgrade_database"
	EventDeleteAddon          EventTypeName = "delete_addon"
	EventResumeAddon          EventTypeName = "resume_addon"
	EventSuspendAddon         EventTypeName = "suspend_addon"
	EventNewCollaborator      EventTypeName = "new_collaborator"
	EventAcceptCollaborator   EventTypeName = "accept_collaborator"
	EventDeleteCollaborator   EventTypeName = "delete_collaborator"
	EventNewVariable          EventTypeName = "new_variable"
	EventEditVariable         EventTypeName = "edit_variable"
	EventEditVariables        EventTypeName = "edit_variables"
	EventDeleteVariable       EventTypeName = "delete_variable"
	EventAddCredit            EventTypeName = "add_credit"
	EventAddPaymentMethod     EventTypeName = "add_payment_method"
	EventAddVoucher           EventTypeName = "add_voucher"
	EventNewKey               EventTypeName = "new_key"
	EventDeleteKey            EventTypeName = "delete_key"
	EventPaymentAttempt       EventTypeName = "payment_attempt"
	EventNewAlert             EventTypeName = "new_alert"
	EventAlert                EventTypeName = "alert"
	EventDeleteAlert          EventTypeName = "delete_alert"
	EventNewAutoscaler        EventTypeName = "new_autoscaler"
	EventEditAutoscaler       EventTypeName = "edit_autoscaler"
	EventDeleteAutoscaler     EventTypeName = "delete_autoscaler"
	EventAddonUpdated         EventTypeName = "addon_updated"
	EventStartRegionMigration EventTypeName = "start_region_migration"
	EventNewLogDrain          EventTypeName = "new_log_drain"
	EventDeleteLogDrain       EventTypeName = "delete_log_drain"
	EventNewAddonLogDrain     EventTypeName = "new_addon_log_drain"
	EventDeleteAddonLogDrain  EventTypeName = "delete_addon_log_drain"
	EventNewNotifier          EventTypeName = "new_notifier"
	EventEditNotifier         EventTypeName = "edit_notifier"
	EventDeleteNotifier       EventTypeName = "delete_notifier"

	// EventLinkGithub and EventUnlinkGithub events are kept for
	// retro-compatibility. They are replaced by SCM events.
	EventLinkGithub   EventTypeName = "link_github"
	EventUnlinkGithub EventTypeName = "unlink_github"
)

type EventUnlinkGithubType

type EventUnlinkGithubType struct {
	Event
	TypeData EventUnlinkGithubTypeData `json:"type_data"`
}

func (*EventUnlinkGithubType) String

func (ev *EventUnlinkGithubType) String() string

func (*EventUnlinkGithubType) TypeDataPtr

func (e *EventUnlinkGithubType) TypeDataPtr() interface{}

type EventUnlinkGithubTypeData

type EventUnlinkGithubTypeData struct {
	RepoName         string `json:"repo_name"`
	UnlinkerUsername string `json:"unlinker_username"`
	GithubSource     string `json:"github_source"`
}

type EventUnlinkSCMType

type EventUnlinkSCMType struct {
	Event
	TypeData EventUnlinkSCMTypeData `json:"type_data"`
}

func (*EventUnlinkSCMType) String

func (ev *EventUnlinkSCMType) String() string

func (*EventUnlinkSCMType) TypeDataPtr

func (e *EventUnlinkSCMType) TypeDataPtr() interface{}

type EventUnlinkSCMTypeData

type EventUnlinkSCMTypeData struct {
	RepoName         string `json:"repo_name"`
	UnlinkerUsername string `json:"unlinker_username"`
	Source           string `json:"source"`
}

type EventUpgradeAddonType

type EventUpgradeAddonType struct {
	Event
	TypeData EventUpgradeAddonTypeData `json:"type_data"`
}

func (*EventUpgradeAddonType) String

func (ev *EventUpgradeAddonType) String() string

func (*EventUpgradeAddonType) TypeDataPtr

func (e *EventUpgradeAddonType) TypeDataPtr() interface{}

type EventUpgradeAddonTypeData

type EventUpgradeAddonTypeData struct {
	EventAddon
	OldPlanName string `json:"old_plan_name"`
	NewPlanName string `json:"new_plan_name"`
}

type EventUpgradeDatabaseType

type EventUpgradeDatabaseType struct {
	Event
	TypeData EventUpgradeDatabaseTypeData `json:"type_data"`
}

func (*EventUpgradeDatabaseType) String

func (ev *EventUpgradeDatabaseType) String() string

func (*EventUpgradeDatabaseType) TypeDataPtr

func (e *EventUpgradeDatabaseType) TypeDataPtr() interface{}

func (*EventUpgradeDatabaseType) Who

func (ev *EventUpgradeDatabaseType) Who() string

type EventUpgradeDatabaseTypeData

type EventUpgradeDatabaseTypeData struct {
	AddonName  string `json:"addon_name"`
	OldVersion string `json:"old_version"`
	NewVersion string `json:"new_version"`
}

type EventUser

type EventUser struct {
	Username string `json:"username"`
	Email    string `json:"email"`
	ID       string `json:"id"`
}

type EventVariable

type EventVariable struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type EventVariables

type EventVariables []EventVariable

func (EventVariables) Names

func (evs EventVariables) Names() string

type Events

type Events []DetailedEvent

type EventsRes

type EventsRes struct {
	Events []*Event `json:"events"`
	Meta   struct {
		PaginationMeta PaginationMeta `json:"pagination"`
	}
}

type EventsService

type EventsService interface {
	EventTypesList() ([]EventType, error)
	EventCategoriesList() ([]EventCategory, error)
	EventsList(app string, opts PaginationOpts) (Events, PaginationMeta, error)
	UserEventsList(opts PaginationOpts) (Events, PaginationMeta, error)
}
type GithubLink struct {
	ID                       string           `json:"id"`
	Linker                   GithubLinkLinker `json:"linker"`
	CreatedAt                time.Time        `json:"created_at"`
	UpdatedAt                time.Time        `json:"updated_at"`
	GithubSource             string           `json:"github_source"`
	GithubBranch             string           `json:"github_branch"`
	AutoDeployEnabled        bool             `json:"auto_deploy_enabled"`
	GithubIntegrationUUID    string           `json:"github_integration_uuid"`
	DeployReviewAppsEnabled  bool             `json:"deploy_review_apps_enabled"`
	DestroyOnCloseEnabled    bool             `json:"delete_on_close_enabled"`
	DestroyOnStaleEnabled    bool             `json:"delete_stale_enabled"`
	HoursBeforeDeleteOnClose uint             `json:"hours_before_delete_on_close"`
	HoursBeforeDeleteStale   uint             `json:"hours_before_delete_stale"`
	LastAutoDeployAt         time.Time        `json:"last_auto_deploy_at"`
}

type GithubLinkLinker

type GithubLinkLinker struct {
	Username string `json:"username"`
	Email    string `json:"email"`
	ID       string `json:"id"`
}

type GithubLinkParams

type GithubLinkParams struct {
	GithubSource             *string `json:"github_source,omitempty"`
	GithubBranch             *string `json:"github_branch,omitempty"`
	AutoDeployEnabled        *bool   `json:"auto_deploy_enabled,omitempty"`
	DeployReviewAppsEnabled  *bool   `json:"deploy_review_apps_enabled,omitempty"`
	DestroyOnCloseEnabled    *bool   `json:"delete_on_close_enabled,omitempty"`
	HoursBeforeDeleteOnClose *uint   `json:"hours_before_delete_on_close,omitempty"`
	DestroyStaleEnabled      *bool   `json:"delete_stale_enabled,omitempty"`
	HoursBeforeDeleteStale   *uint   `json:"hours_before_delete_stale,omitempty"`
}

type GithubLinkResponse

type GithubLinkResponse struct {
	GithubLink *GithubLink `json:"github_repo_link"`
}

type GithubLinkService

type GithubLinkService interface {
	GithubLinkShow(app string) (*GithubLink, error)
	GithubLinkAdd(app string, params GithubLinkParams) (*GithubLink, error)
	GithubLinkUpdate(app, id string, params GithubLinkParams) (*GithubLink, error)
	GithubLinkDelete(app string, id string) error
	GithubLinkManualDeploy(app, id, branch string) error
}

type GithubLinksResponse

type GithubLinksResponse struct {
	GithubLinks []*GithubLink `json:"github_repo_links"`
}

type Instance

type Instance struct {
	ID        string         `json:"id"`
	Hostname  string         `json:"hostname"`
	Port      int            `json:"port"`
	Status    InstanceStatus `json:"status"`
	Type      InstanceType   `json:"type"`
	Features  []string       `json:"features"`
	PrivateIP string         `json:"private_ip"`
}

type InstanceStatus

type InstanceStatus string
const (
	InstanceStatusBooting    InstanceStatus = "booting"
	InstanceStatusRunning    InstanceStatus = "running"
	InstanceStatusRestarting InstanceStatus = "restarting"
	InstanceStatusMigrating  InstanceStatus = "migrating"
	InstanceStatusUpgrading  InstanceStatus = "upgrading"
	InstanceStatusStopped    InstanceStatus = "stopped"
	InstanceStatusRemoving   InstanceStatus = "removing"
)

type InstanceType

type InstanceType string
const (
	// InstanceTypeDBNode instances represent database instances holding data
	InstanceTypeDBNode InstanceType = "db-node"
	// InstanceTypeUtility instances are those running service used for running a
	// service which is neither holding data nor routing requests utilities as
	// stated by its Name
	InstanceTypeUtility InstanceType = "utility"
	// InstanceTypeHAProxy are instances running a HAProxy reverse proxy in order
	// to route requests to the InstanceTypeDBNodes
	InstanceTypeHAProxy InstanceType = "haproxy"
)

type Job added in v4.13.1

type Job struct {
	Command           string    `json:"command"`
	Size              string    `json:"size,omitempty"`
	LastExecutionDate time.Time `json:"last_execution_date,omitempty"`
	NextExecutionDate time.Time `json:"next_execution_date,omitempty"`
}

type Key

type Key struct {
	ID      string `json:"id,omitempty"`
	Name    string `json:"name"`
	Content string `json:"content"`
}

type KeyRes

type KeyRes struct {
	Key Key `json:"key"`
}

type KeysRes

type KeysRes struct {
	Keys []Key `json:"keys"`
}

type KeysService

type KeysService interface {
	KeysList() ([]Key, error)
	KeysAdd(name string, content string) (*Key, error)
	KeysDelete(id string) error
}

type LetsEncryptStatus

type LetsEncryptStatus string
const (
	LetsEncryptStatusPendingDNS  LetsEncryptStatus = "pending_dns"
	LetsEncryptStatusNew         LetsEncryptStatus = "new"
	LetsEncryptStatusCreated     LetsEncryptStatus = "created"
	LetsEncryptStatusDNSRequired LetsEncryptStatus = "dns_required"
	LetsEncryptStatusError       LetsEncryptStatus = "error"
)

type ListParams

type ListParams struct {
	AddonProviders []*AddonProvider `json:"addon_providers"`
}

type LogDrain

type LogDrain struct {
	AppID string `json:"app_id"`
	URL   string `json:"url"`
}

type LogDrainAddParams

type LogDrainAddParams struct {
	Type        string `json:"type"`
	URL         string `json:"url"`
	Port        string `json:"port"`
	Host        string `json:"host"`
	Token       string `json:"token"`
	DrainRegion string `json:"drain_region"`
}

type LogDrainAddPayload added in v4.16.0

type LogDrainAddPayload struct {
	Drain LogDrainAddParams `json:"drain"`
}

type LogDrainRes

type LogDrainRes struct {
	Drain LogDrain `json:"drain"`
}

type LogDrainsRes

type LogDrainsRes struct {
	Drains []LogDrain `json:"drains"`
}

type LogDrainsService

type LogDrainsService interface {
	LogDrainsList(app string) ([]LogDrain, error)
	LogDrainAdd(app string, params LogDrainAddParams) (*LogDrainRes, error)
	LogDrainRemove(app, URL string) error
	LogDrainAddonRemove(app, addonID string, URL string) error
	LogDrainsAddonList(app string, addonID string) ([]LogDrain, error)
	LogDrainAddonAdd(app string, addonID string, params LogDrainAddParams) (*LogDrainRes, error)
}

type LoginError

type LoginError struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

func (*LoginError) Error

func (err *LoginError) Error() string

type LoginParams

type LoginParams struct {
	Identifier string `json:"identifier"`
	Password   string `json:"password"`
	OTP        string `json:"otp"`
	JWT        string `json:"jwt"`
}

type LoginResponse

type LoginResponse struct {
	User *User `json:"user"`
}

type LoginService

type LoginService interface {
	Login(email, password string) (*LoginResponse, error)
}

type LogsArchiveItem

type LogsArchiveItem struct {
	Url  string `json:"url"`
	From string `json:"from"`
	To   string `json:"to"`
	Size int64  `json:"size"`
}

type LogsArchivesResponse

type LogsArchivesResponse struct {
	NextCursor string            `json:"next_cursor"`
	HasMore    bool              `json:"has_more"`
	Archives   []LogsArchiveItem `json:"archives"`
}

type LogsArchivesService

type LogsArchivesService interface {
	LogsArchivesByCursor(app string, cursor string) (*LogsArchivesResponse, error)
	LogsArchives(app string, page int) (*LogsArchivesResponse, error)
}

type LogsService

type LogsService interface {
	LogsURL(app string) (*http.Response, error)
	Logs(logsURL string, n int, filter string) (*http.Response, error)
}

type MockSubresourceService

type MockSubresourceService struct {
	// contains filtered or unexported fields
}

MockSubresourceService is a mock of SubresourceService interface

func NewMockSubresourceService

func NewMockSubresourceService(ctrl *gomock.Controller) *MockSubresourceService

NewMockSubresourceService creates a new mock instance

func (*MockSubresourceService) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

type MockSubresourceServiceMockRecorder

type MockSubresourceServiceMockRecorder struct {
	// contains filtered or unexported fields
}

MockSubresourceServiceMockRecorder is the mock recorder for MockSubresourceService

type NotificationPlatform

type NotificationPlatform struct {
	ID                string   `json:"id"`
	Name              string   `json:"name"`
	DisplayName       string   `json:"display_name"`
	LogoURL           string   `json:"logo_url"`
	Description       string   `json:"description"`
	AvailableEventIDs []string `json:"available_event_ids"`
}

type NotificationPlatformsService

type NotificationPlatformsService interface {
	NotificationPlatformsList() ([]*NotificationPlatform, error)
	NotificationPlatformByName(name string) ([]*NotificationPlatform, error)
}

type Notifier

type Notifier struct {
	ID               string                 `json:"id"`
	AppID            string                 `json:"app_id"`
	Active           *bool                  `json:"active,omitempty"`
	Name             string                 `json:"name,omitempty"`
	Type             NotifierType           `json:"type"`
	SendAllEvents    *bool                  `json:"send_all_events,omitempty"`
	SendAllAlerts    *bool                  `json:"send_all_alerts,omitempty"`
	SelectedEventIDs []string               `json:"selected_event_ids,omitempty"`
	TypeData         map[string]interface{} `json:"-"`
	RawTypeData      json.RawMessage        `json:"type_data"`
	PlatformID       string                 `json:"platform_id"`
	CreatedAt        time.Time              `json:"created_at"`
	UpdatedAt        time.Time              `json:"updated_at"`
}

Struct used to represent a notifier.

func (*Notifier) GetID

func (not *Notifier) GetID() string

func (*Notifier) GetName

func (not *Notifier) GetName() string

func (*Notifier) GetNotifier

func (not *Notifier) GetNotifier() *Notifier

DetailedNotifier implementation

func (*Notifier) GetSelectedEventIDs

func (not *Notifier) GetSelectedEventIDs() []string

func (*Notifier) GetSendAllAlerts

func (not *Notifier) GetSendAllAlerts() bool

func (*Notifier) GetSendAllEvents

func (not *Notifier) GetSendAllEvents() bool

func (*Notifier) GetType

func (not *Notifier) GetType() NotifierType

func (*Notifier) IsActive

func (not *Notifier) IsActive() bool

func (*Notifier) Specialize

func (pnot *Notifier) Specialize() DetailedNotifier

func (*Notifier) TypeDataMap

func (not *Notifier) TypeDataMap() map[string]interface{}

func (*Notifier) TypeDataPtr

func (not *Notifier) TypeDataPtr() interface{}

func (*Notifier) When

func (not *Notifier) When() string

type NotifierEmailType

type NotifierEmailType struct {
	Notifier
	TypeData NotifierEmailTypeData `json:"type_data,omitempty"`
}

Email

func (*NotifierEmailType) TypeDataMap

func (not *NotifierEmailType) TypeDataMap() map[string]interface{}

func (*NotifierEmailType) TypeDataPtr

func (e *NotifierEmailType) TypeDataPtr() interface{}

type NotifierEmailTypeData

type NotifierEmailTypeData struct {
	Emails  []string `json:"emails,omitempty"`
	UserIDs []string `json:"user_ids,omitempty"`
}

type NotifierOutput

type NotifierOutput struct {
	*Notifier
	TypeData    NotifierTypeDataParams `json:"type_data,omitempty"`
	RawTypeData omit                   `json:",omitempty"` // Will always be empty and not serialized
}

Struct used to serialize a notifier

type NotifierParams

type NotifierParams struct {
	Active           *bool
	Name             string
	SendAllEvents    *bool
	SendAllAlerts    *bool
	SelectedEventIDs []string
	PlatformID       string

	// Options
	PhoneNumber string   // SMS notifier
	Emails      []string // Email notifier
	UserIDs     []string // Email notifier
	WebhookURL  string   // Webhook and Slack notifier
}

NotifierParams will be given as a parameter in notifiers function's

type NotifierSlackType

type NotifierSlackType struct {
	Notifier
	TypeData NotifierSlackTypeData `json:"type_data,omitempty"`
}

Slack

func (*NotifierSlackType) TypeDataMap

func (not *NotifierSlackType) TypeDataMap() map[string]interface{}

func (*NotifierSlackType) TypeDataPtr

func (e *NotifierSlackType) TypeDataPtr() interface{}

type NotifierSlackTypeData

type NotifierSlackTypeData struct {
	WebhookURL string `json:"webhook_url,omitempty"`
}

type NotifierType

type NotifierType string
const (
	NotifierWebhook NotifierType = "webhook"
	NotifierSlack   NotifierType = "slack"
	NotifierEmail   NotifierType = "email"
)

type NotifierTypeDataParams

type NotifierTypeDataParams struct {
	WebhookURL  string   `json:"webhook_url,omitempty"`
	Emails      []string `json:"emails,omitempty"`
	UserIDs     []string `json:"user_ids,omitempty"`
	PhoneNumber string   `json:"phone_number,omitempty"`
}

type NotifierWebhookType

type NotifierWebhookType struct {
	Notifier
	TypeData NotifierWebhookTypeData `json:"type_data,omitempty"`
}

Webhook

func (*NotifierWebhookType) TypeDataMap

func (not *NotifierWebhookType) TypeDataMap() map[string]interface{}

func (*NotifierWebhookType) TypeDataPtr

func (e *NotifierWebhookType) TypeDataPtr() interface{}

type NotifierWebhookTypeData

type NotifierWebhookTypeData struct {
	WebhookURL string `json:"webhook_url,omitempty"`
}

type Notifiers

type Notifiers []DetailedNotifier

type NotifiersService

type NotifiersService interface {
	NotifiersList(app string) (Notifiers, error)
	NotifierProvision(app string, params NotifierParams) (*Notifier, error)
	NotifierByID(app, ID string) (*Notifier, error)
	NotifierUpdate(app, ID string, params NotifierParams) (*Notifier, error)
	NotifierDestroy(app, ID string) error
}

type Operation

type Operation struct {
	ID         string          `json:"id"`
	AppID      string          `json:"app_id"`
	CreatedAt  time.Time       `json:"created_at"`
	FinishedAt time.Time       `json:"finished_at"`
	Status     OperationStatus `json:"status"`
	Type       OperationType   `json:"type"`
	Error      string          `json:"error"`
}

func (*Operation) ElapsedDuration

func (op *Operation) ElapsedDuration() float64

type OperationResponse

type OperationResponse struct {
	Op Operation `json:"operation"`
}

type OperationStatus

type OperationStatus string
const (
	OperationStatusPending OperationStatus = "pending"
	OperationStatusDone    OperationStatus = "done"
	OperationStatusRunning OperationStatus = "running"
	OperationStatusError   OperationStatus = "error"
)

type OperationType

type OperationType string
const (
	OperationTypeScale OperationType = "scale"
	OperationTypeStart OperationType = "start"
)

type OperationsService

type OperationsService interface {
	OperationsShow(app string, opID string) (*Operation, error)
}

type PaginationMeta

type PaginationMeta struct {
	PrevPage    int `json:"prev_page"`
	CurrentPage int `json:"current_page"`
	NextPage    int `json:"next_page"`
	TotalPages  int `json:"total_pages"`
	TotalCount  int `json:"total_count"`
}

type PaginationOpts

type PaginationOpts struct {
	Page    int
	PerPage int
}

func (PaginationOpts) ToMap

func (opts PaginationOpts) ToMap() map[string]string

type PeriodicBackupsConfigParams

type PeriodicBackupsConfigParams struct {
	ScheduledAt *int  `json:"periodic_backups_scheduled_at,omitempty"`
	Enabled     *bool `json:"periodic_backups_enabled,omitempty"`
}

type Plan

type Plan struct {
	ID          string  `json:"id"`
	LogoURL     string  `json:"logo_url"`
	DisplayName string  `json:"display_name"`
	Name        string  `json:"name"`
	Description string  `json:"description"`
	Price       float64 `json:"price"`
	SKU         string  `json:"sku"`
}

type PlansParams

type PlansParams struct {
	Plans []*Plan `json:"plans"`
}

type PlatformRes

type PlatformRes struct {
	NotificationPlatform *NotificationPlatform `json:"notification_platform"`
}

type PlatformsRes

type PlatformsRes struct {
	NotificationPlatforms []*NotificationPlatform `json:"notification_platforms"`
}

type PullRequest

type PullRequest struct {
	Number     int       `json:"number"`
	BranchName string    `json:"branch_name"`
	Title      string    `json:"title"`
	Url        string    `json:"url"`
	HtmlUrl    string    `json:"html_url"`
	Ref        string    `json:"ref"`
	BaseRef    string    `json:"base_ref"`
	CreatedAt  time.Time `json:"created_at"`
	ClosedAt   time.Time `json:"closed_at"`
}

type Region

type Region struct {
	Name        string `json:"name"`
	DisplayName string `json:"display_name"`
	SSH         string `json:"ssh"`
	API         string `json:"api"`
	Dashboard   string `json:"dashboard"`
	DatabaseAPI string `json:"database_api"`
	Default     bool   `json:"default"`
}

type RegionMigration

type RegionMigration struct {
	ID          string                `json:"id"`
	SrcAppName  string                `json:"src_app_name"`
	DstAppName  string                `json:"dst_app_name"`
	AppID       string                `json:"app_id"`
	NewAppID    string                `json:"new_app_id"`
	Source      string                `json:"source"`
	Destination string                `json:"destination"`
	Status      RegionMigrationStatus `json:"status"`
	StartedAt   time.Time             `json:"started_at"`
	FinishedAt  time.Time             `json:"finished_at"`
	Steps       Steps                 `json:"steps"`
}

type RegionMigrationParams

type RegionMigrationParams struct {
	Destination string `json:"destination"`
	DstAppName  string `json:"dst_app_name"`
}

type RegionMigrationStatus

type RegionMigrationStatus string

type RegionMigrationStep

type RegionMigrationStep string

type RegionMigrationsService

type RegionMigrationsService interface {
	CreateRegionMigration(appID string, params RegionMigrationParams) (RegionMigration, error)
	RunRegionMigrationStep(appID, migrationID string, step RegionMigrationStep) error
	ShowRegionMigration(appID, migrationID string) (RegionMigration, error)
	ListRegionMigrations(appID string) ([]RegionMigration, error)
}

type RegionsService

type RegionsService interface {
	RegionsList() ([]Region, error)
}

type ReviewApp

type ReviewApp struct {
	ID                  string       `json:"id"`
	RepoLinkID          string       `json:"repo_link_id"`
	AppID               string       `json:"app_id"`
	AppName             string       `json:"app_name"`
	ParentAppID         string       `json:"parent_app_id"`
	ParentAppName       string       `json:"parent_app_name"`
	CreatedAt           time.Time    `json:"created_at"`
	StaleDeletionDate   time.Time    `json:"stale_deletion_date"`
	OnCloseDeletionDate time.Time    `json:"on_close_deletion_date"`
	PullRequest         *PullRequest `json:"pull_request"`
	LastDeployment      *Deployment  `json:"last_deployment"`
}

type RunOpts

type RunOpts struct {
	App        string
	Command    []string
	Env        map[string]string
	Size       string
	Detached   bool
	HasUploads bool
}

type RunRes

type RunRes struct {
	Container *Container `json:"container"`
	AttachURL string     `json:"attach_url"`
}

type RunsService

type RunsService interface {
	Run(opts RunOpts) (*RunRes, error)
}

type SCMIntegration

type SCMIntegration struct {
	ID          string  `json:"id"`
	SCMType     SCMType `json:"scm_type"`
	URL         string  `json:"url,omitempty"`
	AccessToken string  `json:"access_token"`
	Uid         string  `json:"uid"`
	Username    string  `json:"username"`
	Email       string  `json:"email"`
	AvatarURL   string  `json:"avatar_url"`
	ProfileURL  string  `json:"profile_url"`
}

type SCMIntegrationParams

type SCMIntegrationParams struct {
	SCMType     SCMType `json:"scm_type"`
	URL         string  `json:"url,omitempty"`
	AccessToken string  `json:"access_token"`
}

type SCMIntegrationParamsReq

type SCMIntegrationParamsReq struct {
	SCMIntegrationParams SCMIntegrationParams `json:"scm_integration"`
}

type SCMIntegrationRes

type SCMIntegrationRes struct {
	SCMIntegration SCMIntegration `json:"scm_integration"`
}

type SCMIntegrationsRes

type SCMIntegrationsRes struct {
	SCMIntegrations []SCMIntegration `json:"scm_integrations"`
}

type SCMIntegrationsService

type SCMIntegrationsService interface {
	SCMIntegrationsList() ([]SCMIntegration, error)
	SCMIntegrationsShow(id string) (*SCMIntegration, error)
	SCMIntegrationsCreate(scmType SCMType, url string, accessToken string) (*SCMIntegration, error)
	SCMIntegrationsDelete(id string) error
	SCMIntegrationsImportKeys(id string) ([]Key, error)
}
type SCMRepoLink struct {
	ID                       string            `json:"id"`
	AppID                    string            `json:"app_id"`
	Linker                   SCMRepoLinkLinker `json:"linker"`
	Owner                    string            `json:"owner"`
	Repo                     string            `json:"repo"`
	Branch                   string            `json:"branch"`
	SCMType                  SCMType           `json:"scm_type"`
	CreatedAt                time.Time         `json:"created_at"`
	UpdatedAt                time.Time         `json:"updated_at"`
	AutoDeployEnabled        bool              `json:"auto_deploy_enabled"`
	AuthIntegrationUUID      string            `json:"auth_integration_uuid"`
	DeployReviewAppsEnabled  bool              `json:"deploy_review_apps_enabled"`
	DeleteOnCloseEnabled     bool              `json:"delete_on_close_enabled"`
	DeleteStaleEnabled       bool              `json:"delete_stale_enabled"`
	HoursBeforeDeleteOnClose uint              `json:"hours_before_delete_on_close"`
	HoursBeforeDeleteStale   uint              `json:"hours_before_delete_stale"`
	LastAutoDeployAt         time.Time         `json:"last_auto_deploy_at"`
}

type SCMRepoLinkCreateParams

type SCMRepoLinkCreateParams struct {
	Source                   *string `json:"source,omitempty"`
	Branch                   *string `json:"branch,omitempty"`
	AuthIntegrationUUID      *string `json:"auth_integration_uuid,omitempty"`
	AutoDeployEnabled        *bool   `json:"auto_deploy_enabled,omitempty"`
	DeployReviewAppsEnabled  *bool   `json:"deploy_review_apps_enabled,omitempty"`
	DestroyOnCloseEnabled    *bool   `json:"delete_on_close_enabled,omitempty"`
	HoursBeforeDeleteOnClose *uint   `json:"hours_before_delete_on_close,omitempty"`
	DestroyStaleEnabled      *bool   `json:"delete_stale_enabled,omitempty"`
	HoursBeforeDeleteStale   *uint   `json:"hours_before_delete_stale,omitempty"`
}

type SCMRepoLinkDeploymentsResponse

type SCMRepoLinkDeploymentsResponse struct {
	Deployments []*Deployment `json:"deployments"`
}

type SCMRepoLinkLinker

type SCMRepoLinkLinker struct {
	Username string `json:"username"`
	Email    string `json:"email"`
	ID       string `json:"id"`
}

type SCMRepoLinkReviewAppsResponse

type SCMRepoLinkReviewAppsResponse struct {
	ReviewApps []*ReviewApp `json:"review_apps"`
}

type SCMRepoLinkService

type SCMRepoLinkService interface {
	SCMRepoLinkList(opts PaginationOpts) ([]*SCMRepoLink, PaginationMeta, error)
	SCMRepoLinkShow(app string) (*SCMRepoLink, error)
	SCMRepoLinkCreate(app string, params SCMRepoLinkCreateParams) (*SCMRepoLink, error)
	SCMRepoLinkUpdate(app string, params SCMRepoLinkUpdateParams) (*SCMRepoLink, error)
	SCMRepoLinkDelete(app string) error

	SCMRepoLinkManualDeploy(app, branch string) error
	SCMRepoLinkManualReviewApp(app, pullRequestId string) error
	SCMRepoLinkDeployments(app string) ([]*Deployment, error)
	SCMRepoLinkReviewApps(app string) ([]*ReviewApp, error)
}

type SCMRepoLinkUpdateParams

type SCMRepoLinkUpdateParams struct {
	Branch                   *string `json:"branch,omitempty"`
	AutoDeployEnabled        *bool   `json:"auto_deploy_enabled,omitempty"`
	DeployReviewAppsEnabled  *bool   `json:"deploy_review_apps_enabled,omitempty"`
	DestroyOnCloseEnabled    *bool   `json:"delete_on_close_enabled,omitempty"`
	HoursBeforeDeleteOnClose *uint   `json:"hours_before_delete_on_close,omitempty"`
	DestroyStaleEnabled      *bool   `json:"delete_stale_enabled,omitempty"`
	HoursBeforeDeleteStale   *uint   `json:"hours_before_delete_stale,omitempty"`
}

type SCMRepoLinksResponse added in v4.16.0

type SCMRepoLinksResponse struct {
	SCMRepoLinks []*SCMRepoLink `json:"scm_repo_links"`
	Meta         struct {
		PaginationMeta PaginationMeta `json:"pagination"`
	}
}

type SCMType

type SCMType string
const (
	SCMGithubType           SCMType = "github"             // GitHub
	SCMGithubEnterpriseType SCMType = "github-enterprise"  // GitHub Enterprise (private instance)
	SCMGitlabType           SCMType = "gitlab"             // GitLab.com
	SCMGitlabSelfHostedType SCMType = "gitlab-self-hosted" // GitLab self-hosted (private instance)
)

Type of SCM integrations

func (SCMType) Str

func (t SCMType) Str() string

type ScmRepoLinkResponse

type ScmRepoLinkResponse struct {
	SCMRepoLink *SCMRepoLink `json:"scm_repo_link"`
}

type SelfResponse

type SelfResponse struct {
	User *User `json:"user"`
}

type SignUpService

type SignUpService interface {
	SignUp(email, password string) error
}

type Source

type Source struct {
	DownloadURL string `json:"download_url"`
	UploadURL   string `json:"upload_url"`
}

type SourcesCreateResponse

type SourcesCreateResponse struct {
	Source *Source `json:"source"`
}

type SourcesService

type SourcesService interface {
	SourcesCreate() (*Source, error)
}

type SslStatus added in v4.13.0

type SslStatus string
const (
	SslStatusPendingDNS SslStatus = "pending"
	SslStatusNew        SslStatus = "error"
	SslStatusCreated    SslStatus = "success"
)

type Stack

type Stack struct {
	ID          string    `json:"id"`
	CreatedAt   time.Time `json:"created_at"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	BaseImage   string    `json:"base_image"`
	Default     bool      `json:"default"`
}

type StacksService

type StacksService interface {
	StacksList() ([]Stack, error)
}

type StaticTokenGenerator

type StaticTokenGenerator struct {
	// contains filtered or unexported fields
}

StaticTokenGenerator is an implementation of TokenGenerator which always return the same token. This token is provided to the constructor. The TokenGenerator is used by the Client to authenticate to the Scalingo API.

Usage:

t := GetStaticTokenGenerator("my-token")
client := NewClient(ClientConfig{
	TokenGenerator: t,
})

Any subsequent calls to the Scalingo API will use this token to authenticate.

func NewStaticTokenGenerator

func NewStaticTokenGenerator(token string) *StaticTokenGenerator

NewStaticTokenGenerator returns a new StaticTokenGenerator. The only argument is the token that will always be returned by this generator.

func (*StaticTokenGenerator) GetAccessToken

func (t *StaticTokenGenerator) GetAccessToken() (string, error)

GetAccessToken always returns the configured token.

func (*StaticTokenGenerator) SetClient

func (t *StaticTokenGenerator) SetClient(c *Client)

SetClient sets the client attribute of this token generator.

type Step

type Step struct {
	ID     string     `json:"id"`
	Name   string     `json:"name"`
	Status StepStatus `json:"status"`
	Logs   string     `json:"logs"`
}

type StepStatus

type StepStatus string

type Steps

type Steps []Step

type Token

type Token struct {
	ID         string    `json:"id"`
	Name       string    `json:"name"`
	CreatedAt  time.Time `json:"created_at"`
	LastUsedAt time.Time `json:"last_used_at"`
	Token      string    `json:"token"`
}

type TokenCreateParams

type TokenCreateParams struct {
	Name string `json:"name"`
}

type TokenRes

type TokenRes struct {
	Token Token `json:"token"`
}

type Tokens

type Tokens []*Token

type TokensRes

type TokensRes struct {
	Tokens Tokens `json:"tokens"`
}

type TokensService

type TokensService interface {
	TokensList() (Tokens, error)
	TokenCreate(TokenCreateParams) (Token, error)
	TokenExchange(token string) (string, error)
	TokenShow(id int) (Token, error)
}

type UpdateUserParams

type UpdateUserParams struct {
	Password string `json:"password,omitempty"`
	Email    string `json:"email,omitempty"`

	// DEPRECATED: you should use the UserStopFreeTrial method instead
	StopFreeTrial bool `json:"stop_free_trial,omitempty"`
}

type UpdateUserResponse

type UpdateUserResponse struct {
	User *User `json:"user"`
}

type User

type User struct {
	ID       string          `json:"id"`
	Username string          `json:"username"`
	Fullname string          `json:"fullname"`
	Email    string          `json:"email"`
	Flags    map[string]bool `json:"flags"`
}

type UsersService

type UsersService interface {
	Self() (*User, error)
	UpdateUser(params UpdateUserParams) (*User, error)
	UserStopFreeTrial() error
}

type Variable

type Variable struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Value string `json:"value"`
}

type VariableSetParams

type VariableSetParams struct {
	Variable *Variable `json:"variable"`
}

type Variables

type Variables []*Variable

func (Variables) Contains

func (vs Variables) Contains(name string) (*Variable, bool)

type VariablesRes

type VariablesRes struct {
	Variables Variables `json:"variables"`
}

type VariablesService

type VariablesService interface {
	VariablesList(app string) (Variables, error)
	VariablesListWithoutAlias(app string) (Variables, error)
	VariableSet(app string, name string, value string) (*Variable, int, error)
	VariableMultipleSet(app string, variables Variables) (Variables, int, error)
	VariableUnset(app string, id string) error
}

Directories

Path Synopsis
examples
httpmock
Package httpmock is a generated GoMock package.
Package httpmock is a generated GoMock package.
tokensservicemock
Package tokensservicemock is a generated GoMock package.
Package tokensservicemock is a generated GoMock package.
Package scalingomock is a generated GoMock package.
Package scalingomock is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL