commands

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2021 License: MIT Imports: 25 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 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."`
	Delete AppsDeleteCmd `cmd help:"Delete an existing app on Section."`
}

AppsCmd manages apps on Section

type AppsCreateCmd

type AppsCreateCmd struct {
	AccountID int    `required short:"a" help:"ID of account to create the app under"`
	Hostname  string `required short:"d" help:"FQDN the app can be accessed at"`
	Origin    string `required short:"o" help:"URL to fetch the origin"`
	StackName string `required short:"s" help:"Name of stack to deploy"`
}

AppsCreateCmd handles creating apps on Section

func (*AppsCreateCmd) Run added in v1.5.0

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

Run executes the command

type AppsDeleteCmd added in v1.5.0

type AppsDeleteCmd struct {
	AccountID int `required short:"a" help:"ID of account the app belongs to"`
	AppID     int `required short:"i" help:"ID of the app to delete"`
}

AppsDeleteCmd handles deleting apps on Section

func (*AppsDeleteCmd) Run added in v1.5.0

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

Run executes the command

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."`
	SkipValidation bool          `help:"Skip validation of the workload before pushing into Section. Use with caution."`
	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 LogsCmd added in v1.5.0

type LogsCmd 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."`
	InstanceName string `default:"" help:"Specific instance of NodeJS application running on Section platform."`
	Number       int    `short:"n" default:100 help:"Number of log lines to fetch."`
	Follow       bool   `help:"Displays recent logs and leaves the session open for logs to stream in. --instance-name required."`
}

LogsCmd returns logs from an application on Section's delivery platform

func (*LogsCmd) Run added in v1.5.0

func (c *LogsCmd) 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