Documentation
¶
Index ¶
- func GetDomain(domain Domain, ctx context.Context) types.Domain
- func GetProvider(provider Provider, ctx context.Context) types.Provider
- func IsVersionValid(versionConstraint string, version string) (bool, error)
- func ReadFileToBytes(path string) ([]byte, error)
- func SetCwdToFileDir(dirPath string) (resetFunc func(), err error)
- func ValidationFromString(raw string) (validation types.LulaValidation, err error)
- type Domain
- type Metadata
- type Provider
- type Validation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetProvider ¶ added in v0.2.0
func IsVersionValid ¶ added in v0.1.0
Returns version validity
func ReadFileToBytes ¶
ReadFileToBytes reads a file to bytes
func SetCwdToFileDir ¶ added in v0.2.0
SetCwdToFileDir takes a path and changes the current working directory to the directory of the path
func ValidationFromString ¶ added in v0.2.0
func ValidationFromString(raw string) (validation types.LulaValidation, err error)
Converts a raw string to a Validation object (string -> common.Validation -> types.Validation)
Types ¶
type Domain ¶ added in v0.2.0
type Domain struct { Type string `json:"type" yaml:"type"` KubernetesSpec kube.KubernetesSpec `json:"kubernetes-spec" yaml:"kubernetes-spec"` ApiSpec api.ApiSpec `json:"api-spec" yaml:"api-spec"` }
type Metadata ¶ added in v0.2.0
type Metadata struct { Name string `json:"name" yaml:"name"` UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` }
TODO: Perhaps extend this structure with other needed information, such as UUID or type of validation if workflow is needed
type Provider ¶ added in v0.2.0
type Provider struct { Type string `json:"type" yaml:"type"` OpaSpec opa.OpaSpec `json:"opa-spec" yaml:"opa-spec"` KyvernoSpec kyverno.KyvernoSpec `json:"kyverno-spec" yaml:"kyverno-spec"` }
type Validation ¶ added in v0.2.0
type Validation struct { LulaVersion string `json:"lula-version" yaml:"lula-version"` Metadata Metadata `json:"metadata" yaml:"metadata"` Provider Provider `json:"provider" yaml:"provider"` Domain Domain `json:"domain" yaml:"domain"` }
Data structures for ingesting validation data
func (*Validation) MarshalYaml ¶ added in v0.2.0
func (v *Validation) MarshalYaml() ([]byte, error)
MarshalYaml is a convenience method to marshal a Validation object to a YAML byte array
func (*Validation) ToLulaValidation ¶ added in v0.2.0
func (validation *Validation) ToLulaValidation() (lulaValidation types.LulaValidation, err error)
ToLulaValidation converts a Validation object to a LulaValidation object
func (*Validation) UnmarshalYaml ¶ added in v0.2.0
func (v *Validation) UnmarshalYaml(data []byte) error
UnmarshalYaml is a convenience method to unmarshal a Validation object from a YAML byte array