cmd

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const ArchiveIDAll = -1
View Source
const RespHeaderNameXOp = "X-Op"
View Source
const RespHeaderNameXPath = "X-Path"

Variables

View Source
var ErrDiffFound = errors.New("diff found")

Functions

func AsFileNotExistError

func AsFileNotExistError(err error) *fileNotExistError

func WrapFileNotExistError

func WrapFileNotExistError(srcOrDest SrcDestType, err error) error

Types

type Command

type Command interface {
	Parse(fs *flag.FlagSet, args []string) error
	Execute() error
}

type CopyCommand

type CopyCommand struct {
	SrcBase           string
	SrcRelPath        string
	DestBase          string
	DestRelPath       string
	AggregationMethod whispertool.AggregationMethod
	XFilesFactor      float32
	ArchiveInfoList   whispertool.ArchiveInfoList
	From              whispertool.Timestamp
	Until             whispertool.Timestamp
	ArchiveID         int
	TextOut           string
	CopyNaN           bool
}

func (*CopyCommand) Execute

func (c *CopyCommand) Execute() error

func (*CopyCommand) Parse

func (c *CopyCommand) Parse(fs *flag.FlagSet, args []string) error

type DiffCommand

type DiffCommand struct {
	SrcBase     string
	SrcRelPath  string
	DestBase    string
	DestRelPath string
	From        whispertool.Timestamp
	Until       whispertool.Timestamp
	ArchiveID   int
	TextOut     string
}

func (*DiffCommand) Execute

func (c *DiffCommand) Execute() error

func (*DiffCommand) Parse

func (c *DiffCommand) Parse(fs *flag.FlagSet, args []string) error

type GenerateCommand

type GenerateCommand struct {
	Dest              string
	Perm              os.FileMode
	AggregationMethod whispertool.AggregationMethod
	XFilesFactor      float32
	ArchiveInfoList   whispertool.ArchiveInfoList
	RandMax           int
	Fill              bool
	TextOut           string
}

func (*GenerateCommand) Execute

func (c *GenerateCommand) Execute() error

func (*GenerateCommand) Parse

func (c *GenerateCommand) Parse(fs *flag.FlagSet, args []string) error

type PointsList

type PointsList []whispertool.Points

func (PointsList) AllEmpty

func (pl PointsList) AllEmpty() bool

func (PointsList) Counts

func (pl PointsList) Counts() []int

func (PointsList) Diff

func (pl PointsList) Diff(ql PointsList) (PointsList, PointsList)

func (PointsList) Print

func (pp PointsList) Print(w io.Writer) error

type RequiredOptionError

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

func (*RequiredOptionError) Error

func (e *RequiredOptionError) Error() string

func (*RequiredOptionError) Usage

func (e *RequiredOptionError) Usage()

type ServerCommand

type ServerCommand struct {
	Addr    string
	BaseDir string
}

func (*ServerCommand) Execute

func (c *ServerCommand) Execute() error

func (*ServerCommand) Parse

func (c *ServerCommand) Parse(fs *flag.FlagSet, args []string) error

type SrcDestType

type SrcDestType int
const (
	Source SrcDestType = iota + 1
	Destination
)

func SrcDestTypeString

func SrcDestTypeString(s string) (SrcDestType, error)

SrcDestTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func SrcDestTypeValues

func SrcDestTypeValues() []SrcDestType

SrcDestTypeValues returns all values of the enum

func (SrcDestType) IsASrcDestType

func (i SrcDestType) IsASrcDestType() bool

IsASrcDestType returns "true" if the value is listed in the enum definition. "false" otherwise

func (SrcDestType) String

func (i SrcDestType) String() string

type SumCommand

type SumCommand struct {
	SrcBase     string
	ItemPattern string
	SrcPattern  string
	From        whispertool.Timestamp
	Until       whispertool.Timestamp
	ArchiveID   int
	TextOut     string
	ShowHeader  bool
}

func (*SumCommand) Execute

func (c *SumCommand) Execute() error

func (*SumCommand) Parse

func (c *SumCommand) Parse(fs *flag.FlagSet, args []string) error

type SumCopyCommand

type SumCopyCommand struct {
	SrcBase           string
	DestBase          string
	ItemPattern       string
	SrcPattern        string
	DestRelPath       string
	AggregationMethod whispertool.AggregationMethod
	XFilesFactor      float32
	ArchiveInfoList   whispertool.ArchiveInfoList
	From              whispertool.Timestamp
	Until             whispertool.Timestamp
	ArchiveID         int
	TextOut           string
}

func (*SumCopyCommand) Execute

func (c *SumCopyCommand) Execute() error

func (*SumCopyCommand) Parse

func (c *SumCopyCommand) Parse(fs *flag.FlagSet, args []string) error

type SumDiffCommand

type SumDiffCommand struct {
	SrcBase     string
	ItemPattern string
	SrcPattern  string
	DestBase    string
	DestRelPath string
	From        whispertool.Timestamp
	Until       whispertool.Timestamp
	ArchiveID   int
	TextOut     string
}

func (*SumDiffCommand) Execute

func (c *SumDiffCommand) Execute() error

func (*SumDiffCommand) Parse

func (c *SumDiffCommand) Parse(fs *flag.FlagSet, args []string) error

type TimeSeriesList

type TimeSeriesList []*whispertool.TimeSeries

func (TimeSeriesList) AllEmpty

func (tl TimeSeriesList) AllEmpty() bool

func (TimeSeriesList) AllEqualTimeRangeAndStep

func (tl TimeSeriesList) AllEqualTimeRangeAndStep(ul TimeSeriesList) bool

AllEqualTimeRangeAndStep returns whether or not all of FromTime(), UntilTime() and Step() are the same between all TimeSeries in tl and ul.

func (TimeSeriesList) Diff

func (TimeSeriesList) DiffExcludeSrcNaN

func (tl TimeSeriesList) DiffExcludeSrcNaN(ul TimeSeriesList) (PointsList, PointsList)

func (TimeSeriesList) Equal

func (tl TimeSeriesList) Equal(tl2 TimeSeriesList) bool

Equal returns whether or not tl equals to tl2.

func (TimeSeriesList) PointCounts

func (tl TimeSeriesList) PointCounts() []int

func (TimeSeriesList) PointsList

func (tl TimeSeriesList) PointsList() PointsList

func (TimeSeriesList) Print

func (tl TimeSeriesList) Print(w io.Writer) error

func (TimeSeriesList) TimeRangeStepString

func (tl TimeSeriesList) TimeRangeStepString() string

type ViewCommand

type ViewCommand struct {
	SrcBase    string
	SrcRelPath string
	From       whispertool.Timestamp
	Until      whispertool.Timestamp
	ArchiveID  int
	ShowHeader bool
	TextOut    string
}

func (*ViewCommand) Execute

func (c *ViewCommand) Execute() error

func (*ViewCommand) Parse

func (c *ViewCommand) Parse(fs *flag.FlagSet, args []string) error

type ViewRawCommand

type ViewRawCommand struct {
	SrcBase     string
	SrcRelPath  string
	From        whispertool.Timestamp
	Until       whispertool.Timestamp
	ArchiveID   int
	ShowHeader  bool
	SortsByTime bool
	TextOut     string
}

func (*ViewRawCommand) Execute

func (c *ViewRawCommand) Execute() error

func (*ViewRawCommand) Parse

func (c *ViewRawCommand) Parse(fs *flag.FlagSet, args []string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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