global

package
v0.0.0-...-675a61e Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package global defines a globally accessible data structure.

Index

Constants

This section is empty.

Variables

View Source
var Flags = []cli.Flag{
	&cli.BoolFlag{
		Name:    "accept-defaults",
		Aliases: []string{"d"},
		Usage:   "Accept default options for all interactive prompts apart from Yes/No confirmations",
	},
	&cli.BoolFlag{
		Name:    "auto-yes",
		Aliases: []string{"y"},
		Usage:   "Answer yes automatically to all Yes/No confirmations. This may suppress security warnings",
	},
	&cli.StringFlag{
		Name:        "endpoint",
		Usage:       "Fastly API endpoint",
		DefaultText: "https://api.fastly.com",
	},
	&cli.BoolFlag{
		Name:    "json",
		Aliases: []string{"j"},
		Usage:   "Render output as JSON",
	},
	&cli.BoolFlag{
		Name:    "non-interactive",
		Aliases: []string{"i"},
		Usage:   "Do not prompt for user input - suitable for CI processes. Equivalent to --accept-defaults and --auto-yes",
	},
	&cli.StringFlag{
		Name:    "profile",
		Aliases: []string{"o"},
		Usage:   "Switch account profile for single command execution (see also: 'fastly profile switch')",
	},
	&cli.BoolFlag{
		Name:    "quiet",
		Aliases: []string{"q"},
		Usage:   "Silence all output except direct command output. This won't prevent interactive prompts (see: --accept-defaults, --auto-yes, --non-interactive)",
	},
	&cli.StringFlag{
		Name:    "token",
		Aliases: []string{"t"},
		Usage:   fmt.Sprintf("Fastly API token (or via %s)", env.Token),
	},
	&cli.BoolFlag{
		Name:    "verbose",
		Aliases: []string{"v"},
		Usage:   "Verbose logging",
	},
}

Flags represents global flags.

Functions

This section is empty.

Types

type Data

type Data struct {
	// APIClient is used to interact with the Fastly API.
	APIClient *fastly.Client
	// Config is the application configuration.
	Config *config.Data
}

Data is shared globally across the application.

var Container Data

Container represents a single instance of our global data.

Jump to

Keyboard shortcuts

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