widgets

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: EUPL-1.2, ISC, MIT, + 1 more Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllTotals

type AllTotals struct {
	AllTotalUniqueUTC int
	// contains filtered or unexported fields
}

func (AllTotals) Clone

func (w AllTotals) Clone() Widget

func (*AllTotals) GetData

func (w *AllTotals) GetData(ctx context.Context, a Args) (err error)

func (AllTotals) HTML

func (w AllTotals) HTML() template.HTML

func (AllTotals) Name

func (w AllTotals) Name() string

func (*AllTotals) SetHTML

func (w *AllTotals) SetHTML(h template.HTML)

func (AllTotals) TemplateData

func (w AllTotals) TemplateData(ctx context.Context, shared SharedData) (string, interface{})

func (AllTotals) Type

func (w AllTotals) Type() string

type Args

type Args struct {
	Start, End  time.Time
	Filter      string
	Daily       bool
	ForcedDaily bool
	ShowRefs    string
	AsText      bool
}

type Browsers

type Browsers struct {
	Browsers goatcounter.Stats
	// contains filtered or unexported fields
}

func (Browsers) Clone

func (w Browsers) Clone() Widget

func (*Browsers) GetData

func (w *Browsers) GetData(ctx context.Context, a Args) (err error)

func (Browsers) HTML

func (w Browsers) HTML() template.HTML

func (Browsers) Name

func (w Browsers) Name() string

func (*Browsers) SetHTML

func (w *Browsers) SetHTML(h template.HTML)

func (Browsers) TemplateData

func (w Browsers) TemplateData(ctx context.Context, shared SharedData) (string, interface{})

func (Browsers) Type

func (w Browsers) Type() string

type List

type List []Widget

func NewList

func NewList(want []string) (List, error)

func (List) Get

func (l List) Get(name string) Widget

func (List) Refs

func (l List) Refs() goatcounter.Stats

func (List) Totals

func (l List) Totals() (total, unique, allUnique, max int)

type Locations

type Locations struct {
	LocStat goatcounter.Stats
	// contains filtered or unexported fields
}

func (Locations) Clone

func (w Locations) Clone() Widget

func (*Locations) GetData

func (w *Locations) GetData(ctx context.Context, a Args) (err error)

func (Locations) HTML

func (w Locations) HTML() template.HTML

func (Locations) Name

func (w Locations) Name() string

func (*Locations) SetHTML

func (w *Locations) SetHTML(h template.HTML)

func (Locations) TemplateData

func (w Locations) TemplateData(ctx context.Context, shared SharedData) (string, interface{})

func (Locations) Type

func (w Locations) Type() string

type Max

type Max struct {
	Max int
	// contains filtered or unexported fields
}

func (Max) Clone

func (w Max) Clone() Widget

func (*Max) GetData

func (w *Max) GetData(ctx context.Context, a Args) (err error)

func (Max) HTML

func (w Max) HTML() template.HTML

func (Max) Name

func (w Max) Name() string

func (*Max) SetHTML

func (w *Max) SetHTML(h template.HTML)

func (Max) TemplateData

func (w Max) TemplateData(ctx context.Context, shared SharedData) (string, interface{})

func (Max) Type

func (w Max) Type() string

type Pages

type Pages struct {
	Display, UniqueDisplay int
	More                   bool
	Pages                  goatcounter.HitStats
	// contains filtered or unexported fields
}

func (Pages) Clone

func (w Pages) Clone() Widget

func (*Pages) GetData

func (w *Pages) GetData(ctx context.Context, a Args) (err error)

func (Pages) HTML

func (w Pages) HTML() template.HTML

func (Pages) Name

func (w Pages) Name() string

func (*Pages) SetHTML

func (w *Pages) SetHTML(h template.HTML)

func (Pages) TemplateData

func (w Pages) TemplateData(ctx context.Context, shared SharedData) (string, interface{})

func (Pages) Type

func (w Pages) Type() string

type Refs

type Refs struct {
	Refs goatcounter.Stats
	// contains filtered or unexported fields
}

func (Refs) Clone

func (w Refs) Clone() Widget

func (*Refs) GetData

func (w *Refs) GetData(ctx context.Context, a Args) (err error)

func (Refs) HTML

func (w Refs) HTML() template.HTML

func (Refs) Name

func (w Refs) Name() string

func (*Refs) SetHTML

func (w *Refs) SetHTML(h template.HTML)

func (Refs) TemplateData

func (w Refs) TemplateData(ctx context.Context, shared SharedData) (string, interface{})

func (Refs) Type

func (w Refs) Type() string

type SharedData

type SharedData struct {
	Site *goatcounter.Site
	Args Args

	Total             int
	TotalUnique       int
	AllTotalUniqueUTC int
	Max               int
	Refs              goatcounter.Stats
}

type Sizes

type Sizes struct {
	SizeStat goatcounter.Stats
	// contains filtered or unexported fields
}

func (Sizes) Clone

func (w Sizes) Clone() Widget

func (*Sizes) GetData

func (w *Sizes) GetData(ctx context.Context, a Args) (err error)

func (Sizes) HTML

func (w Sizes) HTML() template.HTML

func (Sizes) Name

func (w Sizes) Name() string

func (*Sizes) SetHTML

func (w *Sizes) SetHTML(h template.HTML)

func (Sizes) TemplateData

func (w Sizes) TemplateData(ctx context.Context, shared SharedData) (string, interface{})

func (Sizes) Type

func (w Sizes) Type() string

type Systems

type Systems struct {
	Systems goatcounter.Stats
	// contains filtered or unexported fields
}

func (Systems) Clone

func (w Systems) Clone() Widget

func (*Systems) GetData

func (w *Systems) GetData(ctx context.Context, a Args) (err error)

func (Systems) HTML

func (w Systems) HTML() template.HTML

func (Systems) Name

func (w Systems) Name() string

func (*Systems) SetHTML

func (w *Systems) SetHTML(h template.HTML)

func (Systems) TemplateData

func (w Systems) TemplateData(ctx context.Context, shared SharedData) (string, interface{})

func (Systems) Type

func (w Systems) Type() string

type Toprefs

type Toprefs struct {
	TopRefs goatcounter.Stats
	// contains filtered or unexported fields
}

func (Toprefs) Clone

func (w Toprefs) Clone() Widget

func (*Toprefs) GetData

func (w *Toprefs) GetData(ctx context.Context, a Args) (err error)

func (Toprefs) HTML

func (w Toprefs) HTML() template.HTML

func (Toprefs) Name

func (w Toprefs) Name() string

func (*Toprefs) SetHTML

func (w *Toprefs) SetHTML(h template.HTML)

func (Toprefs) TemplateData

func (w Toprefs) TemplateData(ctx context.Context, shared SharedData) (string, interface{})

func (Toprefs) Type

func (w Toprefs) Type() string

type Totalpages

type Totalpages struct {
	Max   int
	Total goatcounter.HitStat
	// contains filtered or unexported fields
}

func (Totalpages) Clone

func (w Totalpages) Clone() Widget

func (*Totalpages) GetData

func (w *Totalpages) GetData(ctx context.Context, a Args) (err error)

func (Totalpages) HTML

func (w Totalpages) HTML() template.HTML

func (Totalpages) Name

func (w Totalpages) Name() string

func (*Totalpages) SetHTML

func (w *Totalpages) SetHTML(h template.HTML)

func (Totalpages) TemplateData

func (w Totalpages) TemplateData(ctx context.Context, shared SharedData) (string, interface{})

func (Totalpages) Type

func (w Totalpages) Type() string

type Totals

type Totals struct {
	Total, TotalUnique int
	// contains filtered or unexported fields
}

func (Totals) Clone

func (w Totals) Clone() Widget

func (*Totals) GetData

func (w *Totals) GetData(ctx context.Context, a Args) (err error)

func (Totals) HTML

func (w Totals) HTML() template.HTML

func (Totals) Name

func (w Totals) Name() string

func (*Totals) SetHTML

func (w *Totals) SetHTML(h template.HTML)

func (Totals) TemplateData

func (w Totals) TemplateData(ctx context.Context, shared SharedData) (string, interface{})

func (Totals) Type

func (w Totals) Type() string

type Widget

type Widget interface {
	GetData(context.Context, Args) error
	TemplateData(context.Context, SharedData) (string, interface{})
	SetHTML(template.HTML)
	Clone() Widget

	Name() string
	Type() string // "full-width", "hchart"
	HTML() template.HTML
}

func New

func New(name string) (Widget, error)

Jump to

Keyboard shortcuts

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