util

package
v0.0.0-prealpha-202304... Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AWSHostname

func AWSHostname(isGov bool) string

func AddGroup

func AddGroup(parent *cobra.Command, title string, cmds ...*cobra.Command)

func Basename

func Basename(str string) string

func ExitOnErr

func ExitOnErr(err error)

func ExponentialBackoff

func ExponentialBackoff(init, limit time.Duration) func()

func GenerateLoginURL

func GenerateLoginURL(creds aws.Credentials, isGov bool) (url.URL, error)

func GenerateTableHeaders

func GenerateTableHeaders(headers []string) []string

func GetCredentials

func GetCredentials(profile string) (aws.Credentials, error)

func GetFederatedToken

func GetFederatedToken(u url.URL) (string, error)

func GetFlagBool

func GetFlagBool(cmd *cobra.Command, str string) (bool, error)

func GetFlagString

func GetFlagString(cmd *cobra.Command, str string) (string, error)

func GetPullRequestIDs

func GetPullRequestIDs(input PullRequestInput) ([][]string, error)

func GetPullRequestInfoFromIDs

func GetPullRequestInfoFromIDs(ccClient *client.CodeCommitClient, input [][]string) ([]*codecommit.GetPullRequestOutput, error)

func GetPullRequests

func GetPullRequests(input PullRequestInput) ([]*codecommit.GetPullRequestOutput, error)

GetPullRequests combines GetPullRequestIDs & GetPullRequestInfoFromIDs into one call

func OpenBrowser

func OpenBrowser(url string) error

func PRsToTable

func PRsToTable(headers []string, prList []*codecommit.GetPullRequestOutput) *pterm.TablePrinter

func Spinner

func Spinner(startMsg string, closure SpinnerFunc)

func SpinnerWithStatusMsg

func SpinnerWithStatusMsg(startMsg string, closure SpinnerMsgFunc)

func StringifyCredentials

func StringifyCredentials(creds aws.Credentials) (string, error)

Types

type PullRequestInput

type PullRequestInput struct {
	AuthorARN    string
	Client       *client.CodeCommitClient
	Repositories []string
	Status       types.PullRequestStatusEnum
}

type Result

type Result[T any] struct {
	Result T
	Err    error
}

func ApprovePRs

func ApprovePRs(ccClient *client.CodeCommitClient, prMap PRMap, prSelections []string) []Result[string]

func ClosePRs

func ClosePRs(ccClient *client.CodeCommitClient, prMap PRMap, prSelections []string) []Result[string]

func DeleteBranches

func DeleteBranches(ccClient *client.CodeCommitClient, repo string, branches []string) []Result[string]

func GenerateDiffs

func GenerateDiffs(ccClient *client.CodeCommitClient, repo string, diffOut []*codecommit.GetDifferencesOutput) []Result[[]byte]

type ResultMap

type ResultMap[T any, K comparable, V any] struct {
	Result T
	Err    error
	Map    map[K]V
}

type SpinnerFunc

type SpinnerFunc func()

type SpinnerMsgFunc

type SpinnerMsgFunc func() (string, error)

Jump to

Keyboard shortcuts

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