loader

package
v0.0.0-...-f89ace1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DecodeError

type DecodeError struct {
	Path string
	Err  error
}

DecodeError represents an error that occurs when decoding an object

func (*DecodeError) Error

func (e *DecodeError) Error() string

func (*DecodeError) Unwrap

func (e *DecodeError) Unwrap() error

type FileReadError

type FileReadError struct {
	Path string
	Err  error
}

FileReadError represents an error that occurs when reading a file

func (*FileReadError) Error

func (e *FileReadError) Error() string

func (*FileReadError) Unwrap

func (e *FileReadError) Unwrap() error

type Loader

type Loader struct {
	Scheme *runtime.Scheme
	Codecs serializer.CodecFactory
}

Loader is a struct for loading Kubernetes resources from YAML files

func NewLoader

func NewLoader(scheme *runtime.Scheme) *Loader

NewLoader creates a new Loader

func (*Loader) LoadObjectFromPaths

func (l *Loader) LoadObjectFromPaths(paths []string) ([]runtime.Object, error)

LoadObjectFromPaths loads resources from a slice of file or directory paths

func (*Loader) LoadPolicyFromPaths

LoadPolicyFromPaths loads policies and bindings from the specified file paths. It returns two slices: one containing ValidatingAdmissionPolicy objects and the other containing ValidatingAdmissionPolicyBinding objects. If an error occurs during loading, it returns nil slices and the error.

Parameters:

  • paths: A slice of strings representing the file paths to load the policies and bindings from.

Returns:

  • []*admissionregistrationv1.ValidatingAdmissionPolicy: A slice of ValidatingAdmissionPolicy objects.
  • []*admissionregistrationv1.ValidatingAdmissionPolicyBinding: A slice of ValidatingAdmissionPolicyBinding objects.
  • error: An error if any occurred during loading, otherwise nil.

type UnknownResourceError

type UnknownResourceError struct {
	Kind    string
	Version string
}

UnknownResourceError は未知のリソースが存在する場合のエラーを表します

func (*UnknownResourceError) Error

func (e *UnknownResourceError) Error() string

type YAMLParseError

type YAMLParseError struct {
	Path string
	Err  error
}

YAMLParseError represents an error that occurs when parsing YAML

func (*YAMLParseError) Error

func (e *YAMLParseError) Error() string

func (*YAMLParseError) Unwrap

func (e *YAMLParseError) Unwrap() error

Jump to

Keyboard shortcuts

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