config

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Rules is slice of caution display rule.
	Rules []Rule `yaml:"rules,omitempty"`

	// Template is output template
	// If empty, default template is used.
	// Available variables are:
	// - .Profile: AWS profile name
	// - .Region: AWS region
	// - .ID: AWS account ID (if ExtraInfo is true)
	// - .UserID: AWS user ID (if ExtraInfo is true)
	// - .Arn: AWS ARN (if ExtraInfo is true)
	// - .Now: Timestamp at command executed, formatted by `TimeFormat`
	Template string

	// ExtraInfo is flag to show extra information.
	// If true, awsc makes one or more API calls to AWS to gather extra data.
	ExtraInfo bool `yaml:"extra_info,omitempty"`

	// TimeFormat is format for time in output
	// Default is "2006-01-02 15:04:05"
	TimeFormat string `yaml:"time_format,omitempty"`
}

func Load

func Load(path string) (*Config, error)

type Rule

type Rule struct {
	// Expression is regexp for AWS profile name to match
	Expression string `yaml:"expression,omitempty"`

	// Color is highlight color for matched profile name
	Color string `yaml:"color,omitempty"`

	// ConfirmOnModify is flag to confirm before modification
	ConfirmOnModify bool `yaml:"confirm_on_modify,omitempty"`
}

Jump to

Keyboard shortcuts

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