api

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// PrefixURI is the root of the Section API
	PrefixURI = &url.URL{Scheme: "https", Host: "aperture.section.io"}

	// Token is the token for authenticating to the Section API
	Token string
	// Debug toggles whether extra information is emitted from requests/responses
	Debug bool
)

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

func BaseURL

func BaseURL() (u url.URL)

BaseURL returns a URL for building requests on

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

func Accounts

func Accounts() (as []Account, err error)

Accounts returns a list of account the current user has access to.

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

func Application(accountID int, applicationID int) (a App, err error)

Application returns detailed information about a given application.

func Applications

func Applications(accountID int) (as []App, err error)

Applications returns a list of applications on a given account.

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

func ApplicationStatus added in v1.3.0

func ApplicationStatus(accountID int, applicationID int) (as []AppStatus, err error)

ApplicationStatus returns a module's current status on Section's delivery 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 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

func ApplicationEnvironmentStack

func ApplicationEnvironmentStack(accountID int, applicationID int, environmentName string) (s []Module, err error)

ApplicationEnvironmentStack returns the stack for a given application and environment.

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

func CurrentUser() (u User, err error)

CurrentUser returns details for the currently authenticated user

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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