unifier

package
v0.1.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Copyright © 2021 Loft Orbital

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadFile

func ReadFile(filename string, fsys fs.FS) ([]byte, error)

ReadFile reads the file named by filename and returns the contents. If the filename ends by .enc.*, it will be decrypted (Mozilla sops format).

Types

type CUEUnmarshaller

type CUEUnmarshaller struct{}

CUEUnmarshaller can unmarshal CUE content to cue.Value.

func (*CUEUnmarshaller) Unmarshal

func (c *CUEUnmarshaller) Unmarshal(data []byte, ctx *cue.Context, options ...cue.BuildOption) (cue.Value, error)

Unmarshal unmarshals CUE-formatted data as a cue.Value.

type JSONUnmarshaller

type JSONUnmarshaller struct{}

JSONUnmarshaller can unmarshal JSON content to cue.Value.

func (*JSONUnmarshaller) Unmarshal

func (j *JSONUnmarshaller) Unmarshal(data []byte, ctx *cue.Context, options ...cue.BuildOption) (cue.Value, error)

Unmarshal unmarshals JSON-formatted data as a cue.Value.

type Unifier

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

Unifier represents a multi sources CUE release.

func Load

func Load(entrypoints []string, cfg *load.Config) (*Unifier, error)

Load loads instances inside entrypoints, using wd as a working directory. It returns the Unifier containing all the values find.

func (*Unifier) AddFile

func (u *Unifier) AddFile(file string, fsys fs.FS) error

AddFile parse and compile an orphan file, then add it to the Unifier's values. It plain texti (cue,yaml,json) or sops-encrypted files.

func (*Unifier) Unify

func (u *Unifier) Unify() cue.Value

Unify reduces all the Unifier values in a single cue.Value

type Unmarshaller

type Unmarshaller interface {
	Unmarshal(data []byte, ctx *cue.Context, options ...cue.BuildOption) (cue.Value, error)
}

Unmarshaller can unmarshal raw bytes to cue.Value.

func UnmarshallerFor

func UnmarshallerFor(ext string) (Unmarshaller, error)

UnmarshallerFor returns the appropriate Unmarshaller for the extension or an error if the extension is not supported.

type YAMLUnmarshaller

type YAMLUnmarshaller struct{}

YAMLUnmarshaller can unmarshal YAML content to cue.Value.

func (*YAMLUnmarshaller) Unmarshal

func (y *YAMLUnmarshaller) Unmarshal(data []byte, ctx *cue.Context, options ...cue.BuildOption) (cue.Value, error)

Unmarshal unmarshals YAML-formatted data as a cue.Value.

Jump to

Keyboard shortcuts

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