chargeTracker

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Charge

type Charge struct {
	Time            time.Time `json:"time" yaml:"time"`
	User            string    `json:"user" yaml:"user"`
	PowerMeterStart float32   `json:"powerMeterStart" yaml:"powerMeterStart"`
	PowerMeterEnd   float32   `json:"powerMeterEnd" yaml:"powerMeterEnd"`
	Duration        string    `json:"duration" yaml:"duration"`
}

type ChargeLog

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

func NewChargeLog

func NewChargeLog(request *warp.Request) *ChargeLog

func (*ChargeLog) Load

func (cl *ChargeLog) Load(users []*users.User, filters []Filter) (*Charges, error)

type Charges

type Charges struct {
	Charges []*Charge `json:"charges" yaml:"charges"`
}

type Filter added in v0.0.2

type Filter interface {
	Filter(*Charge) bool
}

func Filters added in v0.0.2

func Filters(filter ...Filter) []Filter

func NewFilter added in v0.0.2

func NewFilter(filterName string, filterValue string, filterNumber int) Filter

type MonthFilter added in v0.0.2

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

func (*MonthFilter) Filter added in v0.0.2

func (mf *MonthFilter) Filter(charge *Charge) bool

type UserFilter added in v0.0.2

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

func (*UserFilter) Filter added in v0.0.2

func (uF *UserFilter) Filter(charge *Charge) bool

type YearFilter added in v0.0.2

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

func (*YearFilter) Filter added in v0.0.2

func (yF *YearFilter) Filter(charge *Charge) bool

Jump to

Keyboard shortcuts

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