common

package
v0.0.0-...-2b89969 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GitRepository

func GitRepository(ctx context.Context) *git.Repository

GitRepository extracts the git repository from the context.

func SetupGerritAPI

func SetupGerritAPI(ctx context.Context) (context.Context, error)

SetupGerritAPI sets up the gerrit API to be shared across multiple commands.

func SetupGitRepository

func SetupGitRepository(ctx context.Context) (context.Context, error)

SetupGitRepository opens the current repository.

func SetupProject

func SetupProject(ctx context.Context) (context.Context, error)

SetupProject detects and configures the current ProjectID

func SetupTableWriter

func SetupTableWriter(ctx context.Context, out io.Writer) context.Context

SetupTableWriter creates a new table writer and appends it to the context.

func TableWriter

func TableWriter(ctx context.Context) *tablewriter.Table

TableWriter obtains a tablewriter.Table from the provided context.

func WriteRow

func WriteRow(table *tablewriter.Table, v interface{})

WriteRow using golang reflection to get column names from the provided structure.

Types

type Gerrit

type Gerrit struct {
	BaseURL string
	Client  *gerrit.Client
}

Gerrit provides programmatic access to the Gerrit REST API.

func GerritAPI

func GerritAPI(ctx context.Context) *Gerrit

GerritAPI extracts the gerrit client from the context.

type ProjectID

type ProjectID string

ProjectID defines an id for a project in gerrit.

func Project

func Project(ctx context.Context) ProjectID

Project returns the current ProjectID

func (ProjectID) String

func (p ProjectID) String() string

Jump to

Keyboard shortcuts

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