utils

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

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() *PosthogCliClient

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

func (*PosthogCliClient) CaptureBake

func (p *PosthogCliClient) CaptureBake(urls []string)

CaptureBake gathers telemetry on git repos that are being baked

func (*PosthogCliClient) CaptureFailedLogin

func (p *PosthogCliClient) CaptureFailedLogin()

CaptureFailedLogin gathers telemetry on failed logins via the CLI

func (*PosthogCliClient) CaptureLogin

func (p *PosthogCliClient) CaptureLogin(username string)

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

func (*PosthogCliClient) CaptureRepoQuery

func (p *PosthogCliClient) CaptureRepoQuery(url string)

CaptureRepoQuery gathers telemetry on users using the repo-query service

func (*PosthogCliClient) Done

func (p *PosthogCliClient) Done()

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