tool

package
v0.0.0-...-3f1c2bf Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Red    = Color{/* contains filtered or unexported fields */}
	Blue   = Color{/* contains filtered or unexported fields */}
	Green  = Color{/* contains filtered or unexported fields */}
	Yellow = Color{/* contains filtered or unexported fields */}
	Cyan   = Color{/* contains filtered or unexported fields */}
)

Functions

func AskContinue

func AskContinue(message string) bool

AskContinue asks a user whether or not to continue the process

func BuildPrefixName

func BuildPrefixName(name string, env string, region string) string

BuildPrefixName creates new prefix for autoscaling group

func CheckFileExists

func CheckFileExists(filePath string) bool

CheckFileExists checks if a file or a directory exists or not

func CheckTimeout

func CheckTimeout(start int64, timeout time.Duration) (bool, error)

CheckTimeout compares now-start time with timeout

func CreateBodyStruct

func CreateBodyStruct(slice []string) ([]byte, error)

CreateBodyStruct creates body with slice

func CreateHeaderStruct

func CreateHeaderStruct(slice []string) (http.Header, error)

CreateHeaderStruct creates header with slice

func DecorateAttr

func DecorateAttr(attrString, message string) string

DecorateAttr decorate strings with a color or an emoji, respecting the user preference if no colour needed.

func FatalError

func FatalError(err error)

Fatal Error

func GenerateAsgName

func GenerateAsgName(prefix string, version int) string

GenerateAsgName generates the autoscaling name

func GenerateLcName

func GenerateLcName(asgName string) string

GenerateLcName generates new launch configuration name

func GetBaseStartTime

func GetBaseStartTime(t time.Time) time.Time

GetBaseStartTime generates start time

func GetBaseTime

func GetBaseTime(t time.Time) time.Time

GetBaseTime generates base time format

func GetBaseTimeWithTimezone

func GetBaseTimeWithTimezone(timezone string) time.Time

GetBaseTimeWithTimezone returns time with timezone

func GetRandomRGBColor

func GetRandomRGBColor() string

GetRandomRGBColor creates random RGB color

func GetTimePrefix

func GetTimePrefix(t time.Time) string

GetTimePrefix returns time prefix

func IsCanaryTargetGroupArn

func IsCanaryTargetGroupArn(str string, region string) bool

IsCanaryTargetGroupArn returns true if string is target group ARN

func IsStringInArray

func IsStringInArray(s string, arr []string) bool

IsStringInArray checks if string value is in array or not

func IsStringInPointerArray

func IsStringInPointerArray(s string, arr []*string) bool

IsStringInPointerArray checks if string value is in array or not

func IsTargetGroupArn

func IsTargetGroupArn(str string, region string) bool

IsTargetGroupArn returns true if string is target group ARN

func JoinString

func JoinString(arr []string, delimiter string) string

JoinString joins strings in the slice

func LocalCheck

func LocalCheck(message string, autoApply bool) error

LocalCheck checks whether or not to continue when it is run on localhost. Cannot add windows because goployer could be run on Windows..

func ParseAutoScalingVersion

func ParseAutoScalingVersion(name string) int

ParseAutoScalingVersion parses autoscaling version from name

func ParseTargetGroupName

func ParseTargetGroupName(arn string) string

ParseTargetGroupName parses target group ARN and return target group name

func ParseTargetGroupVersion

func ParseTargetGroupVersion(name string) int

ParseTargetGroupVersion parses autoscaling version from name

func PrintTemplate

func PrintTemplate(data interface{}, t *template.Template) error

PrintTemplate prints template with data

func RoundNum

func RoundNum(n float64) string

RoundNum create rounded number

func RoundTime

func RoundTime(d time.Duration) string

RoundTime creates rounded time

func SetCommonHeader

func SetCommonHeader() http.Header

SetCommonHeader returns common header for api test

Types

type Color

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

func (Color) Fprintf

func (c Color) Fprintf(out io.Writer, format string, a ...interface{})

Fprintf outputs the result to out.

func (Color) Fprintln

func (c Color) Fprintln(out io.Writer, a ...interface{})

Fprintln outputs the result to out, followed by a newline.

type Frigga

type Frigga struct {
	Prefix string
}

Jump to

Keyboard shortcuts

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