{"modulePath":"github.com/maginga/example/activity/csvreader","version":"v0.0.0-20220121080038-6f9e92ac2952","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package csvreader\n\n## Variables\n\n```go\nvar (\n\t// ErrAmbiguousMMDD for date formats such as 04/02/2014 the mm/dd vs dd/mm are\n\t// ambiguous, so it is an error for strict parse rules.\n\tErrAmbiguousMMDD = fmt.Errorf(\"This date has ambiguous mm/dd vs dd/mm type format\")\n)\n```\n\n## Functions\n\n```go\nfunc MustParse(datestr string) time.Time\n```\nMustParse  parse a date, and panic if it can't be parsed.  Used for testing. Not recommended for most use-cases.\n\n```go\nfunc New(ctx activity.InitContext) (activity.Activity, error)\n```\nNew create a new kafka activity\n\n```go\nfunc ParseAny(datestr string) (time.Time, error)\n```\nParseAny parse an unknown date format, detect the layout. Normal parse.  Equivalent Timezone rules as time.Parse(). NOTE:  please see readme on mmdd vs ddmm ambiguous dates.\n\n```go\nfunc ParseFormat(datestr string) (string, error)\n```\nParseFormat parse's an unknown date-time string and returns a layout string that can parse this (and exact same format) other date-time strings.\n\n\tlayout, err := dateparse.ParseFormat(\"2013-02-01 00:00:00\")\n\t// layout = \"2006-01-02 15:04:05\"\n\n```go\nfunc ParseIn(datestr string, loc *time.Location) (time.Time, error)\n```\nParseIn with Location, equivalent to time.ParseInLocation() timezone/offset rules.  Using location arg, if timezone/offset info exists in the datestring, it uses the given location rules for any zone interpretation. That is, MST means one thing when using America/Denver and something else in other locations.\n\n```go\nfunc ParseLocal(datestr string) (time.Time, error)\n```\nParseLocal Given an unknown date format, detect the layout, using time.Local, parse.\n\nSet Location to time.Local.  Same as ParseIn Location but lazily uses the global time.Local variable for Location argument.\n\n\tdenverLoc, _ := time.LoadLocation(\"America/Denver\")\n\ttime.Local = denverLoc\n\n\tt, err := dateparse.ParseLocal(\"3/1/2014\")\n\nEquivalent to:\n\n\tt, err := dateparse.ParseIn(\"3/1/2014\", denverLoc)\n\n```go\nfunc ParseStrict(datestr string) (time.Time, error)\n```\nParseStrict parse an unknown date format.  IF the date is ambigous mm/dd vs dd/mm then return an error. These return errors:   3.3.2014 , 8/8/71 etc\n\n## Types\n\n```go\ntype Activity struct {\n\t// contains filtered or unexported fields\n}\n```\nActivity define activity object\n\n```go\nfunc (a *Activity) Eval(ctx activity.Context) (done bool, err error)\n```\nEval evaluate\n\n```go\nfunc (a *Activity) Metadata() *activity.Metadata\n```\nMetadata returns the activity's metadata\n\n```go\ntype Input struct {\n\tFileName   string `md:\"fileName\"` //\n\tAssetName  string `md:\"assetName\"`\n\tSensorName string `md:\"sensorName\"`\n\tSensorType string `md:\"sensorType\"`\n}\n```\nInput input\n\n```go\nfunc (i *Input) FromMap(values map[string]interface{}) error\n```\n\n```go\nfunc (i *Input) ToMap() map[string]interface{}\n```\n\n```go\ntype Output struct {\n\tMessage interface{} `md:\"message\"` // The data that sent kafka\n}\n```\n\n```go\nfunc (o *Output) FromMap(values map[string]interface{}) error\n```\n\n```go\nfunc (o *Output) ToMap() map[string]interface{}\n```\n\n```go\ntype Settings struct {\n\tTimeColumnIndex string `md:\"timeColumnIndex\"` // The time column in CSV file.\n\tTimeZone        string `md:\"timeZone\"`\n\tExcludeColumns  string `md:\"excludeColumns\"` // Columns to be exclude.\n}\n```\nSettings setting struct\n\n","path":"github.com/maginga/example/activity/csvreader","name":"csvreader","synopsis":"","isRedistributable":true}
