Documentation
¶
Index ¶
- Constants
- func Die(format string, err error) int
- func Main(output io.Writer) int
- type Config
- type TPdatetime
- type TPduration
- type TimestampProccessor
- func (tp *TimestampProccessor) CalcDiff(tsA time.Time, tsB time.Time)
- func (tp *TimestampProccessor) CalcDuration(tsA time.Time, durB time.Duration)
- func (tp *TimestampProccessor) DualTimestamps(timestampA, timestampB string) error
- func (tp *TimestampProccessor) Parse(timestamp string) (time.Time, error)
- func (tp *TimestampProccessor) ParseTimestamp(timestamp string) (time.Time, error)
- func (tp *TimestampProccessor) Print(ts TimestampWriter)
- func (tp *TimestampProccessor) ProcessTimestamps() error
- func (tp *TimestampProccessor) SingleTimestamp(timestamp string) error
- type TimestampWriter
Constants ¶
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// TODO: add Timezone parameter
Showversion bool `koanf:"version"`
Debug bool `koanf:"debug"`
Diff bool `koanf:"diff"`
Add bool `koanf:"add"`
Examples bool `koanf:"examples"`
Unit bool `koanf:"unit"`
Format string `koanf:"format"`
Args []string
Output io.Writer
Mode int
// contains filtered or unexported fields
}
type TPdatetime ¶ added in v0.0.2
type TPdatetime struct {
TimestampProccessor
Data time.Time
}
func (TPdatetime) String ¶ added in v0.0.2
func (datetime TPdatetime) String() string
type TPduration ¶ added in v0.0.2
type TPduration struct {
TimestampProccessor
Data time.Duration
}
func (TPduration) String ¶ added in v0.0.2
func (duration TPduration) String() string
type TimestampProccessor ¶
func (*TimestampProccessor) CalcDiff ¶ added in v0.0.3
func (tp *TimestampProccessor) CalcDiff(tsA time.Time, tsB time.Time)
func (*TimestampProccessor) CalcDuration ¶ added in v0.0.2
func (tp *TimestampProccessor) CalcDuration(tsA time.Time, durB time.Duration)
func (*TimestampProccessor) DualTimestamps ¶ added in v0.0.3
func (tp *TimestampProccessor) DualTimestamps(timestampA, timestampB string) error
func (*TimestampProccessor) Parse ¶
func (tp *TimestampProccessor) Parse(timestamp string) (time.Time, error)
a post processor for ParseTimestamp() to apply custom time zone, if any
func (*TimestampProccessor) ParseTimestamp ¶ added in v0.0.3
func (tp *TimestampProccessor) ParseTimestamp(timestamp string) (time.Time, error)
Parse uses 3 different timestamp parser modules to provide maximum flexibility
func (*TimestampProccessor) Print ¶
func (tp *TimestampProccessor) Print(ts TimestampWriter)
func (*TimestampProccessor) ProcessTimestamps ¶
func (tp *TimestampProccessor) ProcessTimestamps() error
func (*TimestampProccessor) SingleTimestamp ¶
func (tp *TimestampProccessor) SingleTimestamp(timestamp string) error
type TimestampWriter ¶ added in v0.0.2
type TimestampWriter interface {
String() string
}
Click to show internal directories.
Click to hide internal directories.