Documentation
¶
Index ¶
- Variables
- func CliContext() (context.Context, func())
- func CompleteRegistryFlag(cmd *cobra.Command, argv []string, toComplete string) (variants []string, directive cobra.ShellCompDirective)
- func ErrorToExitCode(err error) int
- func NewPackageAddCommand(parent *PackageCommand) *cobra.Command
- func NewPackageCommand(args *GlobalArguments) *cobra.Command
- func NewPackageListCommand(parent *PackageCommand) *cobra.Command
- func NewPackageUploadCommand(parent *PackageCommand) *cobra.Command
- func NewRegistryAddCommand(args *GlobalArguments) *cobra.Command
- func NewRegistryCommand(args *GlobalArguments) *cobra.Command
- func NewRegistryDeleteCommand(args *GlobalArguments) *cobra.Command
- func NewRegistryInitCommand(args *GlobalArguments) *cobra.Command
- func NewRegistryListCommand(args *GlobalArguments) *cobra.Command
- func NewRepoAddCommand(parent *RepoCommand) *cobra.Command
- func NewRepoCommand(args *GlobalArguments) *cobra.Command
- func NewRepoInitCommand(parent *RepoCommand) *cobra.Command
- func NewRootCommand() *cobra.Command
- func Run(ctx context.Context, args []string, extras ...any) error
- type Encoder
- type GlobalArguments
- type OutputFormat
- type PackageAddCommand
- type PackageCommand
- type PackageListCommand
- type PackageListOutputItem
- type PackageUploadCommand
- type RefSet
- type RegistryAddCommand
- type RegistryDeleteCommand
- type RegistryInitCommand
- type RegistryListCommand
- type RegistryListOutputItem
- type RepoAddCommand
- type RepoCommand
- type RepoInitCommand
- type TagsMap
- type TextEncoder
- type TextMarshaler
- type TextRepresentable
- type TextVar
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AllOutputFormats = map[OutputFormat]struct{}{ TextOutputFormat: struct{}{}, JSONOutputFormat: struct{}{}, } )
View Source
var DefaultGlobalArguments = GlobalArguments{ OutputFormat: DefaultOutputFormat, }
View Source
var (
ErrRegistryDoesNotExist = errors.New("Registry does not exist")
)
Functions ¶
func CliContext ¶
func CompleteRegistryFlag ¶
func ErrorToExitCode ¶
func NewPackageAddCommand ¶
func NewPackageAddCommand(parent *PackageCommand) *cobra.Command
func NewPackageCommand ¶
func NewPackageCommand(args *GlobalArguments) *cobra.Command
func NewPackageListCommand ¶
func NewPackageListCommand(parent *PackageCommand) *cobra.Command
func NewPackageUploadCommand ¶
func NewPackageUploadCommand(parent *PackageCommand) *cobra.Command
func NewRegistryAddCommand ¶
func NewRegistryAddCommand(args *GlobalArguments) *cobra.Command
func NewRegistryCommand ¶
func NewRegistryCommand(args *GlobalArguments) *cobra.Command
func NewRegistryDeleteCommand ¶
func NewRegistryDeleteCommand(args *GlobalArguments) *cobra.Command
func NewRegistryInitCommand ¶
func NewRegistryInitCommand(args *GlobalArguments) *cobra.Command
func NewRegistryListCommand ¶
func NewRegistryListCommand(args *GlobalArguments) *cobra.Command
func NewRepoAddCommand ¶
func NewRepoAddCommand(parent *RepoCommand) *cobra.Command
func NewRepoCommand ¶
func NewRepoCommand(args *GlobalArguments) *cobra.Command
func NewRepoInitCommand ¶
func NewRepoInitCommand(parent *RepoCommand) *cobra.Command
func NewRootCommand ¶
Types ¶
type GlobalArguments ¶
type GlobalArguments struct { Config string OutputFormat OutputFormat }
func (*GlobalArguments) LoadConfig ¶
func (a *GlobalArguments) LoadConfig() (cfg shop.Config, err error)
func (*GlobalArguments) ResolveConfig ¶
func (a *GlobalArguments) ResolveConfig() (err error)
func (*GlobalArguments) SaveConfig ¶
func (a *GlobalArguments) SaveConfig(cfg shop.Config) (err error)
func (*GlobalArguments) Setup ¶
func (a *GlobalArguments) Setup(cmd *cobra.Command)
type OutputFormat ¶
type OutputFormat string
const ( TextOutputFormat OutputFormat = "text" JSONOutputFormat OutputFormat = "json" DefaultOutputFormat = TextOutputFormat )
func (OutputFormat) CreateEncoder ¶
func (f OutputFormat) CreateEncoder(writer io.Writer) Encoder
func (OutputFormat) MarshalText ¶
func (f OutputFormat) MarshalText() ([]byte, error)
func (*OutputFormat) UnmarshalText ¶
func (f *OutputFormat) UnmarshalText(d []byte) (err error)
type PackageAddCommand ¶
type PackageAddCommand struct { *PackageCommand Description string Repo string }
type PackageCommand ¶
type PackageCommand struct { Arguments *GlobalArguments RegistryName string Cfg shop.Config }
type PackageListCommand ¶
type PackageListCommand struct {
*PackageCommand
}
type PackageListOutputItem ¶
type PackageListOutputItem struct {
*shop.PackageOrPrefix
}
func (PackageListOutputItem) IntoText ¶
func (i PackageListOutputItem) IntoText() (text []byte, err error)
type PackageUploadCommand ¶
type PackageUploadCommand struct { *PackageCommand Tags TagsMap Refs RefSet Dir string }
type RegistryAddCommand ¶
type RegistryDeleteCommand ¶
type RegistryDeleteCommand struct {
Arguments *GlobalArguments
}
type RegistryInitCommand ¶
type RegistryInitCommand struct { Arguments *GlobalArguments Name string ManifestName string }
type RegistryListCommand ¶
type RegistryListCommand struct {
Arguments *GlobalArguments
}
type RegistryListOutputItem ¶
type RegistryListOutputItem struct { Name string `json:"name"` URL string `json:"url"` Admin bool `json:"admin"` Write bool `json:"write"` IsDefault bool `json:"default"` }
func RegistryListOutputItemFromRegistry ¶
func RegistryListOutputItemFromRegistry(registry shop.RegistryConfig, name string, isDefault bool) RegistryListOutputItem
func (RegistryListOutputItem) IntoText ¶
func (i RegistryListOutputItem) IntoText() (d []byte, err error)
type RepoAddCommand ¶
type RepoAddCommand struct { *RepoCommand Registry string Name string URL string }
type RepoCommand ¶
type RepoCommand struct {
Arguments *GlobalArguments
}
type RepoInitCommand ¶
type RepoInitCommand struct { *RepoCommand Name string ReadOnlyURL string }
type TextEncoder ¶
type TextEncoder struct {
// contains filtered or unexported fields
}
func (TextEncoder) Encode ¶
func (e TextEncoder) Encode(v any) error
type TextMarshaler ¶
type TextRepresentable ¶
type TextRepresentable interface { encoding.TextMarshaler encoding.TextUnmarshaler }
Click to show internal directories.
Click to hide internal directories.