Documentation
¶
Index ¶
- func ReadDefinition(path string, target interface{}, stdin io.Reader) error
- func ReadDefinitionFile(path string, target interface{}) error
- func RegisterCommonFlags(cmd *cobra.Command, flags *CommonFlags)
- func RegisterDeleteFlags(cmd *cobra.Command, flags *DeleteFlags)
- func RegisterFileInputFlags(cmd *cobra.Command, flags *FileInputFlags)
- func RegisterGetFlags(cmd *cobra.Command, flags *GetFlags)
- func RegisterListFlags(cmd *cobra.Command, flags *ListFlags)
- func WriteDefinitionFile(path string, data interface{}) error
- func WriteToStdout(format string, data interface{}) error
- type CommonFlags
- type DeleteFlags
- type FileInputFlags
- type GetFlags
- type ListFlags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadDefinition ¶
ReadDefinition reads a YAML or JSON definition from a file or stdin. If path is "-" or empty, it reads from stdin (assumes YAML format). Otherwise, it reads from the file at the given path.
func ReadDefinitionFile ¶
ReadDefinitionFile reads a YAML or JSON file and unmarshals into the target. It auto-detects the format based on file extension, falling back to YAML first.
func RegisterCommonFlags ¶
func RegisterCommonFlags(cmd *cobra.Command, flags *CommonFlags)
RegisterCommonFlags adds common flags to a command
func RegisterDeleteFlags ¶
func RegisterDeleteFlags(cmd *cobra.Command, flags *DeleteFlags)
RegisterDeleteFlags adds delete-specific flags to a command
func RegisterFileInputFlags ¶
func RegisterFileInputFlags(cmd *cobra.Command, flags *FileInputFlags)
RegisterFileInputFlags adds file input flags to a command and marks -f as required
func RegisterGetFlags ¶
RegisterGetFlags adds get-specific flags to a command
func RegisterListFlags ¶
RegisterListFlags adds list-specific flags to a command
func WriteDefinitionFile ¶
WriteDefinitionFile writes data to a YAML or JSON file. It auto-detects the format based on file extension, defaulting to YAML.
func WriteToStdout ¶
WriteToStdout writes data to stdout in the specified format. Format can be "yaml", "yml", or "json".
Types ¶
type CommonFlags ¶
CommonFlags holds common flag values used across all asset commands
type DeleteFlags ¶
type DeleteFlags struct {
CommonFlags
Force bool
}
DeleteFlags holds flags specific to delete commands
type FileInputFlags ¶
type FileInputFlags struct {
CommonFlags
File string
DryRun bool
}
FileInputFlags holds flags for file-based input operations (create, update, apply)
type ListFlags ¶
type ListFlags struct {
CommonFlags
Limit int
All bool
}
ListFlags holds flags specific to list commands