cmd

package
v0.0.0-...-100511c Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BuildInfo = Build{}
View Source
var BuildInfoCmd = &cli.Command{
	Name:        "build-info",
	Aliases:     []string{},
	Description: "show version and build info",
	Usage:       "show version and build info",
	ArgsUsage:   "",
	Action:      BuildInfoMain,

	Flags: []cli.Flag{},
}
View Source
var Commands = make([]*cli.Command, 0)

Any cli command can be appended to this during init() so apps can just add all of the available commands as sub-commands.

View Source
var S3_ACCESS_KEY_ID = os.Getenv("S3_ACCESS_KEY_ID")
View Source
var S3_BUCKET = os.Getenv("S3_BUCKET")
View Source
var S3_BUCKET_PATH = os.Getenv("S3_BUCKET_PATH")
View Source
var S3_ENDPOINT = os.Getenv("S3_ENDPOINT")
View Source
var S3_REGION = os.Getenv("S3_REGION")
View Source
var S3_SECRET_ACCESS_KEY = os.Getenv("S3_SECRET_ACCESS_KEY")
View Source
var S3_SESSION_TOKEN = os.Getenv("S3_SESSION_TOKEN")
View Source
var StreamCmd = &cli.Command{
	Name:    "stream",
	Aliases: []string{},
	Usage:   "reads log files and pushes them to an s3 bucket",
	Description: `reads log files and pushes them to an s3 bucket

		The following environment variables are available for S3 Object Storage.

		* S3_REGION            - region for endpoint
		* S3_ENDPOINT          - endpoint hostname
		* S3_BUCKET            - bucket for log uploads
		* S3_BUCKET_PATH       - base path in bucket to upload logs to
		* S3_ACCESS_KEY_ID     - key id for s3 access
		* S3_SECRET_ACCESS_KEY - secret key for s3 authentication
		* S3_SESSION_TOKEN     - optional s3 token
	`,
	ArgsUsage: "",
	Action:    StreamMain,

	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:  "config",
			Value: "/config/streams.yaml",
			Usage: "absolute path to stash config",
		},
		&cli.StringFlag{
			Name:  "tempdir",
			Value: "/tmp",
			Usage: "temporary directory to hold logs in processing",
		},
	},
}

Functions

func BuildInfoMain

func BuildInfoMain(c *cli.Context) error

func DefaultAnnounceAddr

func DefaultAnnounceAddr() string

func NArgsRequired

func NArgsRequired(c *cli.Context, n int) error

Checks for a minimum number of args required. Using it is as follows.

if err := NArgsRequired(c, 1); err != nil {
	return err
}

func StreamMain

func StreamMain(c *cli.Context) error

Types

type Build

type Build struct {
	Version string
	Branch  string
	Commit  string
	Date    string
}

Jump to

Keyboard shortcuts

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