Documentation
¶
Index ¶
- func CheckForUnknown(fldPath *field.Path, plainOrig, accepted interface{}) error
- func CheckForUnknownForData(fldPath *field.Path, orig []byte, accepted interface{}) error
- func PrintElements(p common2.Printer, elems []Element, outfile string, fss ...vfs.FileSystem) error
- func Validate(r *ResourceInput, ctx inputs.Context, inputFilePath string) error
- type Element
- func DetermineElement(ctx clictx.Context, ictx inputs.Context, si SourceInfo, ...) (Element, error)
- func DetermineElementForData(ctx clictx.Context, ictx inputs.Context, si SourceInfo, d []byte, ...) (Element, error)
- func DetermineElements(ctx clictx.Context, ictx inputs.Context, origin SourceInfo, d interface{}, ...) ([]Element, error)
- func DetermineElementsForSource(ctx clictx.Context, ictx inputs.Context, templ template.Options, ...) ([]Element, error)
- func MapSpecsToElems[T ElementSpec](ctx clictx.Context, ictx inputs.Context, si SourceInfo, specs []T, ...) ([]Element, error)
- func NewElement(spec ElementSpec, input *ResourceInput, src SourceInfo, data []byte, ...) Element
- func ProcessDescriptions(ctx clictx.Context, printer common2.Printer, templ template.Options, ...) ([]Element, inputs.Context, error)
- type ElementSource
- type ElementSpec
- type ElementSpecHandler
- type ResourceInput
- type SourceInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckForUnknown ¶
func CheckForUnknownForData ¶
func PrintElements ¶
Types ¶
type Element ¶
type Element interface { Source() SourceInfo Spec() ElementSpec Type() string Data() []byte Input() *ResourceInput }
func DetermineElement ¶
func DetermineElement(ctx clictx.Context, ictx inputs.Context, si SourceInfo, d map[string]interface{}, h ElementSpecHandler) (Element, error)
func DetermineElementForData ¶
func DetermineElementForData(ctx clictx.Context, ictx inputs.Context, si SourceInfo, d []byte, h ElementSpecHandler) (Element, error)
func DetermineElements ¶
func DetermineElements(ctx clictx.Context, ictx inputs.Context, origin SourceInfo, d interface{}, h ElementSpecHandler) ([]Element, error)
DetermineElements maps a list of raw element specifications into an evaluated element list.
func DetermineElementsForSource ¶
func DetermineElementsForSource(ctx clictx.Context, ictx inputs.Context, templ template.Options, h ElementSpecHandler, source ElementSource) ([]Element, error)
func MapSpecsToElems ¶
func MapSpecsToElems[T ElementSpec](ctx clictx.Context, ictx inputs.Context, si SourceInfo, specs []T, h ElementSpecHandler) ([]Element, error)
func NewElement ¶
func NewElement(spec ElementSpec, input *ResourceInput, src SourceInfo, data []byte, indices ...interface{}) Element
func ProcessDescriptions ¶
type ElementSource ¶
type ElementSource interface { Origin() SourceInfo Get() (string, error) }
type ElementSpec ¶
type ElementSpec interface { GetName() string GetVersion() string SetVersion(string) Info() string Validate(ctx clictx.Context, input *ResourceInput) error }
func DecodeElement ¶
func DecodeElement(data []byte, h ElementSpecHandler) (ElementSpec, error)
type ElementSpecHandler ¶
type ElementSpecHandler interface { Key() string RequireInputs() bool Decode(data []byte) (ElementSpec, error) }
type ResourceInput ¶
type ResourceInput struct { Access *cpi.GenericAccessSpec `json:"access"` // Input *inputs.BlobInput `json:"input,omitempty"` Input *inputs.GenericInputSpec `json:"input,omitempty"` }
func DecodeInput ¶
func DecodeInput(data []byte, ctx clictx.Context) (*ResourceInput, error)
type SourceInfo ¶
type SourceInfo interface { Origin() string Id() string String() string Sub(indices ...interface{}) SourceInfo }
func NewSourceInfo ¶
func NewSourceInfo(origin string) SourceInfo
Click to show internal directories.
Click to hide internal directories.