consts

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConfigFileName defines the config file name
	ConfigFileName = "powerproto.yaml"
	// KeyNamePowerProtocInclude is the key name of powerproto default include
	KeyNamePowerProtocInclude = "POWERPROTO_INCLUDE"
	// The default include can be referenced by this key in import paths
	KeyPowerProtoInclude  = "$" + KeyNamePowerProtocInclude
	KeyNameSourceRelative = "SOURCE_RELATIVE"
	// KeySourceRelative can be specified in import paths to refer to
	// the folder where the current proto file is located
	KeySourceRelative = "$" + KeyNameSourceRelative
	// Defines the program directory of PowerProto, including various binary and include files
	EnvHomeDir = "POWERPROTO_HOME"
	// ProtobufRepository defines the protobuf repository
	ProtobufRepository = "https://github.com/protocolbuffers/protobuf"
	// GoogleAPIsRepository defines the google apis repository
	GoogleAPIsRepository = "https://github.com/googleapis/googleapis"
)

defines a set of const value

Variables

View Source
var (
	TextExecuteAction  = color.HiGreenString("EXECUTE ACTION")
	TextExecuteCommand = color.HiGreenString("EXECUTE COMMAND")
	TextDryRun         = color.HiGreenString("DRY RUN")
)

defines a set of text style

Functions

func GetContextWithPerCommandTimeout

func GetContextWithPerCommandTimeout(ctx context.Context) (context.Context, context.CancelFunc)

func GetHomeDir

func GetHomeDir() string

GetHomeDir is used to get cached homeDir

func IsBatchCompile

func IsBatchCompile(ctx context.Context) bool

IsBatchCompile is used to determine whether it is currently in BatchCompile mode

func IsDebugMode

func IsDebugMode(ctx context.Context) bool

IsDebugMode is used to decide whether to disable PostAction and PostShell

func IsDisableAction

func IsDisableAction(ctx context.Context) bool

IsDisableAction is used to decide whether to disable PostAction and PostShell

func IsDryRun

func IsDryRun(ctx context.Context) bool

IsDryRun is used to determine whether it is currently in DryRun mode

func IsIgnoreDryRun

func IsIgnoreDryRun(ctx context.Context) bool

IsIgnoreDryRun is used to determine whether it is currently in ignore DryRun mode

func PathForGlobalConfig

func PathForGlobalConfig() string

PathForGlobalConfig is used to get path of global config

func WithBatchCompile

func WithBatchCompile(ctx context.Context) context.Context

WithBatchCompile is used to inject batchCompile flag into context

func WithDebugMode

func WithDebugMode(ctx context.Context) context.Context

WithDebugMode is used to set debug mode

func WithDisableAction

func WithDisableAction(ctx context.Context) context.Context

WithDisableAction is used to disable post action/shell

func WithDryRun

func WithDryRun(ctx context.Context) context.Context

WithDryRun is used to inject dryRun flag into context

func WithIgnoreDryRun

func WithIgnoreDryRun(ctx context.Context) context.Context

WithIgnoreDryRun is used to inject ignore dryRun flag into context

func WithPerCommandTimeout

func WithPerCommandTimeout(ctx context.Context, timeout time.Duration) context.Context

WithPerCommandTimeout is used to inject per command timeout

Types

This section is empty.

Jump to

Keyboard shortcuts

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