Documentation
¶
Index ¶
- Constants
- func WithInstanceConfig(ctx context.Context, smtp conf.SMTPConfiguration, config *conf.Configuration, ...) (context.Context, error)
- type API
- func (a *API) AddressDelete(w http.ResponseWriter, r *http.Request) error
- func (a *API) AddressList(w http.ResponseWriter, r *http.Request) error
- func (a *API) AddressView(w http.ResponseWriter, r *http.Request) error
- func (a *API) ClaimOrders(w http.ResponseWriter, r *http.Request) error
- func (a *API) CouponList(w http.ResponseWriter, r *http.Request) error
- func (a *API) CouponView(w http.ResponseWriter, r *http.Request) error
- func (a *API) CreateInstance(w http.ResponseWriter, r *http.Request) error
- func (a *API) CreateNewAddress(w http.ResponseWriter, r *http.Request) error
- func (a *API) DB(r *http.Request) *gorm.DB
- func (a *API) DeleteInstance(w http.ResponseWriter, r *http.Request) error
- func (a *API) DownloadList(w http.ResponseWriter, r *http.Request) error
- func (a *API) DownloadRefresh(w http.ResponseWriter, r *http.Request) error
- func (a *API) DownloadURL(w http.ResponseWriter, r *http.Request) error
- func (a *API) GetAppManifest(w http.ResponseWriter, r *http.Request) error
- func (a *API) GetInstance(w http.ResponseWriter, r *http.Request) error
- func (a *API) HealthCheck(w http.ResponseWriter, r *http.Request) error
- func (a *API) ListenAndServe(hostAndPort string)
- func (a *API) OrderCreate(w http.ResponseWriter, r *http.Request) error
- func (a *API) OrderList(w http.ResponseWriter, r *http.Request) error
- func (a *API) OrderUpdate(w http.ResponseWriter, r *http.Request) error
- func (a *API) OrderView(w http.ResponseWriter, r *http.Request) error
- func (a *API) PaymentConfirm(w http.ResponseWriter, r *http.Request) error
- func (a *API) PaymentCreate(w http.ResponseWriter, r *http.Request) error
- func (a *API) PaymentList(w http.ResponseWriter, r *http.Request) error
- func (a *API) PaymentListForOrder(w http.ResponseWriter, r *http.Request) error
- func (a *API) PaymentListForUser(w http.ResponseWriter, r *http.Request) error
- func (a *API) PaymentRefund(w http.ResponseWriter, r *http.Request) error
- func (a *API) PaymentView(w http.ResponseWriter, r *http.Request) error
- func (a *API) PreauthorizePayment(w http.ResponseWriter, r *http.Request) error
- func (a *API) ProductsReport(w http.ResponseWriter, r *http.Request) error
- func (a *API) ReceiptView(w http.ResponseWriter, r *http.Request) error
- func (a *API) ResendOrderReceipt(w http.ResponseWriter, r *http.Request) error
- func (a *API) SalesReport(w http.ResponseWriter, r *http.Request) error
- func (a *API) UpdateInstance(w http.ResponseWriter, r *http.Request) error
- func (a *API) UserBulkDelete(w http.ResponseWriter, r *http.Request) error
- func (a *API) UserDelete(w http.ResponseWriter, r *http.Request) error
- func (a *API) UserList(w http.ResponseWriter, r *http.Request) error
- func (a *API) UserView(w http.ResponseWriter, r *http.Request) error
- func (a *API) VatNumberLookup(w http.ResponseWriter, r *http.Request) error
- func (a *API) ViewSettings(w http.ResponseWriter, r *http.Request) error
- type HTTPError
- type InstanceRequestParams
- type InstanceResponse
- type NetlifyMicroserviceClaims
- type PaymentParams
Constants ¶
const MaxConcurrentLookups = 10
MaxConcurrentLookups controls the number of simultaneous HTTP Order lookups
Variables ¶
This section is empty.
Functions ¶
func WithInstanceConfig ¶ added in v1.1.2
func WithInstanceConfig(ctx context.Context, smtp conf.SMTPConfiguration, config *conf.Configuration, instanceID string) (context.Context, error)
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API is the main REST API
func NewAPI ¶
func NewAPI(globalConfig *conf.GlobalConfiguration, log logrus.FieldLogger, db *gorm.DB) *API
NewAPI instantiates a new REST API using the default version.
func NewAPIWithVersion ¶ added in v1.0.0
func NewAPIWithVersion(ctx context.Context, globalConfig *conf.GlobalConfiguration, log logrus.FieldLogger, db *gorm.DB, version string) *API
NewAPIWithVersion instantiates a new REST API.
func (*API) AddressDelete ¶ added in v0.2.0
AddressDelete will soft delete the address associated with that user. It requires admin access return errors or 200 and no body
func (*API) AddressList ¶ added in v0.2.0
AddressList will return the addresses for a given user
func (*API) AddressView ¶ added in v0.2.0
AddressView will return a particular address for a given user
func (*API) ClaimOrders ¶ added in v1.0.0
ClaimOrders will look for any orders with no user id belonging to an email and claim them
func (*API) CouponList ¶ added in v1.2.1
CouponList returns all the coupons for the site. Requires admin permissions
func (*API) CouponView ¶ added in v1.1.0
CouponView returns information about a single coupon code.
func (*API) CreateInstance ¶ added in v1.1.2
func (*API) CreateNewAddress ¶ added in v0.2.0
CreateNewAddress will create an address associated with that user
func (*API) DB ¶ added in v1.7.2
DB provides callers with a database instance configured for request logging
func (*API) DeleteInstance ¶ added in v1.1.2
func (*API) DownloadList ¶ added in v1.1.0
DownloadList lists all purchased downloads for an order or a user.
func (*API) DownloadRefresh ¶ added in v1.7.2
DownloadRefresh makes sure downloads are up to date
func (*API) DownloadURL ¶ added in v1.1.0
DownloadURL returns a signed URL to download a purchased asset.
func (*API) GetAppManifest ¶ added in v1.1.2
func (*API) GetInstance ¶ added in v1.1.2
func (*API) HealthCheck ¶ added in v1.1.2
HealthCheck endpoint
func (*API) ListenAndServe ¶
ListenAndServe starts the REST API.
func (*API) OrderCreate ¶
OrderCreate endpoint
func (*API) OrderUpdate ¶ added in v0.2.0
OrderUpdate will allow an ADMIN only to update the details of a record it is also important to note that it will not let modification of an order if the order is no longer pending. Addresses can be made by posting a new one directly, OR by referencing one by ID. If both are provided, the one that is made by ID will win out and the other will be ignored. There are also blocks to changing certain fields after the state has been locked
func (*API) OrderView ¶
OrderView will request a specific order using the 'id' parameter. Only the owner of the order, an admin, or an anon order are allowed to be seen
func (*API) PaymentConfirm ¶ added in v1.7.1
PaymentConfirm allows client to confirm if a pending transaction has been completed. Updates transaction and order
func (*API) PaymentCreate ¶
PaymentCreate is the endpoint for creating a payment for an order
func (*API) PaymentList ¶
PaymentList will list all the payments that meet the criteria. It is only available to admins.
func (*API) PaymentListForOrder ¶ added in v0.2.0
PaymentListForOrder is the endpoint for listing transactions for an order. You must be the owner of the order (user_id) or an admin. Listing the payments for an anon order.
func (*API) PaymentListForUser ¶ added in v0.2.0
PaymentListForUser is the endpoint for listing transactions for a user. The ID in the claim and the ID in the path must match (or have admin override)
func (*API) PaymentRefund ¶ added in v0.2.0
PaymentRefund refunds a transaction for a specific amount. This allows partial refunds if desired. It is only available to admins.
func (*API) PaymentView ¶ added in v0.2.0
PaymentView returns information about a single payment. It is only available to admins.
func (*API) PreauthorizePayment ¶ added in v1.1.2
PreauthorizePayment creates a new payment that can be authorized in the browser
func (*API) ProductsReport ¶ added in v1.1.0
ProductsReport list the products sold within a period
func (*API) ReceiptView ¶ added in v1.1.2
ReceiptView renders an HTML receipt for an order
func (*API) ResendOrderReceipt ¶ added in v1.1.0
ResendOrderReceipt resends the email receipt for an order
func (*API) SalesReport ¶ added in v1.1.0
SalesReport lists the sales numbers for a period
func (*API) UpdateInstance ¶ added in v1.1.2
func (*API) UserBulkDelete ¶ added in v1.5.0
func (*API) UserDelete ¶ added in v0.2.0
UserDelete will soft delete the user. It requires admin access return errors or 200 and no body
func (*API) UserList ¶ added in v0.2.0
UserList will return all of the users. It requires admin access. It supports the filters: since iso8601 date before iso8601 date email email user_id id limit # of records to return (max)
func (*API) UserView ¶ added in v0.2.0
UserView will return the user specified. If you're an admin you can request a user that is not your self
func (*API) VatNumberLookup ¶ added in v1.1.2
VatNumberLookup looks up information on a VAT number
func (*API) ViewSettings ¶ added in v1.2.1
type HTTPError ¶
type HTTPError struct { Code int `json:"code"` Message string `json:"msg"` InternalError error `json:"-"` InternalMessage string `json:"-"` ErrorID string `json:"error_id,omitempty"` }
HTTPError is an error with a message and an HTTP status code.
func (*HTTPError) WithInternalError ¶ added in v1.1.2
WithInternalError adds internal error information to the error
func (*HTTPError) WithInternalMessage ¶ added in v1.1.2
WithInternalMessage adds internal message information to the error
type InstanceRequestParams ¶ added in v1.1.2
type InstanceRequestParams struct { UUID string `json:"uuid"` BaseConfig *conf.Configuration `json:"config"` }
type InstanceResponse ¶ added in v1.1.2
type NetlifyMicroserviceClaims ¶ added in v1.1.2
type NetlifyMicroserviceClaims struct { SiteURL string `json:"site_url"` InstanceID string `json:"id"` NetlifyID string `json:"netlify_id"` jwt.StandardClaims }