options

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package options parses the estimate command's options, ported from the Node estimate (manager packages/estimate/src/options.ts): the same options, values, defaults, checks and messages, in the same order of checks, so a bad input gives the same first message. Only the usage names `dormeto aws estimate`.

Index

Constants

View Source
const Usage = `` /* 533-byte string literal not displayed */

Usage is Node's USAGE with `npm run estimate --` replaced by `dormeto aws estimate`.

Variables

View Source
var ErrHelp = errors.New("help requested")

ErrHelp is what Parse returns for --help or -h: the command prints Usage and exits 0.

Functions

This section is empty.

Types

type Options

type Options struct {
	// One AWS profile or more: the accounts each reaches, merged.
	Profiles []string `json:"-"`
	// The organization's accounts the estimate is restricted to (--accounts): nil, every account reached.
	Accounts []string `json:"accounts"`
	Regions  []string `json:"regions"`
	// Workloads left out by their tags (--exclude-tags, repeated): any criterion excludes; in one, every key (and), each
	// with one of its values (empty: any value), its keys in the order given (as describeTags writes them). Never nil.
	ExcludeTags []discover.TagWants `json:"excludeTags"`
	Ec2Uptime   bool                `json:"ec2Uptime"`
	EcsUptime   bool                `json:"ecsUptime"`
	RdsUptime   bool                `json:"rdsUptime"`
	Role        string              `json:"role"`
	Baseline    prices.Baseline     `json:"baseline"`
	Discounts   prices.Discounts    `json:"discounts"`
	// "discovery", "metrics" or nil.
	Refresh *string `json:"refresh"`
	Out     string  `json:"-"`
	// The idle window, in minutes, the report's figures use for every workload (--window); nil: each workload's
	// recommended window (Go only: Node's figures were at 60 minutes by default).
	Window *int `json:"window"`
	// The days of requests read before the run (--days, Go only), at most the 15 CloudWatch keeps by the minute.
	Days int `json:"days"`
	// nil: none (no limit).
	MaxWakes    *float64 `json:"maxWakes"`
	MinSaving   *float64 `json:"minSaving"`
	Parallel    int      `json:"parallel"`
	MaxWakesRds *float64 `json:"maxWakesRds"`
}

Options is the estimate command's options. Marshaled, it is the report's "options": Node's Options without out and profiles, field for field and in Node's order.

func Parse

func Parse(args []string) (Options, error)

Parse parses the arguments after "estimate", which cobra passes unparsed. --help or -h gives ErrHelp.

func (Options) DaysRead added in v0.2.0

func (o Options) DaysRead() int

DaysRead is the days of requests read: --days, 14 when unset (Options not from Parse).

func (Options) ReplayWindow added in v0.2.0

func (o Options) ReplayWindow() int

ReplayWindow is the window the replay takes as the current one: --window, else the product's default (60 minutes). The recommendations do not depend on it but for a --window outside the product's windows, which the replay adds.

type UsageError

type UsageError struct{ Message string }

UsageError is a bad option: the command prints its message and Usage, and exits 2.

func (*UsageError) Error

func (e *UsageError) Error() string

Jump to

Keyboard shortcuts

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