Documentation
¶
Index ¶
- func FromFile(path string) (io.Reader, error)
- func FromFlags(flags *pflag.FlagSet, fileKey string, literalKey string) (io.Reader, error)
- func FromLiteral(text string) io.Reader
- func ToGroupedStringSlice(stream io.Reader) ([]string, error)
- func ToInt(stream io.Reader) (int, error)
- func ToIntSlice(stream io.Reader) ([]int, error)
- func ToString(stream io.Reader) (string, error)
- func ToStringSlice(stream io.Reader) ([]string, error)
- func ToTileMap(stream io.Reader) ([][]rune, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromFile ¶
FromFile is used to load a challenge input from a file. This function takes the filename as input. It returns a stream of type io.Reader and nil or nil and an error if one occurred.
func FromFlags ¶
FromFlags is used to determine how a challenge input should be loaded. If the file flag is set the FromFile function will be used, if the literal flag is set the FromLiteral function will be used. This function takes a flagset of type pflag.FlagSet, a file key and a literal key as inputs. It returns a stream of type io.Reader and nil or nil and an error if one occurred.
func FromLiteral ¶
FromLiteral is used to load a challenge input from a string. This function takes the text as input. It returns a stream of type io.Reader and nil or nil and an error if one occurred.
func ToGroupedStringSlice ¶
ToGroupedStringSlice is used to convert a stream into a slice of grouped strings. The groups must be separated by empty lines. This function takes a stream of type io.Reader as input. It returns a slice of grouped strings and nil or nil and an error if one occurred.
func ToInt ¶
ToInt is used to convert a stream into an integer. This function takes a stream of type io.Reader as input. It returns an integer and nil or 0 and an error if one occurred.
func ToIntSlice ¶
ToIntSlice is used to convert a stream into a slice of integers. This function takes a stream of type io.Reader as input. It returns a slice of integers and nil or nil and an error if one occurred.
func ToString ¶
ToString is used to convert a stream into a string. This function takes a stream of type io.Reader as input. It returns a string and nil or an empty string and an error if one occurred.
func ToStringSlice ¶
ToStringSlice is used to convert a stream into a slice of strings. This function takes a stream of type io.Reader as input. It returns a slice of strings and nil or nil and an error if one occurred.
Types ¶
This section is empty.