domain

package
v0.0.0-...-2326599 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterAlwaysFalse

func FilterAlwaysFalse(r *Request) bool

func FilterAlwaysTrue

func FilterAlwaysTrue(r *Request) bool

func FilterIsAssets

func FilterIsAssets(r *Request) bool

func FilterIsBot

func FilterIsBot(r *Request) bool

func FilterIsGoogleBot

func FilterIsGoogleBot(r *Request) bool

IsGoogleBot is an qualifier that determines if the request is from GoogleBot.

func FilterIsPage

func FilterIsPage(r *Request) bool

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

type FilterFunc func(*Request) bool

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.

func IsSlow

func IsSlow(threshold float64) Insight

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

func IsSlowRequest(threshold float64) Qualifier

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

func LoadJournal(site, journalType, date string) ([]*Request, error)

LoadJournal loads the journal json file

func Paginate

func Paginate(requests []*Request, page int) ([]*Request, int)

Paginate returns a slice of requests and the next page number

func ParseLines

func ParseLines(lines []*cloudfront.Line, qualifiers ...Qualifier) ([]*Request, error)

Jump to

Keyboard shortcuts

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