Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EnvFallbackFlag ¶
type EnvFallbackFlag struct {
// contains filtered or unexported fields
}
EnvFallbackFlag is a custom flag type which retrieves the value from either an input flag or env var. If both are set then the flag takes priority. This type implements the pflag.Value interface.
func NewEnvFallbackFlag ¶
func NewEnvFallbackFlag(flagName, envVar string) *EnvFallbackFlag
NewEnvFallbackFlag constructs an EnvFallbackFlag with the provided env var as a fallback location to read values.
func (*EnvFallbackFlag) Get ¶
func (e *EnvFallbackFlag) Get() (string, error)
Get returns the value preferring the flag input over the env var value. If neither are set then an error is returned.
func (*EnvFallbackFlag) Set ¶
func (e *EnvFallbackFlag) Set(input string) error
Set is used within the pflag library to configure value based on a provided flag value.
func (*EnvFallbackFlag) String ¶
func (e *EnvFallbackFlag) String() string
String returns a default value as a string. This is only used within the pflag library. Callers should prefer to use Get().
func (*EnvFallbackFlag) Type ¶
func (e *EnvFallbackFlag) Type() string
type TraindownReader ¶
type TraindownReader struct {
// contains filtered or unexported fields
}
TraindownReader reads a file or directory and returns Traindown data.
func NewTraindownReader ¶
func NewTraindownReader(suffix string) *TraindownReader
NewTraindownReader returns a new TraindownReader. All files that do not have the provided suffix are ignored.
func (*TraindownReader) Read ¶
func (t *TraindownReader) Read(input string) ([]*traindown.Session, error)
Read reads the traindown files referenced in the input file path. If the input is a directory then the reader will traverse it and read all files.