utils

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: MIT Imports: 15 Imported by: ? 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

Index

Constants

This section is empty.

Variables

View Source
var (
	Version  = "dev"
	Sha      = "HEAD"
	Datetime = "dev"
)

Functions

func GetMaxTableRowWidth added in v1.0.0

func GetMaxTableRowWidth(rows []bubblesTable.Row) int

func GetOwnerAndRepoFromURL added in v1.0.0

func GetOwnerAndRepoFromURL(input string) (owner, repo string, err error)

GetOwnerAndRepoFromURL: extracts the owner and repository name

func HandleRepositoryValues added in v1.0.0

func HandleRepositoryValues(repos []string, filePath string) (map[string]struct{}, error)

func OutputJSON added in v1.0.0

func OutputJSON(entity interface{}) (string, error)

func OutputTable added in v1.0.0

func OutputTable(rows []bubblesTable.Row, columns []bubblesTable.Column) string

func OutputYAML added in v1.0.0

func OutputYAML(entity interface{}) (string, error)

func SetupRootCommand

func SetupRootCommand(rootCmd *cobra.Command)

SetupRootCommand is a convenience utility for applying templates and nice user experience pieces to the root cobra command

Types

type PosthogCliClient added in v1.0.0

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

PosthogCliClient is a wrapper around the posthog-go client and is used as a API entrypoint for sending OpenSauced telemetry data for CLI commands

func NewPosthogCliClient added in v1.0.0

func NewPosthogCliClient(activated bool) *PosthogCliClient

NewPosthogCliClient returns a PosthogCliClient which can be used to capture telemetry events for CLI users

func (*PosthogCliClient) CaptureCodeownersGenerate added in v1.3.0

func (p *PosthogCliClient) CaptureCodeownersGenerate() error

CaptureCodeownersGenerate gathers telemetry on successful codeowners generation

func (*PosthogCliClient) CaptureCodeownersGenerateAuth added in v1.3.0

func (p *PosthogCliClient) CaptureCodeownersGenerateAuth(username string) error

CaptureCodeownersGenerateAuth gathers telemetry on successful auth flows during codeowners generation

func (*PosthogCliClient) CaptureCodeownersGenerateContributorInsight added in v1.3.0

func (p *PosthogCliClient) CaptureCodeownersGenerateContributorInsight() error

CaptureCodeownersGenerateContributorInsight gathers telemetry on successful Contributor Insights creation/update during codeowners generation

func (*PosthogCliClient) CaptureConfigGenerate added in v1.5.0

func (p *PosthogCliClient) CaptureConfigGenerate() error

CaptureConfigGenerate gathers telemetry on success

func (*PosthogCliClient) CaptureConfigGenerateMode added in v1.5.0

func (p *PosthogCliClient) CaptureConfigGenerateMode(mode string) error

CaptureConfigGenerateMode gathers what mode a user is in when generating either 'Automatic' (default) or 'Interactive'

func (*PosthogCliClient) CaptureFailedCodeownersGenerate added in v1.3.0

func (p *PosthogCliClient) CaptureFailedCodeownersGenerate() error

CaptureFailedCodeownersGenerate gathers telemetry on failed codeowners generation

func (*PosthogCliClient) CaptureFailedCodeownersGenerateAuth added in v1.3.0

func (p *PosthogCliClient) CaptureFailedCodeownersGenerateAuth() error

CaptureFailedCodeownersGenerateAuth gathers telemetry on failed auth flows during codeowners generations

func (*PosthogCliClient) CaptureFailedCodeownersGenerateContributorInsight added in v1.3.0

func (p *PosthogCliClient) CaptureFailedCodeownersGenerateContributorInsight() error

CaptureFailedCodeownersGenerateContributorInsight gathers telemetry on failed Contributor Insights during codeowners generation

func (*PosthogCliClient) CaptureFailedConfigGenerate added in v1.5.0

func (p *PosthogCliClient) CaptureFailedConfigGenerate() error

CaptureFailedConfigGenerate gathers telemetry on failed

func (*PosthogCliClient) CaptureFailedInsights added in v1.3.0

func (p *PosthogCliClient) CaptureFailedInsights() error

CaptureFailedInsights gathers telemetry on failed Insights command runs

func (*PosthogCliClient) CaptureFailedLogin added in v1.0.0

func (p *PosthogCliClient) CaptureFailedLogin() error

CaptureFailedLogin gathers telemetry on failed logins via the CLI

func (*PosthogCliClient) CaptureInsights added in v1.3.0

func (p *PosthogCliClient) CaptureInsights() error

CaptureInsights gathers telemetry on successful Insights command runs

func (*PosthogCliClient) CaptureLogin added in v1.0.0

func (p *PosthogCliClient) CaptureLogin(username string) error

CaptureLogin gathers telemetry on users who log into OpenSauced via the CLI

func (*PosthogCliClient) Done added in v1.0.0

func (p *PosthogCliClient) Done() error

Done should always be called in order to flush the Posthog buffers before the CLI exits to ensure all events are accurately captured.

Jump to

Keyboard shortcuts

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