Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMultipleDataSourcesSpecified = errors.New("more than one data source specified; only call one of Bytes(), String(), Reader() or Path()")
ErrNoDataSourceSpecified is thrown if more than one of Bytes, String, Path or Reader of the JSONSourceSetupStepOne interface have been called.
View Source
var ErrNoDataSourceSpecified = errors.New("no data source specified; call Bytes(), String(), Reader() or Path()")
ErrNoDataSourceSpecified is thrown if none Bytes, String, Path or Reader of the JSONSourceSetupStepOne interface have been called.
Functions ¶
This section is empty.
Types ¶
type JSONSourceOptionalSetup ¶
type JSONSourceOptionalSetup[T yagcl.Source] interface { yagcl.Source // Must declares this source as mandatory, erroring in case no data can // be loaded. // FIXME Clarify when this case happens. Only when not finding a file? // FIXME does must actually make sense for anything but files? Must() T }
JSONSourceOptionalSetup offers optional Methods for configuring the source and exposes all methods required for a source to be passed on to YAGCL.
type JSONSourceSetupStepOne ¶
type JSONSourceSetupStepOne[T yagcl.Source] interface { // Bytes defines a byte array to read from directly. Bytes([]byte) JSONSourceOptionalSetup[T] // Bytes defines a string to read from directly. String(string) JSONSourceOptionalSetup[T] // Path defines a filepath that is accessed when YAGCL.Parse is called. Path(string) JSONSourceOptionalSetup[T] // Reader defines a reader that is accessed when YAGCL.Parse is called. IF // available, io.Closer.Close() is called. Reader(io.Reader) JSONSourceOptionalSetup[T] }
JSONSourceSetupStepOne enforces the API caller to specify any data source to read JSON encoded data from, before being able to pass the source on to YAGCL.
func Source ¶
func Source() JSONSourceSetupStepOne[*jsonSourceImpl]
Source creates a source for a JSON file.
Click to show internal directories.
Click to hide internal directories.