api

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: AGPL-3.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(config common.Config) error

NewServer creates a new server and starts it

func TokenMiddleware

func TokenMiddleware(psk []byte, public map[string]string, h http.Handler) http.Handler

TokenMiddleware checks the tokens for non-public URLs

Types

type BudgetAlert added in v0.10.0

type BudgetAlert struct {
	// Addresses are the email addresses for notifications (up to 10)
	Addresses []string

	// The comparison that is used for this notification.
	ComparisonOperator string

	// Whether this notification is in alarm. If a budget notification is in the
	// ALARM state, you have passed the set threshold for the budget.
	NotificationState string

	// Whether the notification is for how much you have spent (ACTUAL) or for how
	// much you're forecasted to spend (FORECASTED).
	NotificationType string

	// The threshold that is associated with a notification. Thresholds are always
	// a percentage, and many customers find value being alerted between 50% - 200%
	// of the budgeted amount. The maximum limit for your threshold is 1,000,000%
	// above the budgeted amount.
	Threshold float64

	// The type of threshold for a notification. For ABSOLUTE_VALUE thresholds,
	// AWS notifies you when you go over or are forecasted to go over your total
	// cost threshold. For PERCENTAGE thresholds, AWS notifies you when you go over
	// or are forecasted to go over a certain percentage of your forecasted spend.
	// For example, if you have a budget for 200 dollars and you have a PERCENTAGE
	// threshold of 80%, AWS notifies you when you go over 160 dollars.
	ThresholdType string
}

type BudgetCreateRequest added in v0.10.0

type BudgetCreateRequest struct {
	// Amount in USD for the budget
	Amount string

	// DAILY, MONTHLY, QUARTERLY, or ANNUALLY
	TimeUnit string

	// Alerts is a list of threshold/notification configurations for
	// a budget.  Maximum number is 5.
	Alerts []*BudgetAlert

	Tags []*Tag
}

BudgetCreateRequest is the request object to create a Budget

type BudgetResponse added in v0.10.0

type BudgetResponse struct {
	Amount   string
	Name     string
	TimeUnit string
	Alerts   []*BudgetAlert
}

BudgetResponse is the standard respoonse for a Budget

type LogWriter

type LogWriter struct {
	http.ResponseWriter
}

LogWriter is an http.ResponseWriter

func (LogWriter) Write

func (w LogWriter) Write(p []byte) (n int, err error)

Write log message if http response writer returns an error

type Tag added in v0.10.0

type Tag struct {
	Key   string
	Value string
}

Jump to

Keyboard shortcuts

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