Documentation ¶
Index ¶
- Constants
- func NewTransactionParser(r io.Reader) *transactionParser
- type AcctRecord
- type BackendCloseRecord
- type BackendOpenRecord
- func (r BackendOpenRecord) FileDescriptor() int
- func (r BackendOpenRecord) LocalAddr() net.IP
- func (r BackendOpenRecord) LocalPort() int
- func (r BackendOpenRecord) Name() string
- func (r BackendOpenRecord) Reason() string
- func (r BackendOpenRecord) RemoteAddr() net.IP
- func (r BackendOpenRecord) RemotePort() int
- type BaseRecord
- type BeginRecord
- type BereqHeaderRecord
- type BereqUnsetRecord
- type BerespHeaderRecord
- type BerespUnsetRecord
- type EndRecord
- type FetchBodyRecord
- type FetchErrorRecord
- type FiltersRecord
- type HeaderRecord
- type HitRecord
- type LengthRecord
- type LinkRecord
- type MethodRecord
- type ObjHeaderRecord
- type ObjUnsetRecord
- type ProtocolRecord
- type ReasonRecord
- type Record
- type ReqHeaderRecord
- type ReqStartRecord
- type ReqUnsetRecord
- type RespHeaderRecord
- type RespUnsetRecord
- type SessCloseRecord
- type SessOpenRecord
- func (r SessOpenRecord) FileDescriptor() int
- func (r SessOpenRecord) LocalAddr() net.IP
- func (r SessOpenRecord) LocalPort() int
- func (r SessOpenRecord) RemoteAddr() net.IP
- func (r SessOpenRecord) RemotePort() int
- func (r SessOpenRecord) SessionStart() time.Time
- func (r SessOpenRecord) SocketName() string
- type SizeValue
- type StatusRecord
- type StorageRecord
- type TTLRecord
- func (r TTLRecord) Age() time.Time
- func (r TTLRecord) CacheStatus() string
- func (r TTLRecord) Date() time.Time
- func (r TTLRecord) Expires() time.Time
- func (r TTLRecord) Grace() time.Duration
- func (r TTLRecord) Keep() time.Duration
- func (r TTLRecord) MaxAge() time.Duration
- func (r TTLRecord) Reference() time.Time
- func (r TTLRecord) Source() string
- func (r TTLRecord) String() string
- func (r TTLRecord) TTL() time.Duration
- type TimestampRecord
- type Transaction
- func (t *Transaction) Children() map[string]*Transaction
- func (t *Transaction) ChildrenSortedByVXID() []*Transaction
- func (t *Transaction) ESILevel() int
- func (t *Transaction) FirstRecordOfTag(tag string) Record
- func (t *Transaction) FirstRecordOfType(target interface{}) Record
- func (t *Transaction) FullRawLog(withChildren bool) string
- func (t *Transaction) LastRecordOfTag(tag string) Record
- func (t *Transaction) LastRecordOfType(target interface{}) Record
- func (t *Transaction) Level() int
- func (t *Transaction) LogRecords() []Record
- func (t *Transaction) Parent() *Transaction
- func (t *Transaction) RawLog() string
- func (t *Transaction) RootParent() *Transaction
- func (t *Transaction) TXID() string
- func (t *Transaction) Type() string
- func (t *Transaction) VXID() VXID
- type TransactionSet
- type URLRecord
- type VCLCallRecord
- type VCLLogRecord
- type VCLReturnRecord
- type VCLUseRecord
- type VXID
Constants ¶
const ( LinkTypeSession = "sess" LinkTypeRequest = "req" LinkTypeBereq = "bereq" )
const ( TxTypeSession = "Session" TxTypeRequest = "Request" TxTypeBereq = "BeReq" )
const (
SizeMB = sizeKB * 1024
)
Variables ¶
This section is empty.
Functions ¶
func NewTransactionParser ¶
Types ¶
type AcctRecord ¶
type AcctRecord struct { BaseRecord // contains filtered or unexported fields }
AcctRecord holds accounting information for ReqAcct and BereqAcct tags
func NewAcctRecord ¶
func NewAcctRecord(blr BaseRecord) (AcctRecord, error)
func (AcctRecord) BodyRx ¶
func (r AcctRecord) BodyRx() SizeValue
func (AcctRecord) BodyTx ¶
func (r AcctRecord) BodyTx() SizeValue
func (AcctRecord) HeaderRx ¶
func (r AcctRecord) HeaderRx() SizeValue
func (AcctRecord) HeaderTx ¶
func (r AcctRecord) HeaderTx() SizeValue
func (AcctRecord) String ¶
func (r AcctRecord) String() string
func (AcctRecord) TotalRx ¶
func (r AcctRecord) TotalRx() SizeValue
func (AcctRecord) TotalTx ¶
func (r AcctRecord) TotalTx() SizeValue
type BackendCloseRecord ¶
type BackendCloseRecord struct { BaseRecord // contains filtered or unexported fields }
BackendCloseRecord holds information about a backend connection close
func NewBackendCloseRecord ¶
func NewBackendCloseRecord(blr BaseRecord) (BackendCloseRecord, error)
func (BackendCloseRecord) FileDescriptor ¶
func (r BackendCloseRecord) FileDescriptor() int
func (BackendCloseRecord) Name ¶
func (r BackendCloseRecord) Name() string
func (BackendCloseRecord) Reason ¶
func (r BackendCloseRecord) Reason() string
type BackendOpenRecord ¶
type BackendOpenRecord struct { BaseRecord // contains filtered or unexported fields }
BackendOpenRecord holds information about a new backend connection
func NewBackendOpenRecord ¶
func NewBackendOpenRecord(blr BaseRecord) (BackendOpenRecord, error)
func (BackendOpenRecord) FileDescriptor ¶
func (r BackendOpenRecord) FileDescriptor() int
func (BackendOpenRecord) LocalAddr ¶
func (r BackendOpenRecord) LocalAddr() net.IP
func (BackendOpenRecord) LocalPort ¶
func (r BackendOpenRecord) LocalPort() int
func (BackendOpenRecord) Name ¶
func (r BackendOpenRecord) Name() string
func (BackendOpenRecord) Reason ¶
func (r BackendOpenRecord) Reason() string
func (BackendOpenRecord) RemoteAddr ¶
func (r BackendOpenRecord) RemoteAddr() net.IP
func (BackendOpenRecord) RemotePort ¶
func (r BackendOpenRecord) RemotePort() int
type BaseRecord ¶
type BaseRecord struct {
// contains filtered or unexported fields
}
BaseRecord is a single VSL log line split by tag and value
func NewBaseRecord ¶
func NewBaseRecord(rawLog string) (BaseRecord, error)
func (BaseRecord) RawLog ¶
func (r BaseRecord) RawLog() string
func (BaseRecord) Tag ¶
func (r BaseRecord) Tag() string
func (BaseRecord) Value ¶
func (r BaseRecord) Value() string
type BeginRecord ¶
type BeginRecord struct { BaseRecord // contains filtered or unexported fields }
BeginRecord represents the start of a transaction log
func NewBeginRecord ¶
func NewBeginRecord(blr BaseRecord) (BeginRecord, error)
func (BeginRecord) ESILevel ¶
func (r BeginRecord) ESILevel() int
func (BeginRecord) ParentVXID ¶
func (r BeginRecord) ParentVXID() VXID
func (BeginRecord) ReasonOrProtocol ¶
func (r BeginRecord) ReasonOrProtocol() string
func (BeginRecord) Type ¶
func (r BeginRecord) Type() string
type BereqHeaderRecord ¶
type BereqHeaderRecord struct {
// contains filtered or unexported fields
}
BereqHeaderRecord holds headers for the vsl tag BereqHeader
func NewBereqHeaderRecord ¶
func NewBereqHeaderRecord(blr BaseRecord) (BereqHeaderRecord, error)
func (BereqHeaderRecord) HeaderValue ¶
func (r BereqHeaderRecord) HeaderValue() string
type BereqUnsetRecord ¶
type BereqUnsetRecord struct {
// contains filtered or unexported fields
}
BereqUnsetRecord holds a header name and value that is unset in VCL
func NewBereqUnsetRecord ¶
func NewBereqUnsetRecord(blr BaseRecord) (BereqUnsetRecord, error)
func (BereqUnsetRecord) HeaderValue ¶
func (r BereqUnsetRecord) HeaderValue() string
type BerespHeaderRecord ¶
type BerespHeaderRecord struct {
// contains filtered or unexported fields
}
BerespHeaderRecord holds headers for the vsl tag BerespHeader
func NewBerespHeaderRecord ¶
func NewBerespHeaderRecord(blr BaseRecord) (BerespHeaderRecord, error)
func (BerespHeaderRecord) HeaderValue ¶
func (r BerespHeaderRecord) HeaderValue() string
type BerespUnsetRecord ¶
type BerespUnsetRecord struct {
// contains filtered or unexported fields
}
BerespUnsetRecord holds a header name and value that is unset in VCL
func NewBerespUnsetRecord ¶
func NewBerespUnsetRecord(blr BaseRecord) (BerespUnsetRecord, error)
func (BerespUnsetRecord) HeaderValue ¶
func (r BerespUnsetRecord) HeaderValue() string
type FetchBodyRecord ¶
type FetchBodyRecord struct { BaseRecord // contains filtered or unexported fields }
FetchBodyRecord holds information about the mode to fetch the object from the backend
func NewFetchBodyRecord ¶
func NewFetchBodyRecord(blr BaseRecord) (FetchBodyRecord, error)
func (FetchBodyRecord) Description ¶
func (r FetchBodyRecord) Description() string
func (FetchBodyRecord) IsStream ¶
func (r FetchBodyRecord) IsStream() bool
func (FetchBodyRecord) Mode ¶
func (r FetchBodyRecord) Mode() int
type FetchErrorRecord ¶
type FetchErrorRecord struct{ BaseRecord }
FetchErrorRecord holds the error msg of an error while fetching the object from the backend
type FiltersRecord ¶
type FiltersRecord struct { BaseRecord // contains filtered or unexported fields }
FiltersRecord holds the list of filters applied to the body
func NewFiltersRecord ¶
func NewFiltersRecord(blr BaseRecord) (FiltersRecord, error)
func (FiltersRecord) Filters ¶
func (r FiltersRecord) Filters() []string
type HeaderRecord ¶
HeaderRecord interface
type HitRecord ¶
type HitRecord struct { BaseRecord // contains filtered or unexported fields }
HitRecord contains information about a hit of an object in the cache
func NewHitRecord ¶
func NewHitRecord(blr BaseRecord) (HitRecord, error)
type LengthRecord ¶
type LengthRecord struct { BaseRecord // contains filtered or unexported fields }
LengthRecord represents the size of a fetch body
func NewLengthRecord ¶
func NewLengthRecord(blr BaseRecord) (LengthRecord, error)
func (LengthRecord) Size ¶
func (r LengthRecord) Size() SizeValue
type LinkRecord ¶
type LinkRecord struct { BaseRecord // contains filtered or unexported fields }
LinkRecord Links to a child transaction
func NewLinkRecord ¶
func NewLinkRecord(blr BaseRecord) (LinkRecord, error)
func (LinkRecord) ESILevel ¶
func (r LinkRecord) ESILevel() int
func (LinkRecord) Reason ¶
func (r LinkRecord) Reason() string
func (LinkRecord) TXID ¶
func (r LinkRecord) TXID() string
func (LinkRecord) Type ¶
func (r LinkRecord) Type() string
func (LinkRecord) VXID ¶
func (r LinkRecord) VXID() VXID
type MethodRecord ¶
type MethodRecord struct{ BaseRecord }
MethodRecord holds the method for ReqMethod or BereqMethod tags
type ObjHeaderRecord ¶
type ObjHeaderRecord struct {
// contains filtered or unexported fields
}
ObjHeaderRecord holds headers for the vsl tag ObjHeader
func NewObjHeaderRecord ¶
func NewObjHeaderRecord(blr BaseRecord) (ObjHeaderRecord, error)
func (ObjHeaderRecord) HeaderValue ¶
func (r ObjHeaderRecord) HeaderValue() string
type ObjUnsetRecord ¶
type ObjUnsetRecord struct {
// contains filtered or unexported fields
}
ObjUnsetRecord holds a header name and value that is unset in VCL
func NewObjUnsetRecord ¶
func NewObjUnsetRecord(blr BaseRecord) (ObjUnsetRecord, error)
func (ObjUnsetRecord) HeaderValue ¶
func (r ObjUnsetRecord) HeaderValue() string
type ProtocolRecord ¶
type ProtocolRecord struct{ BaseRecord }
ProtocolRecord holds the protocol for the ReqProtocol, RespProtocol, BereqProtocol, ... tags
type ReqHeaderRecord ¶
type ReqHeaderRecord struct {
// contains filtered or unexported fields
}
ReqHeaderRecord holds headers for the vsl tag ReqHeader
func NewReqHeaderRecord ¶
func NewReqHeaderRecord(blr BaseRecord) (ReqHeaderRecord, error)
func (ReqHeaderRecord) HeaderValue ¶
func (r ReqHeaderRecord) HeaderValue() string
type ReqStartRecord ¶
type ReqStartRecord struct { BaseRecord // contains filtered or unexported fields }
ReqStartRecord holds information about the start of request processing
func NewReqStartRecord ¶
func NewReqStartRecord(blr BaseRecord) (ReqStartRecord, error)
func (ReqStartRecord) ClientIP ¶
func (r ReqStartRecord) ClientIP() net.IP
func (ReqStartRecord) ClientPort ¶
func (r ReqStartRecord) ClientPort() int
func (ReqStartRecord) Listener ¶
func (r ReqStartRecord) Listener() string
type ReqUnsetRecord ¶
type ReqUnsetRecord struct {
// contains filtered or unexported fields
}
ReqUnsetRecord holds a header name and value that is unset in VCL
func NewReqUnsetRecord ¶
func NewReqUnsetRecord(blr BaseRecord) (ReqUnsetRecord, error)
func (ReqUnsetRecord) HeaderValue ¶
func (r ReqUnsetRecord) HeaderValue() string
type RespHeaderRecord ¶
type RespHeaderRecord struct {
// contains filtered or unexported fields
}
RespHeaderRecord holds headers for the vsl tag RespHeader
func NewRespHeaderRecord ¶
func NewRespHeaderRecord(blr BaseRecord) (RespHeaderRecord, error)
func (RespHeaderRecord) HeaderValue ¶
func (r RespHeaderRecord) HeaderValue() string
type RespUnsetRecord ¶
type RespUnsetRecord struct {
// contains filtered or unexported fields
}
RespUnsetRecord holds a header name and value that is unset in VCL
func NewRespUnsetRecord ¶
func NewRespUnsetRecord(blr BaseRecord) (RespUnsetRecord, error)
func (RespUnsetRecord) HeaderValue ¶
func (r RespUnsetRecord) HeaderValue() string
type SessCloseRecord ¶
type SessCloseRecord struct { BaseRecord // contains filtered or unexported fields }
SessCloseRecord is the last record for any client connection
func NewSessCloseRecord ¶
func NewSessCloseRecord(blr BaseRecord) (SessCloseRecord, error)
func (SessCloseRecord) Duration ¶
func (r SessCloseRecord) Duration() time.Duration
func (SessCloseRecord) Reason ¶
func (r SessCloseRecord) Reason() string
type SessOpenRecord ¶
type SessOpenRecord struct { BaseRecord // contains filtered or unexported fields }
SessOpenRecord is the first record for a client connection with the socket-endpoints of the connection
func NewSessOpenRecord ¶
func NewSessOpenRecord(blr BaseRecord) (SessOpenRecord, error)
func (SessOpenRecord) FileDescriptor ¶
func (r SessOpenRecord) FileDescriptor() int
func (SessOpenRecord) LocalAddr ¶
func (r SessOpenRecord) LocalAddr() net.IP
func (SessOpenRecord) LocalPort ¶
func (r SessOpenRecord) LocalPort() int
func (SessOpenRecord) RemoteAddr ¶
func (r SessOpenRecord) RemoteAddr() net.IP
func (SessOpenRecord) RemotePort ¶
func (r SessOpenRecord) RemotePort() int
func (SessOpenRecord) SessionStart ¶
func (r SessOpenRecord) SessionStart() time.Time
func (SessOpenRecord) SocketName ¶
func (r SessOpenRecord) SocketName() string
type SizeValue ¶
type SizeValue int64
SizeValue is a custom type based on int64 to handle sizes.
type StatusRecord ¶
type StatusRecord struct { BaseRecord // contains filtered or unexported fields }
StatusRecord represents an HTTP code response status
func NewStatusRecord ¶
func NewStatusRecord(blr BaseRecord) (StatusRecord, error)
func (StatusRecord) Status ¶
func (r StatusRecord) Status() int
type StorageRecord ¶
type StorageRecord struct { BaseRecord // contains filtered or unexported fields }
StorageRecord holds the type and name of the storage backend the object is stored in
func NewStorageRecord ¶
func NewStorageRecord(blr BaseRecord) (StorageRecord, error)
func (StorageRecord) Name ¶
func (r StorageRecord) Name() string
func (StorageRecord) Type ¶
func (r StorageRecord) Type() string
type TTLRecord ¶
type TTLRecord struct { BaseRecord // contains filtered or unexported fields }
TTLRecord reprensets the ttl, grace, keep values for an object
func NewTTLRecord ¶
func NewTTLRecord(blr BaseRecord) (TTLRecord, error)
func (TTLRecord) CacheStatus ¶
type TimestampRecord ¶
type TimestampRecord struct { BaseRecord // contains filtered or unexported fields }
func NewTimestampRecord ¶
func NewTimestampRecord(blr BaseRecord) (TimestampRecord, error)
func (TimestampRecord) AbsoluteTime ¶
func (r TimestampRecord) AbsoluteTime() time.Time
func (TimestampRecord) EventLabel ¶
func (r TimestampRecord) EventLabel() string
func (TimestampRecord) SinceLast ¶
func (r TimestampRecord) SinceLast() time.Duration
func (TimestampRecord) SinceStart ¶
func (r TimestampRecord) SinceStart() time.Duration
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
Transaction represent a singular Varnish transaction log
func NewMissingTransaction ¶ added in v0.1.3
func NewMissingTransaction(r LinkRecord) *Transaction
NewMissingTransaction initializes a transaction that is missing in the VSL logs from a Link tag record
func NewTransaction ¶
func NewTransaction(line string) (*Transaction, error)
NewTransaction initializes a new transaction by parsing the first line of the log
func (*Transaction) Children ¶
func (t *Transaction) Children() map[string]*Transaction
func (*Transaction) ChildrenSortedByVXID ¶
func (t *Transaction) ChildrenSortedByVXID() []*Transaction
ChildrenSortedByVXID returns a slice with all the children sorted by VXID
func (*Transaction) ESILevel ¶
func (t *Transaction) ESILevel() int
func (*Transaction) FirstRecordOfTag ¶
func (t *Transaction) FirstRecordOfTag(tag string) Record
FirstRecordOfTag returns the first record for the given tag
func (*Transaction) FirstRecordOfType ¶
func (t *Transaction) FirstRecordOfType(target interface{}) Record
FirstRecordOfType returns the first record for the given type
func (*Transaction) FullRawLog ¶ added in v0.1.7
func (t *Transaction) FullRawLog(withChildren bool) string
FullRawLog returns the complete VSL log from this transaction if withChildren is true it also includes the log from all its children recursively
func (*Transaction) LastRecordOfTag ¶
func (t *Transaction) LastRecordOfTag(tag string) Record
LastRecordOfTag returns the last record for the given tag
func (*Transaction) LastRecordOfType ¶
func (t *Transaction) LastRecordOfType(target interface{}) Record
LastRecordOfType returns the last record for the given type
func (*Transaction) Level ¶
func (t *Transaction) Level() int
func (*Transaction) LogRecords ¶
func (t *Transaction) LogRecords() []Record
func (*Transaction) Parent ¶
func (t *Transaction) Parent() *Transaction
func (*Transaction) RawLog ¶
func (t *Transaction) RawLog() string
func (*Transaction) RootParent ¶
func (t *Transaction) RootParent() *Transaction
RootParent returns the root transaction which has no parent
func (*Transaction) TXID ¶
func (t *Transaction) TXID() string
func (*Transaction) Type ¶
func (t *Transaction) Type() string
func (*Transaction) VXID ¶
func (t *Transaction) VXID() VXID
type TransactionSet ¶
type TransactionSet struct {
// contains filtered or unexported fields
}
TransactionSet groups multiple Varnish transaction logs together
func (TransactionSet) GroupRelatedTransactions ¶
func (t TransactionSet) GroupRelatedTransactions() [][]*Transaction
func (TransactionSet) RawLog ¶
func (t TransactionSet) RawLog() string
RawLog returns the complete VSL raw log from all the transactions
func (TransactionSet) Transactions ¶
func (t TransactionSet) Transactions() []*Transaction
func (TransactionSet) TransactionsMap ¶
func (t TransactionSet) TransactionsMap() map[string]*Transaction
func (TransactionSet) UniqueRootParents ¶
func (t TransactionSet) UniqueRootParents() []*Transaction
UniqueRootParents iterates over an array of transactions and returns an array with only the parent transactions.
type URLRecord ¶
type URLRecord struct { BaseRecord // contains filtered or unexported fields }
URLRecord holds request URL from ReqURL and BereqURL tags
func NewURLRecord ¶
func NewURLRecord(blr BaseRecord) (URLRecord, error)
type VCLCallRecord ¶
type VCLCallRecord struct{ BaseRecord }
VCLCallRecord is the VCL method called (RECV, DELIVER, BACKEND_FETCH, ...)
type VCLLogRecord ¶
type VCLLogRecord struct { BaseRecord // contains filtered or unexported fields }
VCLLogRecord holds vsl tag VCL_Log key is empty if the log value is not formatted as 'key: value'
func NewVCLLogRecord ¶
func NewVCLLogRecord(blr BaseRecord) (VCLLogRecord, error)
func (VCLLogRecord) Key ¶
func (r VCLLogRecord) Key() string
func (VCLLogRecord) Value ¶
func (r VCLLogRecord) Value() string
type VCLReturnRecord ¶
type VCLReturnRecord struct{ BaseRecord }
VCLReturnRecord is the VCL method return value (hash, lookup, fetch, deliver, ...)