Documentation ¶
Overview ¶
TODO: * - csv output * - add command to list original filenames and formatted dates * - add ignore fields * - test on windows
Index ¶
- Variables
- func AddSubCommands(cc *CommandsConfig, log zerolog.Logger, s Setup) error
- func CreateAndUseFile(path string, user UseWriter) (err error)
- func Decode(coder payload.MultiCoder, b []byte, v interface{}) (err error)
- func MakeLuaSandbox(b adaptors.Builder) (*adaptors.LuaSandbox, error)
- func MakeSandbox(b adaptors.Builder) (*adaptors.Sandbox, error)
- func OpenAndUseFile(path string, user UseReader) (err error)
- func PadTwo(ii int) (s string)
- func ReadTimeStampTest(l *zerolog.Logger, reader ReadFn) (err error)
- func RunLua(args Args) (err error)
- func RunLuaLimited(args Args) (err error)
- func ToUpperCamelCase(s string) string
- type AllLoadersFailed
- type Args
- type BatchRenamer
- type BatchRunConfig
- type BinaryLoad
- type BundleConfig
- func (bc *BundleConfig) Build(s *adaptors.Sandbox) (err error)
- func (bc *BundleConfig) CascadiaBundle(ctx Context, bctx BundleContext) (err error)
- func (bc *BundleConfig) GoqueryBundle(ctx Context, bctx BundleContext) (err error)
- func (bc *BundleConfig) PreProcInclude(s *adaptors.Sandbox, bctx BundleContext) (err error)
- func (bc *BundleConfig) SubCommands(log zerolog.Logger) (sc SubCommands, err error)
- type BundleContext
- type CliConfig
- type Closers
- type ColNames
- type Cols
- type Columns
- type CommandsConfig
- type Config
- type Configured
- type Context
- type CsvConfig
- type Data
- type DefaultExcelOpener
- type DefaultFormatter
- func (d DefaultFormatter) Date(wr io.Writer, tpl Templates, parts Parts) (err error)
- func (d DefaultFormatter) Exec(wr io.Writer, key string, tpl Templates, data interface{}) (err error)
- func (DefaultFormatter) InName(wr io.Writer, tpl Templates, iiFile int) (err error)
- func (d DefaultFormatter) OutName(wr io.Writer, tpl Templates, t time.Time) (err error)
- func (d DefaultFormatter) OutNameParts(wr io.Writer, tpl Templates, parts Parts) (err error)
- type Dep
- type DepMap
- type DetectedLayout
- type Directories
- type Downloader
- type Excel
- type ExcelOpener
- type ExcelReaderPayload
- type ExecutionMode
- type ExecutorConfig
- type ExecutorMode
- type Files
- type Format
- type Formats
- type Formatter
- type FormatterConfig
- type FormatterMode
- type FuzzSelector
- type FzFConfig
- type FzfSelector
- type HardcodedSeparate
- type HeaderMismatch
- type Ignore
- type Imports
- type InOutIndices
- type KeyContext
- type LineFormatter
- type LoadRawFn
- type LogConfig
- type Logger
- type MapOther
- type Mode
- type MultiLoader
- type OsCopier
- type Out
- type Params
- type Parsers
- type Part
- type Parts
- type PartsSeparator
- type PasswordConfig
- type Paths
- type RawData
- type RawLoadFn
- type RawLoader
- type RawParser
- type ReadFn
- type Realm
- type Renames
- type ScoreCalculator
- type ScoreCalculatorSetup
- type SeparateFn
- type Setup
- type SubCommand
- type SubCommandInit
- type SubCommandInits
- type SubCommands
- type TemplateConfig
- type Templates
- type Tester
- type ThirdPartySetup
- type TimeStampFromOffset
- type TimeStampIO
- type TimeStampParser
- type TimeStampReader
- type UseReader
- type UseWriter
Constants ¶
This section is empty.
Variables ¶
var DefaultMagic = "PEPE2D constant interval DataSet file"
var ErrColsNotFound = fmt.Errorf("excel: failed to find col")
var ErrZeroLenSLice = fmt.Errorf("slice with zero elements")
Functions ¶
func AddSubCommands ¶
func AddSubCommands(cc *CommandsConfig, log zerolog.Logger, s Setup) error
func CreateAndUseFile ¶
func MakeLuaSandbox ¶
func MakeLuaSandbox(b adaptors.Builder) (*adaptors.LuaSandbox, error)
func OpenAndUseFile ¶
func RunLuaLimited ¶
func ToUpperCamelCase ¶
ToUpperCamelCase is an Option.NameFunc that converts strings from snake case to upper camel case.
Types ¶
type AllLoadersFailed ¶
type AllLoadersFailed struct {
LastErr error
}
func (AllLoadersFailed) Error ¶
func (AllLoadersFailed) Error() (s string)
func (AllLoadersFailed) Unwrap ¶
func (a AllLoadersFailed) Unwrap() (err error)
type BatchRenamer ¶
type BatchRenamer struct { Out Out `json:"out" toml:"out" mapstructure:"out"` Formats Formats `json:"formats" toml:"formats" mapstructure:"formats"` Pattern spath.Pattern `json:"pattern" toml:"pattern" mapstructure:"pattern"` // contains filtered or unexported fields }
func (*BatchRenamer) SubCommands ¶
func (br *BatchRenamer) SubCommands(log zerolog.Logger) (sc SubCommands, err error)
type BatchRunConfig ¶
type BinaryLoad ¶
type BinaryLoad struct{}
var BinaryLoader BinaryLoad
func (BinaryLoad) LoadRaw ¶
func (BinaryLoad) LoadRaw(r io.ReadSeeker) (data geochem.RawData, err error)
type BundleConfig ¶
type BundleConfig struct { Infile string `json:"infile" toml:"infile" mapstructure:"infile"` Outfile string `json:"outfile" toml:"outfile" mapstructure:"outfile"` }
func (*BundleConfig) CascadiaBundle ¶
func (bc *BundleConfig) CascadiaBundle(ctx Context, bctx BundleContext) (err error)
func (*BundleConfig) GoqueryBundle ¶
func (bc *BundleConfig) GoqueryBundle(ctx Context, bctx BundleContext) (err error)
func (*BundleConfig) PreProcInclude ¶
func (bc *BundleConfig) PreProcInclude(s *adaptors.Sandbox, bctx BundleContext) (err error)
func (*BundleConfig) SubCommands ¶
func (bc *BundleConfig) SubCommands(log zerolog.Logger) (sc SubCommands, err error)
type BundleContext ¶
type BundleContext struct {
// contains filtered or unexported fields
}
type CliConfig ¶
type CliConfig struct { Executor ExecutorConfig Log LogConfig BatchRun BatchRunConfig }
type CommandsConfig ¶
type CommandsConfig struct { SubCommands SubCommands // contains filtered or unexported fields }
func SetupCommands ¶
func SetupCommands(args Args) (cc CommandsConfig, err error)
func (*CommandsConfig) AddSubSteps ¶
func (cc *CommandsConfig) AddSubSteps(root string, subCmds SubCommands) (err error)
func (CommandsConfig) HandleError ¶
func (cc CommandsConfig) HandleError(err error)
type Context ¶
type Context struct { Streams stream.Streams OsFs fs.FS Coder payload.MultiCoder Log zerolog.Logger // contains filtered or unexported fields }
func NewContext ¶
func NewContext() (m Context)
func (*Context) AddOpenedStream ¶
func (Context) HandleError ¶
type CsvConfig ¶
type CsvConfig struct { FilePaths path.PatternMap `json:"filepaths" toml:"filepaths" mapstructure:"filepaths"` OutFile string `json:"outfile" toml:"outfile" mapstructure:"outfile"` }
func (*CsvConfig) SubCommands ¶
func (ccfg *CsvConfig) SubCommands(log zerolog.Logger) (sc SubCommands, err error)
type DefaultExcelOpener ¶
type DefaultExcelOpener struct{}
func (DefaultExcelOpener) OpenExcel ¶
func (DefaultExcelOpener) OpenExcel(path string) (f *excelize.File, err error)
type DefaultFormatter ¶
type DefaultFormatter struct {
// contains filtered or unexported fields
}
func (DefaultFormatter) OutNameParts ¶
type DetectedLayout ¶
type DetectedLayout struct {
// contains filtered or unexported fields
}
func NewDetectedLayout ¶
func NewDetectedLayout(parsers Parsers) (d DetectedLayout)
type Directories ¶
type Excel ¶
type Excel struct { File string `json:"file" toml:"file"` Sheet string `json:"sheet" toml:"sheet"` Ignore Ignore `json:"ignore" toml:"ignore"` ColNames ColNames `json:"column_names" toml:"column_names"` // contains filtered or unexported fields }
type ExcelOpener ¶
type ExcelReaderPayload ¶
type ExcelReaderPayload struct {
ExcelOpener
}
func (*ExcelReaderPayload) UnmarshalJSON ¶
func (e *ExcelReaderPayload) UnmarshalJSON(b []byte) (err error)
type ExecutorConfig ¶
type ExecutorConfig struct { Formatter *FormatterConfig `json:"formatter" toml:"formatter" mapstructure:"formatter"` DryRun bool `json:"dry_run" toml:"dry_run" mapstructure:"dry_run"` }
func (ExecutorConfig) SetupExecutor ¶
type ExecutorMode ¶
type ExecutorMode int
ENUM(
DryRun Default
)
const ( // ExecutorModeDryRun is a ExecutorMode of type DryRun. ExecutorModeDryRun ExecutorMode = iota // ExecutorModeDefault is a ExecutorMode of type Default. ExecutorModeDefault )
func ParseExecutorMode ¶
func ParseExecutorMode(name string) (ExecutorMode, error)
ParseExecutorMode attempts to convert a string to a ExecutorMode.
func (ExecutorMode) MarshalText ¶
func (x ExecutorMode) MarshalText() ([]byte, error)
MarshalText implements the text marshaller method.
func (ExecutorMode) String ¶
func (x ExecutorMode) String() string
String implements the Stringer interface.
func (*ExecutorMode) UnmarshalText ¶
func (x *ExecutorMode) UnmarshalText(text []byte) error
UnmarshalText implements the text unmarshaller method.
type Files ¶
type Files file.GroupSetups
type FormatterConfig ¶
type FormatterConfig struct { Template *string `json:"template" toml:"template" mapstructure:"template"` OutStreams []string `json:"out_streams" toml:"out_streams" mapstructure:"out_streams"` Mode FormatterMode `json:"mode" toml:"mode" mapstructure:"mode"` }
func (FormatterConfig) SetupDebug ¶
func (FormatterConfig) SetupFormatter ¶
type FormatterMode ¶
type FormatterMode int
ENUM(
Line Default
)
const ( // FormatterModeLine is a FormatterMode of type Line. FormatterModeLine FormatterMode = iota // FormatterModeDefault is a FormatterMode of type Default. FormatterModeDefault )
func ParseFormatterMode ¶
func ParseFormatterMode(name string) (FormatterMode, error)
ParseFormatterMode attempts to convert a string to a FormatterMode.
func (FormatterMode) MarshalText ¶
func (x FormatterMode) MarshalText() ([]byte, error)
MarshalText implements the text marshaller method.
func (FormatterMode) String ¶
func (x FormatterMode) String() string
String implements the Stringer interface.
func (*FormatterMode) UnmarshalText ¶
func (x *FormatterMode) UnmarshalText(text []byte) error
UnmarshalText implements the text unmarshaller method.
type FuzzSelector ¶
type FzFConfig ¶
type FzFConfig struct { BinName string `json:"bin" toml:"bin" mapstructure:"bin"` Flags []string `json:"flags" toml:"flags" mapstructure:"flags"` }
func (FzFConfig) ToSelector ¶
func (cfg FzFConfig) ToSelector(exec command.Executor) FzfSelector
type FzfSelector ¶
type FzfSelector struct {
// contains filtered or unexported fields
}
func (FzfSelector) FuzzSelect ¶
func (f FzfSelector) FuzzSelect(in []string) (string, error)
type HardcodedSeparate ¶
type HardcodedSeparate struct {
// contains filtered or unexported fields
}
func (HardcodedSeparate) SeparateParts ¶
func (h HardcodedSeparate) SeparateParts(dateStr string) (p Parts, err error)
type HeaderMismatch ¶
type HeaderMismatch struct {
Expected, Got string
}
func (HeaderMismatch) Error ¶
func (h HeaderMismatch) Error() (s string)
type InOutIndices ¶
type KeyContext ¶
type KeyContext struct { Realm string Password string Config PasswordConfig KeyType gokey.KeyType }
func (KeyContext) Get ¶
func (kc KeyContext) Get() (pass string, err error)
type LineFormatter ¶
type LineFormatter struct {
// contains filtered or unexported fields
}
func (LineFormatter) FormatCommand ¶
type LogConfig ¶
type Mode ¶
type Mode int
ENUM(
Config Lua
)
func (Mode) MarshalText ¶
MarshalText implements the text marshaller method.
func (*Mode) UnmarshalText ¶
UnmarshalText implements the text unmarshaller method.
type MultiLoader ¶
type MultiLoader struct {
// contains filtered or unexported fields
}
func (MultiLoader) LoadRaw ¶
func (m MultiLoader) LoadRaw(r io.ReadSeeker) (data RawData, err error)
type Part ¶
type Part int
ENUM(
StringDay StringMonth Day Time Year TimeZone Max
)
const ( // PartStringDay is a Part of type StringDay. PartStringDay Part = iota // PartStringMonth is a Part of type StringMonth. PartStringMonth // PartDay is a Part of type Day. PartDay // PartTime is a Part of type Time. PartTime // PartYear is a Part of type Year. PartYear // PartTimeZone is a Part of type TimeZone. PartTimeZone // PartMax is a Part of type Max. PartMax )
func (Part) MarshalText ¶
MarshalText implements the text marshaller method.
func (*Part) UnmarshalText ¶
UnmarshalText implements the text unmarshaller method.
type PartsSeparator ¶
type PasswordConfig ¶
type PasswordConfig struct { Spec gokey.PasswordSpec `json:"spec" toml:"spec" mapstructure:"spec"` KeyType string `json:"key_type" toml:"key_type" mapstructure:"key_type"` Realms []Realm `json:"realms" toml:"realms" mapstructure:"realms"` }
func (*PasswordConfig) SubCommands ¶
func (pc *PasswordConfig) SubCommands() (sc SubCommands)
func (*PasswordConfig) ToKeyContext ¶
func (pc *PasswordConfig) ToKeyContext(s *adaptors.Sandbox) (kc KeyContext, err error)
type Paths ¶
type Paths struct { Data data.NamedFieldsRef Fields data.InOutFields Indices InOutIndices IRows []int Encoded bool }
func (Paths) GetData ¶
func (p Paths) GetData() (d data.StringData)
func (Paths) NamedFields ¶
func (p Paths) NamedFields() (nf *data.NamedFields)
type Renames ¶
type Renames struct { InFiles []string `json:"infiles"` Dates []string `json:"dates"` OutFiles []string `json:"outfiles"` }
func (*Renames) Deserialize ¶
type ScoreCalculator ¶
type ScoreCalculator struct {
// contains filtered or unexported fields
}
func (*ScoreCalculator) SetCli ¶
func (s *ScoreCalculator) SetCli(c *cli.Cli)
type ScoreCalculatorSetup ¶
type ScoreCalculatorSetup struct {
// contains filtered or unexported fields
}
func (*ScoreCalculatorSetup) Set ¶
func (s *ScoreCalculatorSetup) Set(str string) (err error)
func (ScoreCalculatorSetup) String ¶
func (s ScoreCalculatorSetup) String() (str string)
type SeparateFn ¶
type Setup ¶
type Setup struct { TemplateConfig TemplateConfig `json:"templates" toml:"templates" mapstructure:"templates"` ThirdPartySetup ThirdPartySetup `json:"third_party" toml:"third_party" mapstructure:"third_party"` Bundle BundleConfig `json:"bundle" toml:"bundle" mapstructure:"bundle"` Logging LogConfig `json:"logging" toml:"logging" mapstructure:"logging"` Csv CsvConfig `json:"csv" toml:"csv" mapstructure:"csv"` BatchRenamer BatchRenamer `json:"batch_rename" toml:"batch_rename" mapstructure:"batch_rename"` }
func DecodeSetup ¶
func DecodeSetup(coder payload.MultiCoder, file string) (s Setup, err error)
func (Setup) DoSetup ¶
func (s Setup) DoSetup() (cc CommandsConfig, err error)
type SubCommand ¶
type SubCommandInit ¶
type SubCommandInit interface {
SubCommands(zerolog.Logger) (sc SubCommands, err error)
}
type SubCommandInits ¶
type SubCommandInits map[string]SubCommandInit
type SubCommands ¶
type SubCommands map[string]SubCommand
type TemplateConfig ¶
type TemplateConfig struct { OutDir *string `json:"outdir" toml:"outdir" mapstructure:"outdir"` OutFiles template.Paths `json:"outfiles" toml:"outfiles" mapstructure:"outfiles"` Env template.Values `json:"config" toml:"config" mapstructure:"env"` Imports Imports `json:"imports" toml:"imports" mapstructure:"imports"` Sources path.PatternMap `json:"sources" toml:"sources" mapstructure:"sources"` }
func (*TemplateConfig) SubCommands ¶
func (t *TemplateConfig) SubCommands(log zerolog.Logger) (sc SubCommands, err error)
type ThirdPartySetup ¶
type ThirdPartySetup struct { Deps DepMap `json:"resources" toml:"resources" mapstructure:"deps"` Root *[]string `json:"root_dir" toml:"root_dir" mapstructure:"root"` }
func (ThirdPartySetup) DownloadFiles ¶
func (s ThirdPartySetup) DownloadFiles(sb *adaptors.Sandbox) (err error)
type TimeStampFromOffset ¶
type TimeStampFromOffset struct {
// contains filtered or unexported fields
}
type TimeStampIO ¶
type TimeStampIO struct { Loader geochem.RawLoader Separator PartsSeparator Log zerolog.Logger }
func (TimeStampIO) LoadParts ¶
func (t TimeStampIO) LoadParts(r io.ReadSeeker) (p Parts, err error)
func (TimeStampIO) PartsFromFile ¶
func (t TimeStampIO) PartsFromFile(path string) (p Parts, err error)
type TimeStampParser ¶
type TimeStampParser struct {
// contains filtered or unexported fields
}
func NewTimeStampParser ¶
func NewTimeStampParser(magic string, layout DetectedLayout, l *zerolog.Logger) (t TimeStampParser)
type TimeStampReader ¶
Source Files ¶
- args.go
- args_enum.go
- batch_rename.go
- bundle.go
- commands.go
- config.go
- context.go
- csv.go
- excel_opener.go
- excel_setup.go
- executor.go
- executor_enum.go
- fuzz.go
- lua.go
- lua_limited.go
- mapstructure.go
- pass.go
- read_timestamp.go
- read_timestamp_enum.go
- score_calculator.go
- setup.go
- templates.go
- test.go
- third_party.go