aipcli

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 40 Imported by: 4

Documentation

Overview

Package aipcli provides runtime APIs for generated CLIs.

Index

Constants

View Source
const (
	FieldResourceName = "name"
)

Variables

This section is empty.

Functions

func IsVerbose added in v0.18.2

func IsVerbose(cmd *cobra.Command) bool

func NewCommand added in v0.12.0

func NewCommand(cmd *cobra.Command, commands ...*cobra.Command) *cobra.Command

NewCommand initializes a new *cobra.Command with AIP CLI flags and help functions.

func NewIAMModuleCommand added in v0.11.0

func NewIAMModuleCommand(name string, config Config) *cobra.Command

NewIAMModuleCommand returns a *cobra.Command for standard IAM operations.

func NewMethodCommand added in v0.7.0

func NewMethodCommand(
	config Config,
	method protoreflect.MethodDescriptor,
	in proto.Message,
	out proto.Message,
	comments map[protoreflect.FullName]string,
) *cobra.Command

NewMethodCommand initializes a new *cobra.Command for the provided gRPC method.

func NewModuleCommand added in v0.10.0

func NewModuleCommand(
	use string,
	short string,
	config Config,
	commands ...*cobra.Command,
) *cobra.Command

NewModuleCommand initializes a new *cobra.Command for a CLI module. A module is a collection of services with a common CLI config.

func NewServiceCommand added in v0.7.0

func NewServiceCommand(
	config Config,
	service protoreflect.ServiceDescriptor,
	comments map[protoreflect.FullName]string,
	commands ...*cobra.Command,
) *cobra.Command

NewServiceCommand initializes a new *cobra.Command for the provided gRPC service.

Types

type CompletionFunc

type CompletionFunc func(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective)

type Config

type Config struct {
	// Hosts is a map from host ID to host address.
	Hosts map[string]string
	// DefaultHost is the host ID of the default host.
	DefaultHost string
	// RootPath is where the root file will be located.
	RootPath string
	// Root is the name of the root module package.
	Root string
	// GoogleCloudIdentityTokens indicates if Google Cloud Identity Tokens should be automatically generated.
	GoogleCloudIdentityTokens bool
	// Uses in a predetermined file relative to local config path for the Identity Token.
	CachedIdentityTokenPath string
}

Config is the configuration for the protoc-gen-go-aip-cli plugin.

func GetConfig added in v0.18.2

func GetConfig(cmd *cobra.Command) Config

type IdentityTokenFile added in v0.20.0

type IdentityTokenFile struct {
	IdentityToken string
}

Jump to

Keyboard shortcuts

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