Documentation
¶
Index ¶
- func Execute()
- func WrapCommandWithResources(fn func(cmd *cobra.Command, args []string), resourceConfig ResourceConfig) func(cmd *cobra.Command, args []string)
- type Amazon
- type AppCtx
- type BuildInventoryConfig
- type FBAProduct
- type FTSTitleQuantityRow
- type InventoryFilter
- type ItemRequirements
- type PrepRequirements
- type QueryInventoryConfig
- type ResourceConfig
- type ResourceType
- type ServiceType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WrapCommandWithResources ¶
func WrapCommandWithResources(fn func(cmd *cobra.Command, args []string), resourceConfig ResourceConfig) func(cmd *cobra.Command, args []string)
It takes a command function and resource configuration, then returns a new function that: 1. Initializes required resources (currently supports Amazon SP-API) 2. Sets up authentication and services based on the provided configuration 3. Creates an application context with initialized resources 4. Injects the context into the command before executing the original function
The wrapper will exit early if required Amazon credentials are not set in the configuration.
Types ¶
type AppCtx ¶
func GetApp ¶
GetApp retrieves the application context (AppCtx) from a Cobra command's context. It expects the context to contain an AppCtx value stored with internal.APP_CONTEXT key. The function performs a type assertion to convert the context value to AppCtx.
Panics if the context value cannot be type-asserted to AppCtx
type BuildInventoryConfig ¶
type BuildInventoryConfig struct {
ForceRebuild bool
}
type FBAProduct ¶
type FTSTitleQuantityRow ¶
type InventoryFilter ¶
type ItemRequirements ¶
type ItemRequirements struct {
// PrepOwner indicates the entity responsible for preparing the item for shipment.
PrepOwner fba_inbound.PrepOwner `json:"prep_owner"`
// LabelOwner indicates the entity responsible for labeling the item for shipment.
LabelOwner fba_inbound.LabelOwner `json:"label_owner"`
}
ItemRequirements defines the ownership requirements for item preparation and labeling. It specifies which entities are responsible for preparing and labeling items in a shipment.
type PrepRequirements ¶
type PrepRequirements map[string]ItemRequirements
PrepRequirements is a mapping from preparation ID to the items required for that preparation. It defines the requirements needed for different preparation processes in a shipment.
type QueryInventoryConfig ¶
type ResourceConfig ¶
type ResourceConfig struct {
Resources []ResourceType
Services []ServiceType
}
type ServiceType ¶
type ServiceType int
const ( ServiceCatalog ServiceType = iota ServiceListings ServiceFBAInbound ServiceFBAInventory ServiceProductTypeDefinitions ServiceFeeds )