asset

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadDefinition

func ReadDefinition(path string, target interface{}, stdin io.Reader) error

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

func ReadDefinitionFile(path string, target interface{}) error

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

func RegisterGetFlags(cmd *cobra.Command, flags *GetFlags)

RegisterGetFlags adds get-specific flags to a command

func RegisterListFlags

func RegisterListFlags(cmd *cobra.Command, flags *ListFlags)

RegisterListFlags adds list-specific flags to a command

func WriteDefinitionFile

func WriteDefinitionFile(path string, data interface{}) error

WriteDefinitionFile writes data to a YAML or JSON file. It auto-detects the format based on file extension, defaulting to YAML.

func WriteToStdout

func WriteToStdout(format string, data interface{}) error

WriteToStdout writes data to stdout in the specified format. Format can be "yaml", "yml", or "json".

Types

type CommonFlags

type CommonFlags struct {
	ApiUrl    string
	AuthToken string
	Dataset   string
	Output    string
}

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 GetFlags

type GetFlags struct {
	CommonFlags
}

GetFlags holds flags specific to get commands

type ListFlags

type ListFlags struct {
	CommonFlags
	Limit int
	All   bool
}

ListFlags holds flags specific to list commands

Jump to

Keyboard shortcuts

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