Documentation ¶
Index ¶
- Constants
- func BuildFilelist(dir string, ignores []string) (files []string, err error)
- func CreateTarball(w io.Writer, filePaths []string) error
- func IsValidNodeApp(dir string) (errs []error)
- func NewSpinner(txt string) (s *spinner.Spinner)
- func NewTable(out io.Writer) (t *tablewriter.Table)
- func PrettyBool(b bool) (s string)
- func Split(r rune) bool
- type AccountsCmd
- type AccountsCreateCmd
- type AccountsListCmd
- type AppsCmd
- type AppsCreateCmd
- type AppsDeleteCmd
- type AppsInfoCmd
- type AppsInitCmd
- type AppsListCmd
- type AppsStacksCmd
- type CertsCmd
- type CertsRenewCmd
- type DeployCmd
- type DomainsCmd
- type DomainsListCmd
- type GS
- type GitService
- type LoginCmd
- type LogoutCmd
- type LogsCmd
- type PayloadValue
- type PsCmd
- type UploadResponse
- type VersionCmd
- type WhoAmICmd
Constants ¶
const MaxFileSize = 1073741824 // 1GB
MaxFileSize is the tarball file size allowed to be uploaded in bytes.
Variables ¶
This section is empty.
Functions ¶
func BuildFilelist ¶
BuildFilelist builds a list of files to be tarballed, with optional ignores.
func CreateTarball ¶
CreateTarball creates a tarball containing all the files in filePaths and writes it to w.
func IsValidNodeApp ¶ added in v0.0.6
IsValidNodeApp detects if a Node.js app is present in a given directory
func NewSpinner ¶ added in v1.3.1
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
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
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."` Init AppsInitCmd `cmd help:"Initialize your project for deployment."` Stacks AppsStacksCmd `cmd help:"See the available stacks to create new apps with."` }
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 ¶
AppsInfoCmd shows detailed information on an app running on Section
type AppsInitCmd ¶ added in v1.7.0
type AppsInitCmd struct { StackName string `optional default:"nodejs-basic" short:"s" help:"Name of stack to deploy. Default is nodejs-basic"` Force bool `optional short:"f" help:"Resets deployment specific files to their default configuration"` }
AppsInitCmd creates and validates server.conf and package.json to prepare an app for deployment
func (*AppsInitCmd) CreatePkgJSON ¶ added in v1.9.0
func (c *AppsInitCmd) CreatePkgJSON(stdout, stderr bytes.Buffer) (err error)
Create package.json
func (*AppsInitCmd) InitializeNodeBasicApp ¶ added in v1.7.0
func (c *AppsInitCmd) InitializeNodeBasicApp(stdout, stderr bytes.Buffer) (err error)
InitializeNodeBasicApp initializes a basic node app.
func (*AppsInitCmd) Run ¶ added in v1.7.0
func (c *AppsInitCmd) Run() (err error)
Run executes the command
type AppsListCmd ¶
type AppsListCmd struct {
AccountID int `short:"a" help:"Account ID to find apps under"`
}
AppsListCmd handles listing apps running on Section
type AppsStacksCmd ¶ added in v1.9.0
type AppsStacksCmd struct{}
AppsStacksCmd lists available stacks to create new apps with
func (*AppsStacksCmd) Run ¶ added in v1.9.0
func (c *AppsStacksCmd) 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 {
Hostname string `arg help:"The domain name to renew the cert for"`
}
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 `short:"C" 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:"600s" 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.
type DomainsCmd ¶ added in v1.7.0
type DomainsCmd struct {
List DomainsListCmd `cmd help:"List domains on Section." default:"1"`
}
DomainsCmd manages domains on Section
type DomainsListCmd ¶ added in v1.7.0
type DomainsListCmd struct {
AccountID int `short:"a" help:"ID of account to list domains under"`
}
DomainsListCmd handles listing domains on Section
func (*DomainsListCmd) Run ¶ added in v1.7.0
func (c *DomainsListCmd) Run() (err error)
Run executes the command
type GS ¶ added in v1.10.0
type GS struct{}
GS ...
func (*GS) UpdateGitViaGit ¶ added in v1.10.0
func (g *GS) UpdateGitViaGit(c *DeployCmd, response UploadResponse) error
UpdateGitViaGit clones the application repository to a temporary directory then updates it with the latest payload id and pushes a new commit
type GitService ¶ added in v1.10.0
type GitService interface {
UpdateGitViaGit(c *DeployCmd, response UploadResponse) error
}
GitService interface provides a way to interact with Git
type LoginCmd ¶
type LoginCmd struct {
// contains filtered or unexported fields
}
LoginCmd handles authenticating the CLI against Section's API
type LogoutCmd ¶ added in v1.4.0
type LogoutCmd struct{}
LogoutCmd handles revoking previously set up authentication
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
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 `short:"a" help:"ID of account to query"` AppID int `short:"i" help:"ID of app to query"` AppPath string `default:"nodejs" help:"Path of NodeJS application in environment repository."` Watch bool `short:"w" help:"Run repeatedly, output status"` Interval time.Duration `short:"t" default:"10s" help:"Interval to poll if watching"` }
PsCmd checks an application's status on Section's delivery platform
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 { LatestReleaseURL *url.URL `hidden default:"https://api.github.com/repos/section/sectionctl/releases/latest"` Timeout time.Duration `hidden default:"5s"` // contains filtered or unexported fields }
VersionCmd handles authenticating the CLI against Section's API
func (*VersionCmd) In ¶ added in v1.7.0
func (c *VersionCmd) In() io.Reader
In returns the input to read from
func (*VersionCmd) Out ¶ added in v1.7.0
func (c *VersionCmd) Out() io.Writer
Out returns the output to write to
func (VersionCmd) String ¶ added in v1.9.0
func (c VersionCmd) String() string