timegrinder

package module
v2.0.2+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2018 License: BSD-2-Clause Imports: 3 Imported by: 12

Documentation

Overview

ANSIC = "Mon Jan _2 15:04:05 2006"

Index

Constants

View Source
const (
	DEFAULT_TIMEGRINDER_SIZE int = 16

	APACHE_FORMAT            string = `_2/Jan/2006:15:04:05 -0700`
	APACHE_NO_TZ_FORMAT      string = `_2/Jan/2006:15:04:05`
	NGINX_FORMAT             string = `2006/01/02 15:04:05`
	SYSLOG_FORMAT            string = `Jan _2 15:04:05`
	SYSLOG_FILE_FORMAT       string = `2006-01-02T15:04:05.999999999-07:00`
	DPKG_MSG_FORMAT          string = `2006-01-02 15:04:05`
	CUSTOM1_MILLI_MSG_FORMAT string = `01-02-2006 15:04:05.0`
	ZONELESS_RFC3339_FORMAT  string = `2006-01-02T15:04:05.999999999`
	SYSLOG_VARIANT           string = `Jan 02 2006 15:04:05`
)

Variables

This section is empty.

Functions

func NewAnsiCProcessor

func NewAnsiCProcessor() *processor

func NewApacheNoTZProcessor

func NewApacheNoTZProcessor() *processor

func NewApacheProcessor

func NewApacheProcessor() *processor

func NewCustom1MilliProcessor

func NewCustom1MilliProcessor() *processor

func NewDPKGProcessor

func NewDPKGProcessor() *processor

func NewNGINXProcessor

func NewNGINXProcessor() *processor

func NewRFC1123Processor

func NewRFC1123Processor() *processor

func NewRFC1123ZProcessor

func NewRFC1123ZProcessor() *processor

func NewRFC3339NanoProcessor

func NewRFC3339NanoProcessor() *processor

func NewRFC3339Processor

func NewRFC3339Processor() *processor

func NewRFC822Processor

func NewRFC822Processor() *processor

func NewRFC822ZProcessor

func NewRFC822ZProcessor() *processor

func NewRFC850Processor

func NewRFC850Processor() *processor

func NewRubyProcessor

func NewRubyProcessor() *processor

func NewSyslogFileProcessor

func NewSyslogFileProcessor() *processor

func NewSyslogProcessor

func NewSyslogProcessor() *syslogProcessor

func NewSyslogVariant

func NewSyslogVariant() *processor

func NewUnixMilliTimeProcessor

func NewUnixMilliTimeProcessor() *unixProcessor

func NewUnixProcessor

func NewUnixProcessor() *processor

func NewZonelessRFC3339

func NewZonelessRFC3339() *processor

Types

type Processor

type Processor interface {
	Extract([]byte, *time.Location) (time.Time, bool)
	Format() string
}

type TimeGrinder

type TimeGrinder struct {
	// contains filtered or unexported fields
}

func NewTimeGrinder

func NewTimeGrinder() (*TimeGrinder, error)

NewTimeGrinder constructs and returns a new TimeGrinder object * On error, it will return a nil and error variable * The TimeGrinder object is completely safe for concurrent use.

func (*TimeGrinder) Extract

func (tg *TimeGrinder) Extract(data []byte) (t time.Time, ok bool, err error)

Extract returns time and error. If no time can be extracted time is the zero

value and bool is false.  Error indicates a catastrophic failure.

func (*TimeGrinder) SetLocalTime

func (tg *TimeGrinder) SetLocalTime()

func (*TimeGrinder) SetUTC

func (tg *TimeGrinder) SetUTC()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL