cmd

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GITCOMMIT string //nolint:gochecknoglobals

GITCOMMIT indicates which git hash the binary was built off of

View Source
var UIDir http.FileSystem //nolint:gochecknoglobals // we could embed this in a special serve command struct, but it adds a lot of complexity

UIDir holds the embedded static web files

View Source
var VERSION string //nolint:gochecknoglobals

VERSION indicates which version of the binary is running.

Functions

func Execute

func Execute(uiDir fs.FS)

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func XCloudTraceContext

func XCloudTraceContext(next http.Handler) http.Handler

XCloudTraceContext middleware extracts the X-Cloud-Trace-Context from the request header and injects it into the context. The value is read by the logrus GAEStandardFormatter to thread log entries by request.

Types

type StackdriverFormatter

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

StackdriverFormatter implements threaded Stackdriver formatting for logrus.

func NewStackdriverFormatter

func NewStackdriverFormatter(projectID string, options ...StackdriverOption) *StackdriverFormatter

NewStackdriverFormatter returns a new Stackdriver Formatter.

func (*StackdriverFormatter) Format

func (f *StackdriverFormatter) Format(e *logrus.Entry) ([]byte, error)

Format formats a logrus entry in Stackdriver format.

type StackdriverOption

type StackdriverOption func(*StackdriverFormatter)

StackdriverOption lets you configure the Formatter.

Jump to

Keyboard shortcuts

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