parser

package
v1.0.0-alpha.0...-0be9a8d Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func YAMLToJSON

func YAMLToJSON(data []byte) ([]byte, error)

YAMLToJSON converts a single YAML document into a JSON document or returns an error. If the document appears to be JSON the YAML decoding path is not used.

Types

type DevfileCtx

type DevfileCtx struct {
	// contains filtered or unexported fields
}

DevfileCtx stores context info regarding devfile

func FakeContext

func FakeContext(fs filesystem.Filesystem, absPath string) DevfileCtx

func NewByteContentDevfileCtx

func NewByteContentDevfileCtx(data []byte) (d DevfileCtx, err error)

NewByteContentDevfileCtx set devfile content from byte data and returns a new DevfileCtx type object and error

func NewDevfileCtx

func NewDevfileCtx(path string) DevfileCtx

NewDevfileCtx returns a new DevfileCtx type object

func NewURLDevfileCtx

func NewURLDevfileCtx(url string) DevfileCtx

NewURLDevfileCtx returns a new DevfileCtx type object

func (*DevfileCtx) GetAbsPath

func (d *DevfileCtx) GetAbsPath() string

GetAbsPath func returns current devfile absolute path

func (*DevfileCtx) GetApiVersion

func (d *DevfileCtx) GetApiVersion() string

GetApiVersion returns apiVersion stored in devfile context

func (*DevfileCtx) GetDevfileContent

func (d *DevfileCtx) GetDevfileContent() []byte

GetDevfileContent returns the devfile content

func (*DevfileCtx) GetFs

func (d *DevfileCtx) GetFs() filesystem.Filesystem

GetFs returns the filesystem object

func (*DevfileCtx) GetURL

func (d *DevfileCtx) GetURL() string

GetURL func returns current devfile absolute URL address

func (*DevfileCtx) IsApiVersionSupported

func (d *DevfileCtx) IsApiVersionSupported() bool

IsApiVersionSupported return true if the apiVersion in DevfileCtx is supported

func (*DevfileCtx) Populate

func (d *DevfileCtx) Populate() (err error)

Populate fills the DevfileCtx struct with relevant context info

func (*DevfileCtx) PopulateFromRaw

func (d *DevfileCtx) PopulateFromRaw() (err error)

PopulateFromRaw fills the DevfileCtx struct with relevant context info

func (*DevfileCtx) PopulateFromURL

func (d *DevfileCtx) PopulateFromURL() (err error)

PopulateFromURL fills the DevfileCtx struct with relevant context info

func (*DevfileCtx) SetAbsPath

func (d *DevfileCtx) SetAbsPath() (err error)

SetAbsPath sets absolute file path for devfile

func (*DevfileCtx) SetDevfileAPIVersion

func (d *DevfileCtx) SetDevfileAPIVersion() error

SetDevfileAPIVersion returns the devfile APIVersion

func (*DevfileCtx) SetDevfileContent

func (d *DevfileCtx) SetDevfileContent() error

SetDevfileContent reads devfile and if devfile is in YAML format converts it to JSON

func (*DevfileCtx) SetDevfileContentFromBytes

func (d *DevfileCtx) SetDevfileContentFromBytes(data []byte) error

SetDevfileContentFromBytes sets devfile content from byte input

func (*DevfileCtx) SetDevfileJSONSchema

func (d *DevfileCtx) SetDevfileJSONSchema() error

SetDevfileJSONSchema returns the JSON schema for the given devfile apiVersion

func (*DevfileCtx) Validate

func (d *DevfileCtx) Validate() error

Validate func validates devfile JSON schema for the given apiVersion

func (*DevfileCtx) ValidateDevfileSchema

func (d *DevfileCtx) ValidateDevfileSchema() error

ValidateDevfileSchema validate JSON schema of the provided devfile

Jump to

Keyboard shortcuts

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