Documentation ¶
Index ¶
- Constants
- Variables
- func ContainsPrefix(words []string, prefix string) (string, bool)
- func SprintfAttr(format string, args ...interface{}) template.HTMLAttr
- func TagsOk(sf reflect.StructField) ([]string, bool)
- type ALink
- type Delay
- type Dlinks
- type Nlinks
- type Num
- type Params
- func (p *Params) Decode(req *http.Request) error
- func (p Params) Dlinks() map[string]Dlinks
- func (p Params) Encode() (string, error)
- func (p *Params) EncodeD(d *Delay, set time.Duration) (string, error)
- func (p *Params) EncodeN(num *Num, absolute int, setNegative *bool) (string, error)
- func (p *Params) EncodeT(num *Num) (string, error)
- func (p Params) Expired() bool
- func (p *Params) MarshalJSON() ([]byte, error)
- func (p Params) Nlinks() map[string]Nlinks
- func (p Params) NonZeroPsn() bool
- func (p *Params) ResetSchema()
- func (p *Params) SetDefaults(form url.Values)
- func (p *Params) Tick()
- func (p *Params) Tlinks() map[string]string
- func (p *Params) Vlinks() map[string][]VLink
- type ParamsFuncs
- func (f ParamsFuncs) DelayLess(d Delay, step time.Duration) time.Duration
- func (f ParamsFuncs) DelayMore(d Delay, step time.Duration) time.Duration
- func (f ParamsFuncs) HrefT(p *Params, num *Num) (template.HTMLAttr, error)
- func (f ParamsFuncs) LessD(p *Params, d *Delay, bclass string) (ALink, error)
- func (f ParamsFuncs) LessN(p *Params, num *Num, bclass string) (ALink, error)
- func (f ParamsFuncs) LinkD(p *Params, d *Delay, bclass string, set time.Duration, badge string) (ALink, error)
- func (f ParamsFuncs) LinkN(p *Params, num *Num, bclass string, absolute int, badge string) (ALink, error)
- func (f ParamsFuncs) MoreD(p *Params, d *Delay, bclass string) (ALink, error)
- func (f ParamsFuncs) MoreN(p *Params, num *Num, bclass string) (ALink, error)
- func (f ParamsFuncs) Pow2Less(v int) int
- func (f ParamsFuncs) Pow2More(v int) int
- func (f ParamsFuncs) Vlink(p *Params, num *Num, absolute int, text string) (VLink, error)
- type RenamedConstError
- type Schema
- type VLink
Constants ¶
View Source
const ( FS int // 1 MP // 2 AVAIL // 3 USEPCT // 4 USED // 5 TOTAL // 6 )
Constants for DF sorting criterion.
View Source
const ( PID int // 1 UID // 2 USER // 3 PRI // 4 NICE // 5 VIRT // 6 RES // 7 TIME // 8 NAME // 9 )
Constants for PS sorting criterion.
Variables ¶
Functions ¶
func SprintfAttr ¶
Types ¶
type Delay ¶
type Delay struct { D time.Duration Above *time.Duration Below *time.Duration Default time.Duration Ticks int }
Delay has it's own MarshalJSON.
func (Delay) MarshalJSON ¶
func (*Delay) UnmarshalText ¶
type Num ¶
type Num struct { Negative bool Absolute int DefaultNegative bool `json:"-"` DefaultAbsolute int `json:"-"` Limit int `json:"-"` Alpha bool `json:"-"` PositiveOnly bool `json:"-"` }
Num has no MarshalJSON.
func (Num) EncodeString ¶
EncodeString returns string repr of Num. Templates render .Absolute value explicitly.
func (*Num) UnmarshalText ¶
type Params ¶
type Params struct { Schema ParamsFuncs Defaults map[interface{}]Num `json:"-"` Delays map[string]*Delay `json:"-"` DelayBounds flags.DelayBounds `json:"-"` }
func (*Params) MarshalJSON ¶
func (Params) NonZeroPsn ¶
func (*Params) ResetSchema ¶
func (p *Params) ResetSchema()
func (*Params) SetDefaults ¶
type ParamsFuncs ¶
type ParamsFuncs struct{}
func (ParamsFuncs) Pow2Less ¶
func (f ParamsFuncs) Pow2Less(v int) int
func (ParamsFuncs) Pow2More ¶
func (f ParamsFuncs) Pow2More(v int) int
type RenamedConstError ¶
type RenamedConstError string
RenamedConstError denotes an error.
func (RenamedConstError) Error ¶
func (rc RenamedConstError) Error() string
type Schema ¶
type Schema struct { // Still is here to be preserved for url encoding. // Not in use by Go code, but by js. Still Num `url:"still,posonly,default0"` CPUd Delay `url:"cpud,omitempty"` Dfd Delay `url:"dfd,omitempty"` Ifd Delay `url:"ifd,omitempty"` Lad Delay `url:"lad,omitempty"` Memd Delay `url:"memd,omitempty"` Psd Delay `url:"psd,omitempty"` CPUn Num `url:"cpun,default-2"` Dfn Num `url:"dfn,default-2"` Ifn Num `url:"ifn,default-2"` Lan Num `url:"lan,default-3"` Memn Num `url:"memn,default-2"` Psn Num `url:"psn,default0"` Psk Num `url:"psk,default1,enumerate9"` // sort, default PID Dfk Num `url:"dfk,default1,enumerate6"` // sort, default FS }
Click to show internal directories.
Click to hide internal directories.