input

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromFile

func FromFile(path string) (io.Reader, error)

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

func FromFlags(flags *pflag.FlagSet, fileKey string, literalKey string) (io.Reader, error)

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

func FromLiteral(text string) io.Reader

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

func ToGroupedStringSlice(stream io.Reader) ([]string, error)

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

func ToInt(stream io.Reader) (int, error)

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

func ToIntSlice(stream io.Reader) ([]int, error)

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

func ToString(stream io.Reader) (string, error)

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

func ToStringSlice(stream io.Reader) ([]string, error)

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.

func ToTileMap

func ToTileMap(stream io.Reader) ([][]rune, error)

ToTileMap is used to convert a stream into a 2d slice of runes. This function takes a stream of type io.Reader as input. It returns a 2d slice of runes and nil or nil and an error if one occurred.

Types

This section is empty.

Jump to

Keyboard shortcuts

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