cliutil

package
v0.0.0-...-d2a87e9 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoTunnelID      = errors.New("no tunnel ID provided")
	ErrInvalidTunnelID = errors.New("unable to parse provided tunnel id as a valid UUID")
)

Error definitions for management token operations

View Source
var (
	FlagLogOutput = &cli.StringFlag{
		Name:    flags.LogFormatOutput,
		Usage:   "Output format for the logs (default, json)",
		Value:   flags.LogFormatOutputValueDefault,
		EnvVars: []string{"TUNNEL_MANAGEMENT_OUTPUT", "TUNNEL_LOG_OUTPUT"},
	}
)

Functions

func Action

func Action(actionFunc cli.ActionFunc) cli.ActionFunc

func ConfigureLoggingFlags

func ConfigureLoggingFlags(shouldHide bool) []cli.Flag

func ConfiguredAction

func ConfiguredAction(actionFunc cli.ActionFunc) cli.ActionFunc

func ConfiguredActionWithWarnings

func ConfiguredActionWithWarnings(actionFunc func(*cli.Context, string) error) cli.ActionFunc

Just like ConfiguredAction, but accepts a second parameter with configuration warnings.

func CreateStderrLogger

func CreateStderrLogger(c *cli.Context) *zerolog.Logger

CreateStderrLogger creates a logger that outputs to stderr to avoid interfering with stdout

func FileChecksum

func FileChecksum(filePath string) (string, error)

FileChecksum opens a file and returns the SHA256 checksum.

func GetManagementToken

func GetManagementToken(c *cli.Context, log *zerolog.Logger, res cfapi.ManagementResource, buildInfo *BuildInfo) (string, error)

GetManagementToken acquires a management token from Cloudflare API for the specified resource

func RemovedCommand

func RemovedCommand(name string) *cli.Command

func UsageError

func UsageError(format string, args ...interface{}) error

func WithErrorHandler

func WithErrorHandler(actionFunc cli.ActionFunc) cli.ActionFunc

Ensures exit with error code if actionFunc returns an error

Types

type BuildInfo

type BuildInfo struct {
	GoOS               string `json:"go_os"`
	GoVersion          string `json:"go_version"`
	GoArch             string `json:"go_arch"`
	BuildType          string `json:"build_type"`
	CloudflaredVersion string `json:"cloudflared_version"`
	Checksum           string `json:"checksum"`
}

func GetBuildInfo

func GetBuildInfo(buildType, version string) *BuildInfo

func (*BuildInfo) GetBuildTypeMsg

func (bi *BuildInfo) GetBuildTypeMsg() string

func (*BuildInfo) Log

func (bi *BuildInfo) Log(log *zerolog.Logger)

func (*BuildInfo) OSArch

func (bi *BuildInfo) OSArch() string

func (*BuildInfo) UserAgent

func (bi *BuildInfo) UserAgent() string

func (*BuildInfo) Version

func (bi *BuildInfo) Version() string

Jump to

Keyboard shortcuts

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