Documentation
¶
Index ¶
- Variables
- func ApplicationEnvironmentModuleUpdate(accountID int, applicationID int, env string, filePath string, ...) (err error)
- func BaseURL() (u url.URL)
- type Account
- type App
- type AppLogs
- type AppStatus
- type ApplicationCreateResponse
- type ApplicationDeleteResponse
- type Domain
- type DomainsResponse
- type Environment
- type EnvironmentUpdateCommand
- type Module
- type RenewCertResponse
- type User
Constants ¶
This section is empty.
Variables ¶
var ( // PrefixURI is the root of the Section API PrefixURI = &url.URL{Scheme: "https", Host: "aperture.section.io"} // Timeout specifies a time limit for requests made by the API client Timeout = 20 * time.Second // Token is the token for authenticating to the Section API Token string // ErrAuthDenied represents all authentication and authorization errors ErrAuthDenied = errors.New("denied") ErrStatusUnauthorized = fmt.Errorf("check your token? API request is unauthorized: %w", ErrAuthDenied) // ErrStatusForbidden (403) indicates that the server understood the request but refuses to authorize it. ErrStatusForbidden = fmt.Errorf("check your token? API request is forbidden: %w", ErrAuthDenied) )
var ( // ErrApplicationAlreadyCreated indicates an app has already been created with that FQDN. ErrApplicationAlreadyCreated = errors.New("an application has already been created with that domain name") // ErrSystemLimitExceeded indicates you have hit a soft limit on your account. Contact Section support to increase the limit. ErrSystemLimitExceeded = errors.New("system limit exceeded") )
var ( // ErrStatusBadRequest indicates the request was malformed ErrStatusBadRequest = errors.New("malformed request") // ErrStatusNotFound indicates the requested resource was not found ErrStatusNotFound = errors.New("application not found") // ErrStatusInternalServerError indicates the server errored when handling your request ErrStatusInternalServerError = errors.New("unexpected condition when handling request") )
Functions ¶
func ApplicationEnvironmentModuleUpdate ¶ added in v1.3.0
func ApplicationEnvironmentModuleUpdate(accountID int, applicationID int, env string, filePath string, up []EnvironmentUpdateCommand) (err error)
ApplicationEnvironmentModuleUpdate updates a module's configuration
Types ¶
type Account ¶
type Account struct {
ID int `json:"id"`
Href string `json:"href"`
AccountName string `json:"account_name"`
IsAdmin bool `json:"is_admin"`
BillingUser int `json:"billing_user"`
Requires2FA bool `json:"requires_2fa"`
}
Account represents an account on Section
type App ¶
type App struct {
ID int `json:"id"`
Href string `json:"href"`
ApplicationName string `json:"application_name"`
Environments []Environment `json:"environments"`
}
App represents an application deployed on Section
func Application ¶
Application returns detailed information about a given application.
func Applications ¶
Applications returns a list of applications on a given account.
type AppLogs ¶ added in v1.5.0
type AppLogs struct {
Timestamp string `json:"timestamp"`
InstanceName string `json:"instanceName"`
Type string `json:"type"`
Message string `json:"message"`
}
AppLogs represents the logs from an application deployed on Section
type AppStatus ¶ added in v1.3.0
type AppStatus struct {
InService bool `json:"inService"`
State string `json:"state"`
InstanceName string `json:"instanceName"`
PayloadID string `json:"payloadID"`
IsLatest bool `json:"isLatest"`
}
AppStatus represents the status of an application deployed on Section
type ApplicationCreateResponse ¶ added in v1.5.0
type ApplicationCreateResponse struct {
ID int `json:"id"`
Href string `json:"href"`
ApplicationName string `json:"application_name"`
PathPrefix string `json:"path_prefix"`
PathPrefixes []string `json:"path_prefixes"`
Message string `json:"message"` // for errors
}
ApplicationCreateResponse represents an API response for application create requests
func ApplicationCreate ¶ added in v1.5.0
func ApplicationCreate(accountID int, hostname, origin, stackName string) (r ApplicationCreateResponse, err error)
ApplicationCreate creates an application on the Section platform.
type ApplicationDeleteResponse ¶ added in v1.5.0
type ApplicationDeleteResponse struct {
Message string `json:"message"` // for errors
}
ApplicationDeleteResponse respresents an API response for application delete requests
func ApplicationDelete ¶ added in v1.5.0
func ApplicationDelete(accountID, appID int) (r ApplicationDeleteResponse, err error)
ApplicationDelete deletes an application on the Section platform.
type Domain ¶
type Domain struct {
Name string `json:"name"`
ZoneName string `json:"zoneName"`
CNAME string `json:"cname"`
Mode string `json:"mode"`
}
Domain represents an applications environments' domains
type DomainsResponse ¶ added in v1.7.0
type DomainsResponse struct {
DomainName string `json:"domain_name"`
Engaged bool `json:"engaged"`
}
DomainsResponse represents an API response to GET /account/{accountId}/domains
func Domains ¶ added in v1.7.0
func Domains(accountID int) (d []DomainsResponse, err error)
Domains returns a list of an account's domains
type Environment ¶
type Environment struct {
ID int `json:"id"`
Href string `json:"href"`
EnvironmentName string `json:"environment_name"`
Domains []Domain `json:"domains"`
Stack []Module `json:"stack"`
}
Environment represents an application's environments on Section
func ApplicationEnvironments ¶
func ApplicationEnvironments(accountID int, applicationID int) (es []Environment, err error)
ApplicationEnvironments returns environment information for a given application.
type EnvironmentUpdateCommand ¶ added in v1.3.0
type EnvironmentUpdateCommand struct {
Op string `json:"op"`
Path string `json:"path"`
Value interface{} `json:"value"`
}
EnvironmentUpdateCommand is a blah
type Module ¶
type Module struct {
Name string `json:"name"`
Image string `json:"image"`
Href string `json:"href"`
}
Module represents a proxy in the traffic delivery stack
type RenewCertResponse ¶ added in v1.1.0
type RenewCertResponse struct {
Issued bool `json:"issued"`
Message string `json:"message"`
Expiry time.Time `json:"expiry"`
RenewFrom time.Time `json:"renewFrom"`
}
RenewCertResponse represents an API response to POST /account/{accountId}/domain/{hostName}/renewCertificate
func DomainsRenewCert ¶ added in v1.1.0
func DomainsRenewCert(accountID int, hostname string) (r RenewCertResponse, err error)
DomainsRenewCert handles renewing a certificate for a given account and domain.
type User ¶
type User struct {
ID int `json:"id"`
Email string `json:"email"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
CompanyName string `json:"company_name"`
PhoneNumber string `json:"phone_number"`
Verified bool `json:"verified"`
Requires2FA bool `json:"requires2fa"`
Enforce2FA bool `json:"enforce2fa"`
}
User represents a user account known to Section
func CurrentUser ¶
CurrentUser returns details for the currently authenticated user