Documentation
¶
Overview ¶
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Code generated by github.com/bcdxn/opencli@unknown version DO NOT EDIT.
Index ¶
- Constants
- func DefaultHelpFunc(a ActionsInterface, cmd *spec.CommandItem)
- func DefaultUsageFunc(a ActionsInterface, cmd *spec.CommandItem) error
- func NewCmdPetstore(a ActionsInterface) *cobra.Command
- func NewCmdPetstoreList(a ActionsInterface) *cobra.Command
- func NewCmdPetstorePet(a ActionsInterface) *cobra.Command
- func NewCmdPetstorePetAdd(a ActionsInterface) *cobra.Command
- func NewCmdPetstorePetDelete(a ActionsInterface) *cobra.Command
- func NewCmdPetstorePetFindByStatus(a ActionsInterface) *cobra.Command
- func NewCmdPetstorePetFindByTags(a ActionsInterface) *cobra.Command
- func NewCmdPetstorePetGet(a ActionsInterface) *cobra.Command
- func NewCmdPetstorePetUpdate(a ActionsInterface) *cobra.Command
- func NewCmdPetstorePetUpdateForm(a ActionsInterface) *cobra.Command
- func NewCmdPetstorePetUploadImage(a ActionsInterface) *cobra.Command
- func NewCmdPetstoreStore(a ActionsInterface) *cobra.Command
- func NewCmdPetstoreStoreInventory(a ActionsInterface) *cobra.Command
- func NewCmdPetstoreStoreOrder(a ActionsInterface) *cobra.Command
- func NewCmdPetstoreStoreOrderDelete(a ActionsInterface) *cobra.Command
- func NewCmdPetstoreStoreOrderGet(a ActionsInterface) *cobra.Command
- func NewCmdPetstoreStoreOrderPlace(a ActionsInterface) *cobra.Command
- func NewCmdPetstoreUser(a ActionsInterface) *cobra.Command
- func NewCmdPetstoreUserCreate(a ActionsInterface) *cobra.Command
- func NewCmdPetstoreUserCreateWithList(a ActionsInterface) *cobra.Command
- func NewCmdPetstoreUserDelete(a ActionsInterface) *cobra.Command
- func NewCmdPetstoreUserGet(a ActionsInterface) *cobra.Command
- func NewCmdPetstoreUserLogin(a ActionsInterface) *cobra.Command
- func NewCmdPetstoreUserLogout(a ActionsInterface) *cobra.Command
- func NewCmdPetstoreUserUpdate(a ActionsInterface) *cobra.Command
- func Run(ctx context.Context, actions ActionsInterface) int
- type ActionsInterface
- type CLIError
- type DefaultIOStreams
- type DefaultTerminal
- type FileReader
- type FileWriter
- type IOStreams
- type PetstoreListArgs
- type PetstorePetAddArgs
- type PetstorePetAddFlags
- type PetstorePetAddStatus
- type PetstorePetDeleteFlags
- type PetstorePetFindByStatusFlags
- type PetstorePetFindByStatusStatus
- type PetstorePetFindByTagsFlags
- type PetstorePetGetFlags
- type PetstorePetUpdateArgs
- type PetstorePetUpdateFlags
- type PetstorePetUpdateFormFlags
- type PetstorePetUpdateFormStatus
- type PetstorePetUpdateStatus
- type PetstorePetUploadImageArgs
- type PetstorePetUploadImageFlags
- type PetstoreStoreOrderDeleteArgs
- type PetstoreStoreOrderGetFlags
- type PetstoreStoreOrderPlaceArgs
- type PetstoreStoreOrderPlaceFlags
- type PetstoreStoreOrderPlaceStatus
- type PetstoreUserCreateArgs
- type PetstoreUserCreateFlags
- type PetstoreUserCreateWithListArgs
- type PetstoreUserDeleteFlags
- type PetstoreUserGetFlags
- type PetstoreUserLoginFlags
- type PetstoreUserUpdateFlags
- type Terminal
- type UsageFunc
- type ValidationError
Constants ¶
const ( ExitCodeOK int = 0 ExitCodeInternalErr int = 1 ExitCodeBadUserInputErr int = 2 )
Variables ¶
This section is empty.
Functions ¶
func DefaultHelpFunc ¶
func DefaultHelpFunc(a ActionsInterface, cmd *spec.CommandItem)
DefaultHelpFunc renders contextual help for cmd to the actions IOStreams output.
func DefaultUsageFunc ¶
func DefaultUsageFunc(a ActionsInterface, cmd *spec.CommandItem) error
DefaultUsageFunc renders contextual usage for cmd to the actions IOStreams output.
func NewCmdPetstore ¶
func NewCmdPetstore(a ActionsInterface) *cobra.Command
func NewCmdPetstoreList ¶
func NewCmdPetstoreList(a ActionsInterface) *cobra.Command
func NewCmdPetstorePet ¶
func NewCmdPetstorePet(a ActionsInterface) *cobra.Command
func NewCmdPetstorePetAdd ¶
func NewCmdPetstorePetAdd(a ActionsInterface) *cobra.Command
func NewCmdPetstorePetDelete ¶
func NewCmdPetstorePetDelete(a ActionsInterface) *cobra.Command
func NewCmdPetstorePetFindByStatus ¶
func NewCmdPetstorePetFindByStatus(a ActionsInterface) *cobra.Command
func NewCmdPetstorePetFindByTags ¶
func NewCmdPetstorePetFindByTags(a ActionsInterface) *cobra.Command
func NewCmdPetstorePetGet ¶
func NewCmdPetstorePetGet(a ActionsInterface) *cobra.Command
func NewCmdPetstorePetUpdate ¶
func NewCmdPetstorePetUpdate(a ActionsInterface) *cobra.Command
func NewCmdPetstorePetUpdateForm ¶
func NewCmdPetstorePetUpdateForm(a ActionsInterface) *cobra.Command
func NewCmdPetstorePetUploadImage ¶
func NewCmdPetstorePetUploadImage(a ActionsInterface) *cobra.Command
func NewCmdPetstoreStore ¶
func NewCmdPetstoreStore(a ActionsInterface) *cobra.Command
func NewCmdPetstoreStoreInventory ¶
func NewCmdPetstoreStoreInventory(a ActionsInterface) *cobra.Command
func NewCmdPetstoreStoreOrder ¶
func NewCmdPetstoreStoreOrder(a ActionsInterface) *cobra.Command
func NewCmdPetstoreStoreOrderDelete ¶
func NewCmdPetstoreStoreOrderDelete(a ActionsInterface) *cobra.Command
func NewCmdPetstoreStoreOrderGet ¶
func NewCmdPetstoreStoreOrderGet(a ActionsInterface) *cobra.Command
func NewCmdPetstoreStoreOrderPlace ¶
func NewCmdPetstoreStoreOrderPlace(a ActionsInterface) *cobra.Command
func NewCmdPetstoreUser ¶
func NewCmdPetstoreUser(a ActionsInterface) *cobra.Command
func NewCmdPetstoreUserCreate ¶
func NewCmdPetstoreUserCreate(a ActionsInterface) *cobra.Command
func NewCmdPetstoreUserCreateWithList ¶
func NewCmdPetstoreUserCreateWithList(a ActionsInterface) *cobra.Command
func NewCmdPetstoreUserDelete ¶
func NewCmdPetstoreUserDelete(a ActionsInterface) *cobra.Command
func NewCmdPetstoreUserGet ¶
func NewCmdPetstoreUserGet(a ActionsInterface) *cobra.Command
func NewCmdPetstoreUserLogin ¶
func NewCmdPetstoreUserLogin(a ActionsInterface) *cobra.Command
func NewCmdPetstoreUserLogout ¶
func NewCmdPetstoreUserLogout(a ActionsInterface) *cobra.Command
func NewCmdPetstoreUserUpdate ¶
func NewCmdPetstoreUserUpdate(a ActionsInterface) *cobra.Command
Types ¶
type ActionsInterface ¶
type ActionsInterface interface {
PetstoreList(ctx context.Context, args PetstoreListArgs) error
PetstorePetAdd(ctx context.Context, args PetstorePetAddArgs, flags PetstorePetAddFlags) error
PetstorePetUpdate(ctx context.Context, args PetstorePetUpdateArgs, flags PetstorePetUpdateFlags) error
PetstorePetFindByStatus(ctx context.Context, flags PetstorePetFindByStatusFlags) error
PetstorePetFindByTags(ctx context.Context, flags PetstorePetFindByTagsFlags) error
PetstorePetGet(ctx context.Context, flags PetstorePetGetFlags) error
PetstorePetUpdateForm(ctx context.Context, flags PetstorePetUpdateFormFlags) error
PetstorePetDelete(ctx context.Context, flags PetstorePetDeleteFlags) error
PetstorePetUploadImage(ctx context.Context, args PetstorePetUploadImageArgs, flags PetstorePetUploadImageFlags) error
PetstoreStoreInventory(ctx context.Context) error
PetstoreStoreOrderPlace(ctx context.Context, args PetstoreStoreOrderPlaceArgs, flags PetstoreStoreOrderPlaceFlags) error
PetstoreStoreOrderGet(ctx context.Context, flags PetstoreStoreOrderGetFlags) error
PetstoreStoreOrderDelete(ctx context.Context, args PetstoreStoreOrderDeleteArgs) error
PetstoreUserCreate(ctx context.Context, args PetstoreUserCreateArgs, flags PetstoreUserCreateFlags) error
PetstoreUserCreateWithList(ctx context.Context, args PetstoreUserCreateWithListArgs) error
PetstoreUserLogin(ctx context.Context, flags PetstoreUserLoginFlags) error
PetstoreUserLogout(ctx context.Context) error
PetstoreUserGet(ctx context.Context, flags PetstoreUserGetFlags) error
PetstoreUserUpdate(ctx context.Context, flags PetstoreUserUpdateFlags) error
PetstoreUserDelete(ctx context.Context, flags PetstoreUserDeleteFlags) error
HelpFunc(cmd *spec.CommandItem)
UsageFunc(cmd *spec.CommandItem) error
IOStreams() IOStreams
Version() string
}
ActionsInterface defines all actions the petstore CLI supports.
type CLIError ¶
CLIError represents a CLI error with an exit code and an optional usage function.
func BadUserInput ¶
BadUserInput creates a new CLIError with the bad user input exit code.
func InternalError ¶
InternalError creates a new CLIError with the internal error exit code.
type DefaultIOStreams ¶
type DefaultIOStreams struct {
// contains filtered or unexported fields
}
DefaultIOStreams is the default implementation of IOStreams backed by os.Stdin/Stdout/Stderr.
func (DefaultIOStreams) ErrOut ¶
func (ios DefaultIOStreams) ErrOut() FileWriter
func (DefaultIOStreams) In ¶
func (ios DefaultIOStreams) In() FileReader
func (DefaultIOStreams) Out ¶
func (ios DefaultIOStreams) Out() FileWriter
func (DefaultIOStreams) TerminalSize ¶
func (ios DefaultIOStreams) TerminalSize() (int, int, error)
func (DefaultIOStreams) TerminalTheme ¶
func (ios DefaultIOStreams) TerminalTheme() string
type DefaultTerminal ¶
type DefaultTerminal struct {
// contains filtered or unexported fields
}
DefaultTerminal is the default Terminal implementation backed by the real OS terminal.
func (*DefaultTerminal) Is256ColorSupported ¶
func (t *DefaultTerminal) Is256ColorSupported() bool
func (*DefaultTerminal) IsTerminalOutput ¶
func (t *DefaultTerminal) IsTerminalOutput() bool
func (*DefaultTerminal) IsTrueColorSupported ¶
func (t *DefaultTerminal) IsTrueColorSupported() bool
func (*DefaultTerminal) Theme ¶
func (t *DefaultTerminal) Theme() string
type FileReader ¶
type FileReader interface {
io.ReadCloser
Fd() uintptr
}
FileReader is an io.ReadCloser that exposes the underlying file descriptor.
type FileWriter ¶
FileWriter is an io.Writer that exposes the underlying file descriptor.
type IOStreams ¶
type IOStreams interface {
In() FileReader
Out() FileWriter
ErrOut() FileWriter
TerminalTheme() string
TerminalSize() (int, int, error)
}
IOStreams provides access to the standard I/O streams.
func DefaultIOS ¶
func DefaultIOS() IOStreams
DefaultIOS returns an IOStreams backed by the real os.Stdin/Stdout/Stderr.
type PetstoreListArgs ¶
type PetstoreListArgs struct {
HttpArguments string
}
PetstoreListArgs holds the positional arguments for the PetstoreList action.
type PetstorePetAddArgs ¶
type PetstorePetAddArgs struct {
PathToReqBody string
}
PetstorePetAddArgs holds the positional arguments for the PetstorePetAdd action.
type PetstorePetAddFlags ¶
type PetstorePetAddFlags struct {
Name string
PhotoUrls []string
Status PetstorePetAddStatus
Tag []string
}
PetstorePetAddFlags holds the flag values for the PetstorePetAdd action.
type PetstorePetAddStatus ¶
type PetstorePetAddStatus string
PetstorePetAddStatus represents the allowed values for the Status flag.
const ( PetstorePetAddStatusAvailable PetstorePetAddStatus = "available" PetstorePetAddStatusPending PetstorePetAddStatus = "pending" PetstorePetAddStatusSold PetstorePetAddStatus = "sold" )
func (PetstorePetAddStatus) IsValid ¶
func (v PetstorePetAddStatus) IsValid() bool
type PetstorePetDeleteFlags ¶
PetstorePetDeleteFlags holds the flag values for the PetstorePetDelete action.
type PetstorePetFindByStatusFlags ¶
type PetstorePetFindByStatusFlags struct {
Status PetstorePetFindByStatusStatus
}
PetstorePetFindByStatusFlags holds the flag values for the PetstorePetFindByStatus action.
type PetstorePetFindByStatusStatus ¶
type PetstorePetFindByStatusStatus string
PetstorePetFindByStatusStatus represents the allowed values for the Status flag.
const ( PetstorePetFindByStatusStatusAvailable PetstorePetFindByStatusStatus = "available" PetstorePetFindByStatusStatusPending PetstorePetFindByStatusStatus = "pending" PetstorePetFindByStatusStatusSold PetstorePetFindByStatusStatus = "sold" )
func (PetstorePetFindByStatusStatus) IsValid ¶
func (v PetstorePetFindByStatusStatus) IsValid() bool
type PetstorePetFindByTagsFlags ¶
type PetstorePetFindByTagsFlags struct {
Tags []string
}
PetstorePetFindByTagsFlags holds the flag values for the PetstorePetFindByTags action.
type PetstorePetGetFlags ¶
type PetstorePetGetFlags struct {
Id int64
}
PetstorePetGetFlags holds the flag values for the PetstorePetGet action.
type PetstorePetUpdateArgs ¶
type PetstorePetUpdateArgs struct {
PathToReqBody string
}
PetstorePetUpdateArgs holds the positional arguments for the PetstorePetUpdate action.
type PetstorePetUpdateFlags ¶
type PetstorePetUpdateFlags struct {
Name string
Status PetstorePetUpdateStatus
PhotoUrls []string
Tags []string
}
PetstorePetUpdateFlags holds the flag values for the PetstorePetUpdate action.
type PetstorePetUpdateFormFlags ¶
type PetstorePetUpdateFormFlags struct {
Id int64
Name string
Status PetstorePetUpdateFormStatus
}
PetstorePetUpdateFormFlags holds the flag values for the PetstorePetUpdateForm action.
type PetstorePetUpdateFormStatus ¶
type PetstorePetUpdateFormStatus string
PetstorePetUpdateFormStatus represents the allowed values for the Status flag.
const ( PetstorePetUpdateFormStatusAvailable PetstorePetUpdateFormStatus = "available" PetstorePetUpdateFormStatusPending PetstorePetUpdateFormStatus = "pending" PetstorePetUpdateFormStatusSold PetstorePetUpdateFormStatus = "sold" )
func (PetstorePetUpdateFormStatus) IsValid ¶
func (v PetstorePetUpdateFormStatus) IsValid() bool
type PetstorePetUpdateStatus ¶
type PetstorePetUpdateStatus string
PetstorePetUpdateStatus represents the allowed values for the Status flag.
const ( PetstorePetUpdateStatusAvailable PetstorePetUpdateStatus = "available" PetstorePetUpdateStatusPending PetstorePetUpdateStatus = "pending" PetstorePetUpdateStatusSold PetstorePetUpdateStatus = "sold" )
func (PetstorePetUpdateStatus) IsValid ¶
func (v PetstorePetUpdateStatus) IsValid() bool
type PetstorePetUploadImageArgs ¶
type PetstorePetUploadImageArgs struct {
PathToFile string
}
PetstorePetUploadImageArgs holds the positional arguments for the PetstorePetUploadImage action.
type PetstorePetUploadImageFlags ¶
PetstorePetUploadImageFlags holds the flag values for the PetstorePetUploadImage action.
type PetstoreStoreOrderDeleteArgs ¶
type PetstoreStoreOrderDeleteArgs struct {
Id string
}
PetstoreStoreOrderDeleteArgs holds the positional arguments for the PetstoreStoreOrderDelete action.
type PetstoreStoreOrderGetFlags ¶
type PetstoreStoreOrderGetFlags struct {
Id int64
}
PetstoreStoreOrderGetFlags holds the flag values for the PetstoreStoreOrderGet action.
type PetstoreStoreOrderPlaceArgs ¶
type PetstoreStoreOrderPlaceArgs struct {
PathToOrderBody string
}
PetstoreStoreOrderPlaceArgs holds the positional arguments for the PetstoreStoreOrderPlace action.
type PetstoreStoreOrderPlaceFlags ¶
type PetstoreStoreOrderPlaceFlags struct {
PetId int64
Quantity int64
Status PetstoreStoreOrderPlaceStatus
Complete bool
}
PetstoreStoreOrderPlaceFlags holds the flag values for the PetstoreStoreOrderPlace action.
type PetstoreStoreOrderPlaceStatus ¶
type PetstoreStoreOrderPlaceStatus string
PetstoreStoreOrderPlaceStatus represents the allowed values for the Status flag.
const ( PetstoreStoreOrderPlaceStatusPlaced PetstoreStoreOrderPlaceStatus = "placed" PetstoreStoreOrderPlaceStatusApproved PetstoreStoreOrderPlaceStatus = "approved" PetstoreStoreOrderPlaceStatusDelivered PetstoreStoreOrderPlaceStatus = "delivered" )
func (PetstoreStoreOrderPlaceStatus) IsValid ¶
func (v PetstoreStoreOrderPlaceStatus) IsValid() bool
type PetstoreUserCreateArgs ¶
type PetstoreUserCreateArgs struct {
PathToUserBody string
}
PetstoreUserCreateArgs holds the positional arguments for the PetstoreUserCreate action.
type PetstoreUserCreateFlags ¶
type PetstoreUserCreateFlags struct {
Username string
FirstName string
LastName string
Email string
Password string
Phone string
Status int64
}
PetstoreUserCreateFlags holds the flag values for the PetstoreUserCreate action.
type PetstoreUserCreateWithListArgs ¶
type PetstoreUserCreateWithListArgs struct {
PathToUsersBody string
}
PetstoreUserCreateWithListArgs holds the positional arguments for the PetstoreUserCreateWithList action.
type PetstoreUserDeleteFlags ¶
type PetstoreUserDeleteFlags struct {
Username string
}
PetstoreUserDeleteFlags holds the flag values for the PetstoreUserDelete action.
type PetstoreUserGetFlags ¶
type PetstoreUserGetFlags struct {
Username string
}
PetstoreUserGetFlags holds the flag values for the PetstoreUserGet action.
type PetstoreUserLoginFlags ¶
PetstoreUserLoginFlags holds the flag values for the PetstoreUserLogin action.
type PetstoreUserUpdateFlags ¶
type PetstoreUserUpdateFlags struct {
Username string
FirstName string
LastName string
Email string
Password string
Phone string
UserStatus int64
}
PetstoreUserUpdateFlags holds the flag values for the PetstoreUserUpdate action.
type Terminal ¶
type Terminal interface {
IsTerminalOutput() bool
Is256ColorSupported() bool
IsTrueColorSupported() bool
Theme() string
Size() (int, int, error)
}
Terminal provides terminal capability detection.
type UsageFunc ¶
type UsageFunc func() error
UsageFunc is a function that renders the usage for a command.
type ValidationError ¶
type ValidationError struct {
Message string
}
ValidationError represents an error that occurred during action validation.
func NewValidationError ¶
func NewValidationError(message string) *ValidationError
NewValidationError creates a new ValidationError.
func (ValidationError) Error ¶
func (err ValidationError) Error() string
Source Files
¶
- actions.gen.go
- cmd_petstore.gen.go
- cmd_petstore_list.gen.go
- cmd_petstore_pet.gen.go
- cmd_petstore_pet_add.gen.go
- cmd_petstore_pet_delete.gen.go
- cmd_petstore_pet_findbystatus.gen.go
- cmd_petstore_pet_findbytags.gen.go
- cmd_petstore_pet_get.gen.go
- cmd_petstore_pet_update.gen.go
- cmd_petstore_pet_updateform.gen.go
- cmd_petstore_pet_uploadimage.gen.go
- cmd_petstore_store.gen.go
- cmd_petstore_store_inventory.gen.go
- cmd_petstore_store_order.gen.go
- cmd_petstore_store_order_delete.gen.go
- cmd_petstore_store_order_get.gen.go
- cmd_petstore_store_order_place.gen.go
- cmd_petstore_user.gen.go
- cmd_petstore_user_create.gen.go
- cmd_petstore_user_createwithlist.gen.go
- cmd_petstore_user_delete.gen.go
- cmd_petstore_user_get.gen.go
- cmd_petstore_user_login.gen.go
- cmd_petstore_user_logout.gen.go
- cmd_petstore_user_update.gen.go
- errors.gen.go
- help.gen.go
- iostreams.gen.go
- params.gen.go
- run.go