commands

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const MaxFileSize = 1073741824 // 1GB

MaxFileSize is the tarball file size allowed to be uploaded in bytes.

Variables

This section is empty.

Functions

func BuildFilelist

func BuildFilelist(dir string, ignores []string) (files []string, err error)

BuildFilelist builds a list of files to be tarballed, with optional ignores.

func CreateTarball

func CreateTarball(w io.Writer, filePaths []string) error

CreateTarball creates a tarball containing all the files in filePaths and writes it to w.

func IsValidNodeApp added in v0.0.6

func IsValidNodeApp(dir string) (errs []error)

IsValidNodeApp detects if a Node.js app is present in a given directory

func NewSpinner added in v1.3.1

func NewSpinner(txt string) (s *spinner.Spinner)

NewSpinner returns a nicely formatted spinner for display while users are waiting.

func NewTable

func NewTable(out io.Writer) (t *tablewriter.Table)

NewTable returns a table with sectionctl standard formatting

func PrettyBool added in v1.3.0

func PrettyBool(b bool) (s string)

PrettyBool pretty prints a bool value

Types

type AccountsCmd

type AccountsCmd struct {
	List AccountsListCmd `cmd help:"List accounts on Section." default:"1"`
}

AccountsCmd manages accounts on Section

type AccountsCreateCmd

type AccountsCreateCmd struct{}

AccountsCreateCmd handles creating apps on Section

type AccountsListCmd

type AccountsListCmd struct{}

AccountsListCmd handles listing accounts on Section

func (*AccountsListCmd) Run

func (c *AccountsListCmd) Run() (err error)

Run executes the command

type AnalyticsCmd added in v1.3.1

type AnalyticsCmd struct {
	Event string `required`
}

AnalyticsCmd handles recording analytics events

func (*AnalyticsCmd) Run added in v1.3.1

func (c *AnalyticsCmd) Run() (err error)

Run executes the command

type AppsCmd

type AppsCmd struct {
	List   AppsListCmd   `cmd help:"List apps on Section." default:"1"`
	Info   AppsInfoCmd   `cmd help:"Show detailed app information on Section."`
	Create AppsCreateCmd `cmd help:"Create new app on Section."`
}

AppsCmd manages apps on Section

type AppsCreateCmd

type AppsCreateCmd struct{}

AppsCreateCmd handles creating apps on Section

type AppsInfoCmd

type AppsInfoCmd struct {
	AccountID int `required short:"a"`
	AppID     int `required short:"i"`
}

AppsInfoCmd shows detailed information on an app running on Section

func (*AppsInfoCmd) Run

func (c *AppsInfoCmd) Run() (err error)

Run executes the command

type AppsListCmd

type AppsListCmd struct {
	AccountID int `required short:"a"`
}

AppsListCmd handles listing apps running on Section

func (*AppsListCmd) Run

func (c *AppsListCmd) Run() (err error)

Run executes the command

type CertsCmd added in v1.1.0

type CertsCmd struct {
	Renew CertsRenewCmd `cmd help:"Renew a certificate for a domain."`
}

CertsCmd manages certificates on Section

type CertsRenewCmd added in v1.1.0

type CertsRenewCmd struct {
	AccountID int    `required short:"a"`
	Hostname  string `required`
}

CertsRenewCmd handles renewing a certificate

func (*CertsRenewCmd) Run added in v1.1.0

func (c *CertsRenewCmd) Run() (err error)

Run executes the command

type DeployCmd

type DeployCmd struct {
	AccountID   int           `required short:"a" help:"AccountID to deploy application to."`
	AppID       int           `required short:"i" help:"AppID to deploy application to."`
	Environment string        `short:"e" default:"production" help:"Environment to deploy application to."`
	Debug       bool          `help:"Display extra debugging information about what is happening inside sectionctl."`
	Directory   string        `default:"." help:"Directory which contains the application to deploy."`
	ServerURL   *url.URL      `default:"https://aperture.section.io/new/code_upload/v1/upload" help:"URL to upload application to"`
	Timeout     time.Duration `default:"300s" help:"Timeout of individual HTTP requests."`
	SkipDelete  bool          `help:"Skip delete of temporary tarball created to upload app."`
	AppPath     string        `default:"nodejs" help:"Path of NodeJS application in environment repository."`
}

DeployCmd handles deploying an app to Section.

func (*DeployCmd) Run

func (c *DeployCmd) Run() (err error)

Run deploys an app to Section's edge

type LoginCmd

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

LoginCmd handles authenticating the CLI against Section's API

func (*LoginCmd) In added in v1.3.0

func (c *LoginCmd) In() io.Reader

In returns the input to read from

func (*LoginCmd) Out added in v1.3.0

func (c *LoginCmd) Out() io.Writer

Out returns the output to write to

func (*LoginCmd) Run

func (c *LoginCmd) Run() (err error)

Run executes the command

type LogoutCmd added in v1.4.0

type LogoutCmd struct{}

LogoutCmd handles revoking previously set up authentication

func (*LogoutCmd) Run added in v1.4.0

func (c *LogoutCmd) Run() (err error)

Run executes the command

type PayloadValue added in v0.0.5

type PayloadValue struct {
	ID string `json:"section_payload_id"`
}

PayloadValue represents the value of a trigger update payload.

type PsCmd added in v1.3.0

type PsCmd struct {
	AccountID int    `required short:"a" help:"ID of account to query"`
	AppID     int    `required short:"i" help:"ID of app to query"`
	AppPath   string `default:"nodejs" help:"Path of NodeJS application in environment repository."`
}

PsCmd checks an application's status on Section's delivery platform

func (*PsCmd) Run added in v1.3.0

func (c *PsCmd) Run() (err error)

Run executes the command

type UploadResponse added in v0.0.5

type UploadResponse struct {
	PayloadID string `json:"payloadID"`
}

UploadResponse represents the response from a request to the upload service.

type VersionCmd

type VersionCmd struct{}

VersionCmd handles authenticating the CLI against Section's API

func (*VersionCmd) Run

func (c *VersionCmd) Run() (err error)

Run executes the `login` command

type WhoAmICmd added in v1.3.0

type WhoAmICmd struct{}

WhoAmICmd returns information about the currently authenticated user

func (*WhoAmICmd) Run added in v1.3.0

func (c *WhoAmICmd) Run() (err error)

Run executes the command

Jump to

Keyboard shortcuts

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