Documentation ¶
Overview ¶
Package csvtoprotoparse contains runtime functionality needed by code generated by the go/csv-to-proto tool.
These functions are not intended to be used outside of generated code "unless you know what you're doing."
Index ¶
- func DurationToDurationProto(d time.Duration) (*dpb.Duration, error)
- func MustLoadLocation(name string) *time.Location
- func ParseDouble(rawValue string) (float64, error)
- func ParseDuration(rawValue, unit string) (*dpb.Duration, error)
- func ParseFloat(rawValue string) (float32, error)
- func ParseInt32(rawValue string) (int32, error)
- func ParseInt64(rawValue string) (int64, error)
- func ParseString(rawValue string) (string, error)
- func ParseTimestamp(rawValue, layout string, timezone string) (*ts.Timestamp, error)
- func TimeToTimestamp(t time.Time) (*ts.Timestamp, error)
- type ReaderOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DurationToDurationProto ¶ added in v0.0.7
DurationToDurationProto returns a Duration proto from a time.Duration value that may be nil.
func MustLoadLocation ¶ added in v0.0.6
MustLoadLocation returns a time.Location or panics.
func ParseDouble ¶
ParseDouble returns a double from a CSV field.
func ParseDuration ¶ added in v0.0.7
ParseDuration returns a proto version of a duration, using an option unit suffix.
func ParseFloat ¶
ParseFloat returns a float from a CSV field.
func ParseInt32 ¶
ParseInt32 returns an int32 parsed from a CSV field.
func ParseInt64 ¶
ParseInt64 returns an int64 from a CSV field.
func ParseString ¶
ParseString parses a string value from a CSV field.
This function has a strange signature for the convenience of the generated code. It always returns its first argument and never returns an error.
func ParseTimestamp ¶
ParseTimestamp returns a proto version of a timestamp using a given layout.
Types ¶
type ReaderOption ¶
type ReaderOption interface{}
ReaderOption is used to specify a custom argument to csvtoproto readers at construction time.