api

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseByteSlice

func ParseByteSlice(data []byte, clusterConfig KindAccessor) error

Types

type FileReader

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

func NewFileReader

func NewFileReader(fileName string) *FileReader

func (*FileReader) Initialize

func (reader *FileReader) Initialize(clusterConfig KindAccessor) error

func (*FileReader) Parse

func (reader *FileReader) Parse(clusterConfig KindAccessor) error

type KindAccessor

type KindAccessor interface {
	// MetaKind is the kind actually read when unmarshaling from a file.
	MetaKind() string

	// ExpectedKind is the kind we expect to read while unmarshaling.
	ExpectedKind() string
}

KindAccessor exposes the Kind field for Cluster type.

The FileReader will compare the Kind field (accessed via MetaKind()) with the result of ExpectedKind() to ensure that the data we unmarshaled was meant for a struct of the correct type. That is, it prevents us from unmarshaling bytes meant for a Foo struct into a Bar struct.

Directories

Path Synopsis
Package v1alpha1 contains API Schema definitions for the packages v1alpha1 API group +kubebuilder:object:generate=true +groupName=packages.eks.amazonaws.com
Package v1alpha1 contains API Schema definitions for the packages v1alpha1 API group +kubebuilder:object:generate=true +groupName=packages.eks.amazonaws.com

Jump to

Keyboard shortcuts

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