Documentation
¶
Index ¶
- Constants
- type Adapter
- type App
- type AppAdapter
- type AppBase
- func (a AppBase) GetAppBase() AppBase
- func (a AppBase) GetDescription() *string
- func (a AppBase) GetID() AppID
- func (a AppBase) GetListing() MarketplaceListing
- func (a AppBase) GetMetadata() map[string]string
- func (a AppBase) GetName() string
- func (a AppBase) GetStatus() AppStatus
- func (a AppBase) GetType() AppType
- func (a AppBase) Validate() error
- func (a AppBase) ValidateCapabilities(capabilities ...CapabilityType) error
- type AppConflictError
- type AppCustomerPreConditionError
- type AppDefaultNotFoundError
- type AppFactory
- type AppFactoryInstallAppWithAPIKeyInput
- type AppID
- type AppNotFoundError
- type AppProviderAuthenticationError
- type AppProviderError
- type AppProviderPreConditionError
- type AppService
- type AppStatus
- type AppType
- type AuthorizeOauth2InstallInput
- type Capability
- type CapabilityType
- type CreateAppInput
- type CustomerApp
- type CustomerData
- type DeleteAppInstanceCustomerDataInput
- type DeleteCustomerInput
- type EnsureCustomerInput
- type GetAppInput
- type GetAppInstanceCustomerDataInput
- type GetDefaultAppInput
- type GetOauth2InstallURLInput
- type GetOauth2InstallURLOutput
- type InstallAppWithAPIKeyInput
- type ListAppInput
- type ListCustomerInput
- type MarketplaceGetInput
- type MarketplaceListInput
- type MarketplaceListing
- type MarketplaceListingID
- type MarketplaceListingNotFoundError
- type RegisterMarketplaceListingInput
- type RegistryItem
- type Service
- type UninstallAppInput
- type UpdateAppInput
- type UpdateAppStatusInput
- type UpsertAppInstanceCustomerDataInput
- type ValidationError
Constants ¶
View Source
const ( DefaultPageNumber = 1 DefaultPageSize = 100 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter interface { AppAdapter entutils.TxCreator }
type App ¶
type App interface { GetAppBase() AppBase GetID() AppID GetType() AppType GetName() string GetDescription() *string GetStatus() AppStatus GetMetadata() map[string]string GetListing() MarketplaceListing // ValidateCapabilities validates if the app can run for the given capabilities ValidateCapabilities(capabilities ...CapabilityType) error // Customer data GetCustomerData(ctx context.Context, input GetAppInstanceCustomerDataInput) (CustomerData, error) UpsertCustomerData(ctx context.Context, input UpsertAppInstanceCustomerDataInput) error DeleteCustomerData(ctx context.Context, input DeleteAppInstanceCustomerDataInput) error }
App represents an installed app
type AppAdapter ¶
type AppAdapter interface { // Marketplace RegisterMarketplaceListing(input RegisterMarketplaceListingInput) error GetMarketplaceListing(ctx context.Context, input MarketplaceGetInput) (RegistryItem, error) ListMarketplaceListings(ctx context.Context, input MarketplaceListInput) (pagination.PagedResponse[RegistryItem], error) InstallMarketplaceListingWithAPIKey(ctx context.Context, input InstallAppWithAPIKeyInput) (App, error) GetMarketplaceListingOauth2InstallURL(ctx context.Context, input GetOauth2InstallURLInput) (GetOauth2InstallURLOutput, error) AuthorizeMarketplaceListingOauth2Install(ctx context.Context, input AuthorizeOauth2InstallInput) error // Installed app CreateApp(ctx context.Context, input CreateAppInput) (AppBase, error) GetApp(ctx context.Context, input GetAppInput) (App, error) GetDefaultApp(ctx context.Context, input GetDefaultAppInput) (App, error) UpdateApp(ctx context.Context, input UpdateAppInput) (App, error) ListApps(ctx context.Context, input ListAppInput) (pagination.PagedResponse[App], error) UninstallApp(ctx context.Context, input UninstallAppInput) error UpdateAppStatus(ctx context.Context, input UpdateAppStatusInput) error // Customer data ListCustomerData(ctx context.Context, input ListCustomerInput) (pagination.PagedResponse[CustomerApp], error) EnsureCustomer(ctx context.Context, input EnsureCustomerInput) error DeleteCustomer(ctx context.Context, input DeleteCustomerInput) error }
type AppBase ¶
type AppBase struct { models.ManagedResource Type AppType `json:"type"` Status AppStatus `json:"status"` Default bool `json:"default"` Listing MarketplaceListing `json:"listing"` Metadata map[string]string `json:"metadata,omitempty"` }
AppBase represents an abstract with the base fields of an app
func (AppBase) GetAppBase ¶
func (AppBase) GetDescription ¶
func (AppBase) GetListing ¶
func (a AppBase) GetListing() MarketplaceListing
func (AppBase) GetMetadata ¶
func (AppBase) ValidateCapabilities ¶
func (a AppBase) ValidateCapabilities(capabilities ...CapabilityType) error
ValidateCapabilities validates if the app can run for the given capabilities
type AppConflictError ¶
func (AppConflictError) Error ¶
func (e AppConflictError) Error() string
func (AppConflictError) Validate ¶
func (e AppConflictError) Validate() error
type AppCustomerPreConditionError ¶
type AppCustomerPreConditionError struct { AppID AppType AppType CustomerID customer.CustomerID Condition string }
func (AppCustomerPreConditionError) Error ¶
func (e AppCustomerPreConditionError) Error() string
func (AppCustomerPreConditionError) Validate ¶
func (e AppCustomerPreConditionError) Validate() error
type AppDefaultNotFoundError ¶
func (AppDefaultNotFoundError) Error ¶
func (e AppDefaultNotFoundError) Error() string
type AppFactory ¶
type AppFactoryInstallAppWithAPIKeyInput ¶
type AppFactoryInstallAppWithAPIKeyInput struct { Namespace string APIKey string BaseURL string Name string }
func (AppFactoryInstallAppWithAPIKeyInput) Validate ¶
func (i AppFactoryInstallAppWithAPIKeyInput) Validate() error
type AppNotFoundError ¶
type AppNotFoundError struct {
AppID
}
func (AppNotFoundError) Error ¶
func (e AppNotFoundError) Error() string
type AppProviderAuthenticationError ¶
func (AppProviderAuthenticationError) Error ¶
func (e AppProviderAuthenticationError) Error() string
type AppProviderError ¶
func (AppProviderError) Error ¶
func (e AppProviderError) Error() string
type AppProviderPreConditionError ¶
func (AppProviderPreConditionError) Error ¶
func (e AppProviderPreConditionError) Error() string
func (AppProviderPreConditionError) Validate ¶
func (e AppProviderPreConditionError) Validate() error
type AppService ¶
type AppService interface { // Marketplace RegisterMarketplaceListing(input RegisterMarketplaceListingInput) error GetMarketplaceListing(ctx context.Context, input MarketplaceGetInput) (RegistryItem, error) ListMarketplaceListings(ctx context.Context, input MarketplaceListInput) (pagination.PagedResponse[RegistryItem], error) InstallMarketplaceListingWithAPIKey(ctx context.Context, input InstallAppWithAPIKeyInput) (App, error) GetMarketplaceListingOauth2InstallURL(ctx context.Context, input GetOauth2InstallURLInput) (GetOauth2InstallURLOutput, error) AuthorizeMarketplaceListingOauth2Install(ctx context.Context, input AuthorizeOauth2InstallInput) error // Installed app CreateApp(ctx context.Context, input CreateAppInput) (AppBase, error) GetApp(ctx context.Context, input GetAppInput) (App, error) UpdateAppStatus(ctx context.Context, input UpdateAppStatusInput) error GetDefaultApp(ctx context.Context, input GetDefaultAppInput) (App, error) UpdateApp(ctx context.Context, input UpdateAppInput) (App, error) ListApps(ctx context.Context, input ListAppInput) (pagination.PagedResponse[App], error) UninstallApp(ctx context.Context, input UninstallAppInput) error // Customer data ListCustomerData(ctx context.Context, input ListCustomerInput) (pagination.PagedResponse[CustomerApp], error) EnsureCustomer(ctx context.Context, input EnsureCustomerInput) error DeleteCustomer(ctx context.Context, input DeleteCustomerInput) error }
type AppStatus ¶
type AppStatus string
AppStatus represents the status of an app
const ( AppStatusReady AppStatus = "ready" )
type AuthorizeOauth2InstallInput ¶
type AuthorizeOauth2InstallInput struct { MarketplaceListingID Code string // Success response fields State string // Error response fields Error string ErrorDescription string ErrorURI string }
func (AuthorizeOauth2InstallInput) Validate ¶
func (i AuthorizeOauth2InstallInput) Validate() error
type Capability ¶
type Capability struct { Type CapabilityType `json:"type"` Key string `json:"key"` Name string `json:"name"` Description string `json:"description"` }
func (Capability) Validate ¶
func (c Capability) Validate() error
type CapabilityType ¶
type CapabilityType string
const ( CapabilityTypeReportUsage CapabilityType = "reportUsage" CapabilityTypeReportEvents CapabilityType = "reportEvents" CapabilityTypeCalculateTax CapabilityType = "calculateTax" CapabilityTypeInvoiceCustomers CapabilityType = "invoiceCustomers" CapabilityTypeCollectPayments CapabilityType = "collectPayments" )
type CreateAppInput ¶
type CreateAppInput struct { // AppID is optional. If not provided, a new AppID will be generated by the database ID *AppID Namespace string Name string Description string Type AppType }
CreateAppInput is the input for creating an app
func (CreateAppInput) Validate ¶
func (i CreateAppInput) Validate() error
type CustomerApp ¶
type CustomerApp struct { App App CustomerData CustomerData }
type CustomerData ¶
type CustomerData interface {
Validate() error
}
type DeleteAppInstanceCustomerDataInput ¶
type DeleteAppInstanceCustomerDataInput struct {
CustomerID customer.CustomerID
}
func (DeleteAppInstanceCustomerDataInput) Validate ¶
func (i DeleteAppInstanceCustomerDataInput) Validate() error
type DeleteCustomerInput ¶
type DeleteCustomerInput struct { AppID *AppID CustomerID *customer.CustomerID }
func (DeleteCustomerInput) Validate ¶
func (a DeleteCustomerInput) Validate() error
type EnsureCustomerInput ¶
type EnsureCustomerInput struct { AppID AppID CustomerID customer.CustomerID }
func (EnsureCustomerInput) Validate ¶
func (a EnsureCustomerInput) Validate() error
type GetAppInstanceCustomerDataInput ¶
type GetAppInstanceCustomerDataInput struct {
CustomerID customer.CustomerID
}
func (GetAppInstanceCustomerDataInput) Validate ¶
func (i GetAppInstanceCustomerDataInput) Validate() error
type GetDefaultAppInput ¶
GetAppInput is the input for getting the default app for a type
func (GetDefaultAppInput) Validate ¶
func (i GetDefaultAppInput) Validate() error
type GetOauth2InstallURLInput ¶
type GetOauth2InstallURLInput = MarketplaceListingID
type GetOauth2InstallURLOutput ¶
type GetOauth2InstallURLOutput struct {
URL string
}
type InstallAppWithAPIKeyInput ¶
type InstallAppWithAPIKeyInput struct { MarketplaceListingID Namespace string APIKey string Name string }
func (InstallAppWithAPIKeyInput) Validate ¶
func (i InstallAppWithAPIKeyInput) Validate() error
type ListAppInput ¶
type ListAppInput struct { Namespace string pagination.Page Type *AppType IncludeDeleted bool // Only list apps that has data for the given customer CustomerID *customer.CustomerID }
ListAppInput is the input for listing installed apps
func (ListAppInput) Validate ¶
func (i ListAppInput) Validate() error
type ListCustomerInput ¶
type ListCustomerInput struct { pagination.Page CustomerID customer.CustomerID Type *AppType }
func (ListCustomerInput) Validate ¶
func (a ListCustomerInput) Validate() error
type MarketplaceGetInput ¶
type MarketplaceGetInput = MarketplaceListingID
type MarketplaceListInput ¶
type MarketplaceListInput struct {
pagination.Page
}
func (MarketplaceListInput) Validate ¶
func (i MarketplaceListInput) Validate() error
type MarketplaceListing ¶
type MarketplaceListing struct { Type AppType `json:"type"` Name string `json:"name"` Description string `json:"description"` Capabilities []Capability `json:"capabilities"` }
func (MarketplaceListing) Validate ¶
func (p MarketplaceListing) Validate() error
type MarketplaceListingID ¶
type MarketplaceListingID struct {
Type AppType
}
func (MarketplaceListingID) Validate ¶
func (i MarketplaceListingID) Validate() error
type MarketplaceListingNotFoundError ¶
type MarketplaceListingNotFoundError struct {
MarketplaceListingID
}
func (MarketplaceListingNotFoundError) Error ¶
func (e MarketplaceListingNotFoundError) Error() string
type RegisterMarketplaceListingInput ¶
type RegisterMarketplaceListingInput = RegistryItem
type RegistryItem ¶
type RegistryItem struct { Listing MarketplaceListing Factory AppFactory }
func (RegistryItem) Validate ¶
func (r RegistryItem) Validate() error
type Service ¶
type Service interface { AppService }
type UninstallAppInput ¶
type UninstallAppInput = AppID
type UpdateAppInput ¶
type UpdateAppInput struct { AppID AppID Name string Description *string Default bool Metadata *map[string]string }
UpdateAppInput is the input for setting an app as default for a type
func (UpdateAppInput) Validate ¶
func (i UpdateAppInput) Validate() error
type UpdateAppStatusInput ¶
UpdateAppStatusInput is the input for updating an app status
func (UpdateAppStatusInput) Validate ¶
func (i UpdateAppStatusInput) Validate() error
type UpsertAppInstanceCustomerDataInput ¶
type UpsertAppInstanceCustomerDataInput struct { CustomerID customer.CustomerID Data CustomerData }
func (UpsertAppInstanceCustomerDataInput) Validate ¶
func (i UpsertAppInstanceCustomerDataInput) Validate() error
type ValidationError ¶
type ValidationError genericError
func (ValidationError) Error ¶
func (e ValidationError) Error() string
func (ValidationError) Unwrap ¶
func (e ValidationError) Unwrap() error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.