Documentation ¶
Index ¶
- Constants
- Variables
- func NewCmd(o *Options) *cobra.Command
- type BulkFile
- type BulkFiles
- type BulkFilesSource
- type BulkFilesSourceOpts
- type DataValuesFile
- type DataValuesFlags
- type FileMarksOpts
- type FileSource
- type Input
- type Options
- type Output
- type OutputType
- type RegularFilesSource
- type RegularFilesSourceOpts
Constants ¶
const ( RegularFilesOutputTypeYAML = "yaml" RegularFilesOutputTypeJSON = "json" RegularFilesOutputTypePos = "pos" )
When the FileSource are RegularFilesSource, indicates which file format to use when rendering the output.
const ( RegularFilesOutputTypeOpenAPI = "openapi-v3" RegularFilesOutputTypeNone = "" )
When the FileSource are RegularFilesSource, indicates which schema type to use when rendering the output.
Variables ¶
var ( RegularFilesOutputFormatTypes = []string{RegularFilesOutputTypeYAML, RegularFilesOutputTypeJSON, RegularFilesOutputTypePos} RegularFilesOutputSchemaTypes = []string{RegularFilesOutputTypeOpenAPI} RegularFilesOutputTypes = append(RegularFilesOutputFormatTypes, RegularFilesOutputSchemaTypes...) )
Collections of each category of output type
Functions ¶
Types ¶
type BulkFilesSource ¶
type BulkFilesSource struct {
// contains filtered or unexported fields
}
func NewBulkFilesSource ¶
func NewBulkFilesSource(opts BulkFilesSourceOpts, ui ui.UI) *BulkFilesSource
func (*BulkFilesSource) HasInput ¶
func (s *BulkFilesSource) HasInput() bool
func (*BulkFilesSource) HasOutput ¶
func (s *BulkFilesSource) HasOutput() bool
func (BulkFilesSource) Input ¶
func (s BulkFilesSource) Input() (Input, error)
func (*BulkFilesSource) Output ¶
func (s *BulkFilesSource) Output(out Output) error
type BulkFilesSourceOpts ¶
type BulkFilesSourceOpts struct {
// contains filtered or unexported fields
}
func (*BulkFilesSourceOpts) Set ¶
func (s *BulkFilesSourceOpts) Set(cmd *cobra.Command)
type DataValuesFile ¶ added in v0.34.0
type DataValuesFile struct {
// contains filtered or unexported fields
}
func NewDataValuesFile ¶ added in v0.34.0
func NewDataValuesFile(doc *yamlmeta.Document) DataValuesFile
type DataValuesFlags ¶ added in v0.8.0
type DataValuesFlags struct { EnvFromStrings []string EnvFromYAML []string KVsFromStrings []string KVsFromYAML []string KVsFromFiles []string FromFiles []string Inspect bool InspectSchema bool EnvironFunc func() []string ReadFileFunc func(string) ([]byte, error) }
func (*DataValuesFlags) AsOverlays ¶ added in v0.26.0
func (s *DataValuesFlags) AsOverlays(strict bool) ([]*datavalues.Envelope, []*datavalues.Envelope, error)
AsOverlays generates Data Values overlays, one for each setting in this DataValuesFlags.
Returns a collection of overlays targeted for the root library and a separate collection of overlays "addressed" to children libraries.
func (*DataValuesFlags) Set ¶ added in v0.8.0
func (s *DataValuesFlags) Set(cmd *cobra.Command)
type FileMarksOpts ¶ added in v0.25.0
type FileMarksOpts struct {
FileMarks []string
}
func (*FileMarksOpts) Set ¶ added in v0.25.0
func (s *FileMarksOpts) Set(cmd *cobra.Command)
type FileSource ¶
type FileSource interface { HasInput() bool HasOutput() bool Input() (Input, error) // Output renders the results (i.e. an instance of Output) to the configured output/sink of this FileSource Output(Output) error }
FileSource provides both a means of loading from sources (i.e. Input) and rendering into sinks (i.e. Output)
type Options ¶ added in v0.32.0
type Options struct { IgnoreUnknownComments bool ImplicitMapKeyOverrides bool StrictYAML bool Debug bool InspectFiles bool BulkFilesSourceOpts BulkFilesSourceOpts RegularFilesSourceOpts RegularFilesSourceOpts FileMarksOpts FileMarksOpts DataValuesFlags DataValuesFlags }
func NewOptions ¶
func NewOptions() *Options
type Output ¶ added in v0.32.0
type Output struct { Files []files.OutputFile DocSet *yamlmeta.DocumentSet Err error }
type OutputType ¶ added in v0.38.0
type OutputType struct {
Types []string
}
OutputType holds the user's desire for two (2) categories of output: - file format type :: yaml, json, pos - schema type :: OpenAPI V3, ytt Schema
func (*OutputType) Format ¶ added in v0.38.0
func (o *OutputType) Format() (string, error)
Format returns which of the file format types is in effect
func (*OutputType) Schema ¶ added in v0.38.0
func (o *OutputType) Schema() (string, error)
Schema returns which of the schema types is in effect
type RegularFilesSource ¶
type RegularFilesSource struct {
// contains filtered or unexported fields
}
func NewRegularFilesSource ¶
func NewRegularFilesSource(opts RegularFilesSourceOpts, ui ui.UI) *RegularFilesSource
func (*RegularFilesSource) HasInput ¶
func (s *RegularFilesSource) HasInput() bool
func (*RegularFilesSource) HasOutput ¶
func (s *RegularFilesSource) HasOutput() bool
func (*RegularFilesSource) Input ¶
func (s *RegularFilesSource) Input() (Input, error)
func (*RegularFilesSource) Output ¶
func (s *RegularFilesSource) Output(out Output) error
type RegularFilesSourceOpts ¶
type RegularFilesSourceOpts struct { OutputFiles string OutputType OutputType files.SymlinkAllowOpts // contains filtered or unexported fields }
RegularFilesSourceOpts holds configuration for when regular files are the input/output of the execution (via the --files and --output... flags).
func (*RegularFilesSourceOpts) Set ¶
func (s *RegularFilesSourceOpts) Set(cmd *cobra.Command)
Set registers flags related to sourcing ordinary files/directories and wires-up those flags up to this RegularFilesSourceOpts to be set when the corresponding cobra.Command is executed.