Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // AllFormatsString is the string representation of all Formats. AllFormatsString = stringutil.SliceToString([]string{FormatText.String(), FormatJSON.String()}) )
Functions ¶
Types ¶
type CuratedPluginPrinter ¶ added in v1.7.0
type CuratedPluginPrinter interface { PrintCuratedPlugin(ctx context.Context, format Format, plugin *registryv1alpha1.CuratedPlugin) error PrintCuratedPlugins(ctx context.Context, format Format, nextPageToken string, plugins ...*registryv1alpha1.CuratedPlugin) error }
CuratedPluginPrinter is a printer for curated plugins.
func NewCuratedPluginPrinter ¶ added in v1.7.0
func NewCuratedPluginPrinter(writer io.Writer) CuratedPluginPrinter
NewCuratedPluginPrinter returns a new CuratedPluginPrinter.
type Format ¶
type Format int
Format is a format to print.
func ParseFormat ¶
ParseFormat parses the format.
If the empty string is provided, this is interpreted as FormatText.
type OrganizationPrinter ¶
type OrganizationPrinter interface {
PrintOrganization(ctx context.Context, format Format, organization *ownerv1.Organization) error
}
OrganizationPrinter is an organization printer.
func NewOrganizationPrinter ¶
func NewOrganizationPrinter(address string, writer io.Writer) OrganizationPrinter
NewOrganizationPrinter returns a new OrganizationPrinter.
type RepositoryCommitPrinter ¶
type RepositoryCommitPrinter interface { PrintRepositoryCommit(ctx context.Context, format Format, repositoryCommit *modulev1.Commit) error PrintRepositoryCommits(ctx context.Context, format Format, nextPageToken string, repositoryCommits ...*modulev1.Commit) error }
RepositoryCommitPrinter is a repository commit printer.
func NewRepositoryCommitPrinter ¶
func NewRepositoryCommitPrinter(writer io.Writer) RepositoryCommitPrinter
NewRepositoryCommitPrinter returns a new RepositoryCommitPrinter.
type RepositoryLabelPrinter ¶ added in v1.33.0
type RepositoryLabelPrinter interface { PrintRepositoryLabel(ctx context.Context, format Format, label *modulev1.Label) error PrintRepositoryLabels(ctx context.Context, format Format, nextPageToken string, labels ...*modulev1.Label) error }
RepositoryLabelPrinter is a repository label printer. TODO: perhaps rename this to LabelPrinter along with other printers
func NewRepositoryLabelPrinter ¶ added in v1.33.0
func NewRepositoryLabelPrinter(writer io.Writer) RepositoryLabelPrinter
NewRepositoryLabelPrinter returns a new RepositoryLabelPrinter.
type RepositoryPrinter ¶
type RepositoryPrinter interface { PrintRepository(ctx context.Context, format Format, repository *modulev1.Module) error PrintRepositories(ctx context.Context, format Format, nextPageToken string, repositories ...*modulev1.Module) error }
RepositoryPrinter is a repository printer.
func NewRepositoryPrinter ¶
func NewRepositoryPrinter( clientConfig *connectclient.Config, address string, writer io.Writer, ) RepositoryPrinter
NewRepositoryPrinter returns a new RepositoryPrinter.
type StatsPrinter ¶ added in v1.17.0
type StatsPrinter interface {
PrintStats(ctx context.Context, format Format, stats *protostat.Stats) error
}
StatsPrinter is a printer of Stats.
func NewStatsPrinter ¶ added in v1.17.0
func NewStatsPrinter(writer io.Writer) StatsPrinter
NewStatsPrinter returns a new StatsPrinter.
type TokenPrinter ¶
type TokenPrinter interface {
PrintTokens(ctx context.Context, tokens ...*registryv1alpha1.Token) error
}
TokenPrinter is a token printer.
TODO: update to same format as other printers.
func NewTokenPrinter ¶
func NewTokenPrinter(writer io.Writer, format Format) (TokenPrinter, error)
NewTokenPrinter returns a new TokenPrinter.
TODO: update to same format as other printers.