Documentation ¶
Index ¶
- Constants
- func CreatePagesTable(db *sql.DB)
- func GetPageData[T any](name string, db *sql.DB) (T, error)
- func HandleContactFormRequest[FormType Validatable](mail Mail, templateCollection *template.Template, subjectTemplate string, ...) http.HandlerFunc
- func HtmlTemplateHandler[T any](pageTemplates *template.Template, templatePath string, dataGetter func() T) http.HandlerFunc
- func InitTemplates(templateFS embed.FS, templateBasePath string) *template.Template
- func InsertPageData[T any](name string, page T, db *sql.DB) (int64, error)
- func MakePageDataGetter[T any](name string, db *sql.DB) func() T
- func UpdatePageData[T any](name string, page T, db *sql.DB) error
- type Mail
- type Product
- type Square
- type SquareBasePrice
- type SquareCheckoutOptions
- type SquareCheckoutRequest
- type SquareLineItem
- type SquareOrder
- type SquareResponse
- type SquareTax
- type Validatable
Constants ¶
View Source
const SplitScroll string = `` /* 1245-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func CreatePagesTable ¶ added in v0.0.24
func HandleContactFormRequest ¶ added in v0.0.16
func HandleContactFormRequest[FormType Validatable](mail Mail, templateCollection *template.Template, subjectTemplate string, emailTemplate string, thankYouTemplate string) http.HandlerFunc
func HtmlTemplateHandler ¶ added in v0.0.14
func InitTemplates ¶
func InsertPageData ¶ added in v0.0.24
func MakePageDataGetter ¶ added in v0.0.24
Types ¶
type Square ¶ added in v0.0.18
type SquareBasePrice ¶ added in v0.0.18
type SquareCheckoutOptions ¶ added in v0.0.18
type SquareCheckoutOptions struct {
RedirectUrl string `json:"redirect_url"`
}
type SquareCheckoutRequest ¶ added in v0.0.18
type SquareCheckoutRequest struct { IdempotencyKey string `json:"idempotency_key"` Order SquareOrder `json:"order"` CheckoutOptions SquareCheckoutOptions `json:"checkout_options"` }
type SquareLineItem ¶ added in v0.0.18
type SquareLineItem struct { Quantity string `json:"quantity"` BasePriceMoney SquareBasePrice `json:"base_price_money"` Name string `json:"name"` }
type SquareOrder ¶ added in v0.0.18
type SquareOrder struct { LocationId string `json:"location_id"` LineItems []SquareLineItem `json:"line_items"` Tax []SquareTax `json:"taxes"` }
type SquareResponse ¶ added in v0.0.18
type SquareResponse struct { PaymentLink struct { ID string `json:"id"` Version int `json:"version"` OrderID string `json:"order_id"` CheckoutOptions struct { RedirectURL string `json:"redirect_url"` } `json:"checkout_options"` URL string `json:"url"` LongURL string `json:"long_url"` CreatedAt time.Time `json:"created_at"` } `json:"payment_link"` RelatedResources struct { Orders []struct { ID string `json:"id"` LocationID string `json:"location_id"` Source struct { Name string `json:"name"` } `json:"source"` LineItems []struct { UID string `json:"uid"` Name string `json:"name"` Quantity string `json:"quantity"` ItemType string `json:"item_type"` BasePriceMoney struct { Amount int `json:"amount"` Currency string `json:"currency"` } `json:"base_price_money"` VariationTotalPriceMoney struct { Amount int `json:"amount"` Currency string `json:"currency"` } `json:"variation_total_price_money"` GrossSalesMoney struct { Amount int `json:"amount"` Currency string `json:"currency"` } `json:"gross_sales_money"` TotalTaxMoney struct { Amount int `json:"amount"` Currency string `json:"currency"` } `json:"total_tax_money"` TotalDiscountMoney struct { Amount int `json:"amount"` Currency string `json:"currency"` } `json:"total_discount_money"` TotalMoney struct { Amount int `json:"amount"` Currency string `json:"currency"` } `json:"total_money"` TotalServiceChargeMoney struct { Amount int `json:"amount"` Currency string `json:"currency"` } `json:"total_service_charge_money"` } `json:"line_items"` Fulfillments []struct { UID string `json:"uid"` Type string `json:"type"` State string `json:"state"` } `json:"fulfillments"` NetAmounts struct { TotalMoney struct { Amount int `json:"amount"` Currency string `json:"currency"` } `json:"total_money"` TaxMoney struct { Amount int `json:"amount"` Currency string `json:"currency"` } `json:"tax_money"` DiscountMoney struct { Amount int `json:"amount"` Currency string `json:"currency"` } `json:"discount_money"` TipMoney struct { Amount int `json:"amount"` Currency string `json:"currency"` } `json:"tip_money"` ServiceChargeMoney struct { Amount int `json:"amount"` Currency string `json:"currency"` } `json:"service_charge_money"` } `json:"net_amounts"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` State string `json:"state"` Version int `json:"version"` TotalMoney struct { Amount int `json:"amount"` Currency string `json:"currency"` } `json:"total_money"` TotalTaxMoney struct { Amount int `json:"amount"` Currency string `json:"currency"` } `json:"total_tax_money"` TotalDiscountMoney struct { Amount int `json:"amount"` Currency string `json:"currency"` } `json:"total_discount_money"` TotalTipMoney struct { Amount int `json:"amount"` Currency string `json:"currency"` } `json:"total_tip_money"` TotalServiceChargeMoney struct { Amount int `json:"amount"` Currency string `json:"currency"` } `json:"total_service_charge_money"` NetAmountDueMoney struct { Amount int `json:"amount"` Currency string `json:"currency"` } `json:"net_amount_due_money"` } `json:"orders"` } `json:"related_resources"` }
type Validatable ¶ added in v0.0.29
type Validatable interface {
Validate() bool
}
Click to show internal directories.
Click to hide internal directories.