utils

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 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

func GetMaxTableRowWidth(rows []bubblesTable.Row) int

func GetOwnerAndRepoFromURL

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

GetOwnerAndRepoFromURL: extracts the owner and repository name

func HandleRepositoryValues

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

func OutputJSON

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

func OutputTable

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

func OutputYAML

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

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

func NewPosthogCliClient(activated bool) *PosthogCliClient

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

func (*PosthogCliClient) CaptureCodeownersGenerate

func (p *PosthogCliClient) CaptureCodeownersGenerate() error

CaptureCodeownersGenerate gathers telemetry on successful codeowners generation

func (*PosthogCliClient) CaptureCodeownersGenerateAuth

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

CaptureCodeownersGenerateAuth gathers telemetry on successful auth flows during codeowners generation

func (*PosthogCliClient) CaptureCodeownersGenerateContributorInsight

func (p *PosthogCliClient) CaptureCodeownersGenerateContributorInsight() error

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

func (*PosthogCliClient) CaptureConfigGenerate

func (p *PosthogCliClient) CaptureConfigGenerate() error

CaptureConfigGenerate gathers telemetry on success

func (*PosthogCliClient) CaptureConfigGenerateMode

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

func (p *PosthogCliClient) CaptureFailedCodeownersGenerate() error

CaptureFailedCodeownersGenerate gathers telemetry on failed codeowners generation

func (*PosthogCliClient) CaptureFailedCodeownersGenerateAuth

func (p *PosthogCliClient) CaptureFailedCodeownersGenerateAuth() error

CaptureFailedCodeownersGenerateAuth gathers telemetry on failed auth flows during codeowners generations

func (*PosthogCliClient) CaptureFailedCodeownersGenerateContributorInsight

func (p *PosthogCliClient) CaptureFailedCodeownersGenerateContributorInsight() error

CaptureFailedCodeownersGenerateContributorInsight gathers telemetry on failed Contributor Insights during codeowners generation

func (*PosthogCliClient) CaptureFailedConfigGenerate

func (p *PosthogCliClient) CaptureFailedConfigGenerate() error

CaptureFailedConfigGenerate gathers telemetry on failed

func (*PosthogCliClient) CaptureFailedInsights

func (p *PosthogCliClient) CaptureFailedInsights() error

CaptureFailedInsights gathers telemetry on failed Insights command runs

func (*PosthogCliClient) CaptureFailedLogin

func (p *PosthogCliClient) CaptureFailedLogin() error

CaptureFailedLogin gathers telemetry on failed logins via the CLI

func (*PosthogCliClient) CaptureFailedOffboard added in v2.3.0

func (p *PosthogCliClient) CaptureFailedOffboard() error

func (*PosthogCliClient) CaptureInsights

func (p *PosthogCliClient) CaptureInsights() error

CaptureInsights gathers telemetry on successful Insights command runs

func (*PosthogCliClient) CaptureLogin

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

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

func (*PosthogCliClient) CaptureOffboard added in v2.3.0

func (p *PosthogCliClient) CaptureOffboard() error

func (*PosthogCliClient) Done

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