Documentation ¶
Index ¶
- Variables
- func DefaultTimeInYear(year int, tz *time.Location) time.Time
- func Register(name string, format TimeFormat)
- type DefaultTimeFormat
- func (DefaultTimeFormat) Convert(h RawTime) (Time, error)
- func (DefaultTimeFormat) ConvertWithConverter(converter *TimeConverter, t Time) time.Time
- func (DefaultTimeFormat) ConvertWithYear(t Time, year int, tz *time.Location) time.Time
- func (DefaultTimeFormat) ExtractRaw(logLine string) (RawTime, string, int, error)
- type RFC3339TimeFormat
- func (RFC3339TimeFormat) Convert(h RawTime) (Time, error)
- func (RFC3339TimeFormat) ConvertWithConverter(converter *TimeConverter, t Time) time.Time
- func (RFC3339TimeFormat) ConvertWithYear(t Time, _ int, tz *time.Location) time.Time
- func (RFC3339TimeFormat) ExtractRaw(logLine string) (RawTime, string, int, error)
- type RawTime
- type Time
- type TimeConverter
- type TimeFormat
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidFormat = errors.New(`Invalid Format`)
View Source
var ErrInvalidTimeFormat = errors.New(`Invalid time format`)
View Source
var Formats = map[string]TimeFormat{}
Functions ¶
func Register ¶
func Register(name string, format TimeFormat)
Types ¶
type DefaultTimeFormat ¶
type DefaultTimeFormat struct{}
func (DefaultTimeFormat) ConvertWithConverter ¶
func (DefaultTimeFormat) ConvertWithConverter(converter *TimeConverter, t Time) time.Time
func (DefaultTimeFormat) ConvertWithYear ¶
func (DefaultTimeFormat) ExtractRaw ¶
type RFC3339TimeFormat ¶
type RFC3339TimeFormat struct{}
func (RFC3339TimeFormat) ConvertWithConverter ¶
func (RFC3339TimeFormat) ConvertWithConverter(converter *TimeConverter, t Time) time.Time
func (RFC3339TimeFormat) ConvertWithYear ¶
func (RFC3339TimeFormat) ExtractRaw ¶
type TimeConverter ¶
type TimeConverter struct {
// contains filtered or unexported fields
}
func NewTimeConverter ¶
type TimeFormat ¶
type TimeFormat interface { ExtractRaw(string) (h RawTime, remaining string, patternLen int, err error) Convert(RawTime) (Time, error) ConvertWithYear(Time, int, *time.Location) time.Time ConvertWithConverter(*TimeConverter, Time) time.Time }
func Get ¶
func Get(name string) (TimeFormat, error)
Click to show internal directories.
Click to hide internal directories.