types

package
v1.36.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MediaVideo      MediaType = "video"
	MediaImage                = "image"
	MediaLiveStream           = "livestream"
	MediaWebGL                = "webgl"
	MediaAudio                = "audio"
	MediaEmbed                = "embed"
)
View Source
const (
	MassLbs   MassUnit = "lb"
	MassKilo           = "kg"
	MassGrams          = "g"
)

Variables

View Source
var BuyerEmailOrPhoneRequired = errors.New("Buyer's Email or Phone is required.")

Functions

func DisplayPrice

func DisplayPrice(t currency.Type, price currency.Cents) string

func DisplayTitle

func DisplayTitle(title string) string

Non-breaking hyphens in title

func FloatPrice

func FloatPrice(price currency.Cents) float64

func SplitParagraph

func SplitParagraph(text string) []string

Types

type Address

type Address struct {
	Name       string `json:"name,omitempty"`
	Line1      string `json:"line1,omitempty"`
	Line2      string `json:"line2,omitempty"`
	City       string `json:"city,omitempty"`
	State      string `json:"state,omitempty"`
	PostalCode string `json:"postalCode,omitempty"`
	Country    string `json:"country,omitempty"`
}

func (Address) Empty

func (a Address) Empty() bool

func (Address) Line

func (a Address) Line() string

type Adjustment

type Adjustment struct {
	// Possible values: flat.
	Type string `json:"type"`
	// Reasoning for price adjustment.
	Reason string `json:"reason"`
	// Authorizer of price adjustment.
	Issuer string `json:"issuer"`
	// Amount of price adjustment.
	Amount currency.Cents `json:"amount"`
}

type Availability

type Availability struct {
	Active    bool      `json:"active"`
	StartDate time.Time `json:"startDate"`
	EndDate   time.Time `json:"endDate"`
}

type Buyer

type Buyer struct {
	Email     string `json:"email,omitempty"`
	UserId    string `json:"userId,omitempty"`
	FirstName string `json:"firstName,omitempty"`
	LastName  string `json:"lastName,omitempty"`
	Company   string `json:"company,omitempty"`
	Phone     string `json:"phone,omitempty"`
	// Address   Address `json:"address,omitempty"`
	ShippingAddress Address `json:"shippingAddress,omitempty"`
	BillingAddress  Address `json:"billingAddress,omitempty"`
}

func (Buyer) Name

func (b Buyer) Name() string

func (Buyer) Validate

func (b Buyer) Validate() (bool, []error)

type Event

type Event struct {
	Type string `json:"type"`
	Desc string `json:"desc"`
}

type Interval

type Interval string
const (
	Yearly  Interval = "year"
	Monthly Interval = "month"
)

type KYCStatus

type KYCStatus string
const (
	KYCStatusApproved  KYCStatus = "approved"
	KYCStatusDenied    KYCStatus = "denied"
	KYCStatusPending   KYCStatus = "pending"
	KYCStatusInitiated KYCStatus = "initiated"
)

type Map

type Map map[string]interface{}

type MassUnit

type MassUnit string

type Media

type Media struct {
	Type MediaType `json:"type"`
	Alt  string    `json:"alt"`
	Url  string    `json:"url"`
	X    int       `json:"x"`
	Y    int       `json:"y"`
}

func (Media) Dimensions

func (i Media) Dimensions() string

func (Media) Validate

func (i Media) Validate(req *http.Request, errs binding.Errors) binding.Errors

type MediaType

type MediaType string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL