injector

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: 9 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 Inject

func Inject(v cue.Value, fsys fs.FS) cue.Value

Inject fill a cue value following the injection attributes. c.f. https://github.com/loft-orbital/cuebe#inject

Types

type Error

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

Error represents an injection error.

func NewError

func NewError(err error, dstPath cue.Path) *Error

NewError creates a new error injector.

func (*Error) Error

func (e *Error) Error() string

func (*Error) Inject

func (e *Error) Inject(target cue.Value) cue.Value

Inject injects the error into the target and return the result value.

type File

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

File injector uses a local file as source of the inject value.

func NewFile

func NewFile(src, srcPath string, dstPath cue.Path, fs fs.FS) *File

NewFile creates a new file injector.

func (*File) Inject

func (f *File) Inject(target cue.Value) cue.Value

Inject returns the target value after injection.

type Injector

type Injector interface {
	// Inject returns the target value after injection.
	Inject(v cue.Value) cue.Value
}

Injector represents a way to inject value in a Release from external sources.

Jump to

Keyboard shortcuts

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