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.
Click to show internal directories.
Click to hide internal directories.