Documentation
¶
Index ¶
- func FilterAlwaysFalse(r *Request) bool
- func FilterAlwaysTrue(r *Request) bool
- func FilterIsAssets(r *Request) bool
- func FilterIsBot(r *Request) bool
- func FilterIsGoogleBot(r *Request) bool
- func FilterIsPage(r *Request) bool
- func IsBot(r *Request)
- func IsBotRequest(r *Request)
- func IsCacheHit(r *Request)
- func IsCacheHitRequest(r *Request)
- func IsMedia(r *Request)
- func IsMediaRequest(r *Request)
- type FilterFunc
- type FilteredRequests
- type Insight
- type Properties
- type Qualifier
- type Request
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterAlwaysFalse ¶
func FilterAlwaysTrue ¶
func FilterIsAssets ¶
func FilterIsBot ¶
func FilterIsGoogleBot ¶
IsGoogleBot is an qualifier that determines if the request is from GoogleBot.
func FilterIsPage ¶
func IsBot ¶
func IsBot(r *Request)
IsBot is an insight that determines if the request is from a bot.
func IsBotRequest ¶
func IsBotRequest(r *Request)
IsBot is an qualifier that determines if the request is from a bot.
func IsCacheHit ¶
func IsCacheHit(r *Request)
func IsCacheHitRequest ¶
func IsCacheHitRequest(r *Request)
IsCacheHit is an qualifier that determines if the request is a cache hit.
func IsMedia ¶
func IsMedia(r *Request)
IsMedia is an insight that determines if the request is for a media file.
func IsMediaRequest ¶
func IsMediaRequest(r *Request)
IsMedia is an qualifier that determines if the request is for a media file.
Types ¶
type FilterFunc ¶
Qualifier is a function that filter on properties of a request.
type FilteredRequests ¶
type FilteredRequests struct { Requests []*Request Filename string // contains filtered or unexported fields }
func NewFilteredRequests ¶
func NewFilteredRequests(filename string, filters ...FilterFunc) *FilteredRequests
func (*FilteredRequests) Append ¶
func (f *FilteredRequests) Append(r *Request)
type Insight ¶
type Insight func(*Request)
Insight is a function that filter on properties of a request.
type Properties ¶
type Properties map[string]interface{}
type Qualifier ¶
type Qualifier func(*Request)
Qualifier is a function that filter on properties of a request.
func IsSlowRequest ¶
type Request ¶
type Request struct { Datetime string `json:"datetime"` Date string `json:"date"` Time string `json:"time"` IP string `json:"ip"` Protocol string `json:"protocol"` UserAgent string `json:"user_agent"` HostHeader string `json:"host_header"` Method string `json:"method"` Status string `json:"status"` Cache string `json:"cache"` URI string `json:"uri"` Referer string `json:"referer"` ContentType string `json:"content_type"` TTFB string `json:"ttfb"` EdgeDefaultResultType string `json:"-"` IsCacheHit bool `json:"is_cache_hit"` IsPage bool `json:"is_page"` IsMedia bool `json:"is_media"` IsBot bool `json:"is_bot"` IsGoogleBot bool `json:"is_google_bot"` IsSlow bool `json:"is_slow"` Properties Properties `json:"-"` }
func LoadJournal ¶
LoadJournal loads the journal json file
func ParseLines ¶
func ParseLines(lines []*cloudfront.Line, qualifiers ...Qualifier) ([]*Request, error)