report

package module
v0.0.0-...-a171720 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Date

func Date(t time.Time) time.Time

Date return the date by time.

func FormatDate

func FormatDate(t time.Time) string

FormatDate formats date to string.

func Group

func Group(frame *dt.Frame) *dt.Frame

Group is the default group function.

func ParseDate

func ParseDate(v string) (time.Time, error)

ParseDate parses v to date.

Types

type Info

type Info interface {
	Path() string
	Feed(name string) (time.Time, *dt.Frame, error)
	Group(frame *dt.Frame) *dt.Frame
	Desc(frame *dt.Frame) (string, error)
}

Info is the report info.

type Report

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

Report is the report entity.

func Load

func Load(info Info) (*Report, error)

Load loads the report.

func (*Report) Base

func (a *Report) Base() *dt.Frame

Base returns a copy of base frame.

func (*Report) Default

func (a *Report) Default(date time.Time) (*dt.Frame, error)

Defalut returns the default report frame.

func (*Report) Feed

func (a *Report) Feed(name string) (time.Time, error)

Feed feeds a file to report.

func (*Report) Stat

func (a *Report) Stat(s, e time.Time) (dt.List, error)

Stat statistics data from s to e.

func (*Report) StatBy

func (a *Report) StatBy(e time.Time) (dt.List, error)

StatBy statistics data from start time to e.

func (*Report) Target

func (a *Report) Target(s, e time.Time) (dt.List, error)

Target gets the target from s to e.

func (*Report) TargetBy

func (a *Report) TargetBy(e time.Time) (dt.List, error)

TargetBy gets the target from start time to e.

Jump to

Keyboard shortcuts

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