Documentation ¶
Index ¶
- Constants
- Variables
- type Barcode
- type BarcodeFormat
- type Beacon
- type BoardingPass
- type Coupon
- type DataDetectorType
- type DateStyle
- type EventTicket
- type Field
- type FolderPassTemplate
- type GenericPass
- func (gp *GenericPass) AddAuxiliaryFields(field Field)
- func (gp *GenericPass) AddBackFields(field Field)
- func (gp *GenericPass) AddHeaderField(field Field)
- func (gp *GenericPass) AddPrimaryFields(field Field)
- func (gp *GenericPass) AddSecondaryFields(field Field)
- func (gp *GenericPass) GetValidationErrors() []string
- func (gp *GenericPass) IsValid() bool
- type InMemoryPassTemplate
- func (m *InMemoryPassTemplate) AddAllFiles(directoryWithFilesToAdd string) error
- func (m *InMemoryPassTemplate) AddFileBytes(name string, data []byte)
- func (m *InMemoryPassTemplate) AddFileBytesLocalized(name, locale string, data []byte)
- func (m *InMemoryPassTemplate) AddFileFromURL(name string, u url.URL) error
- func (m *InMemoryPassTemplate) AddFileFromURLLocalized(name, locale string, u url.URL) error
- func (m *InMemoryPassTemplate) GetAllFiles() (map[string][]byte, error)
- func (m *InMemoryPassTemplate) ProvisionPassAtDirectory(tmpDirPath string) error
- type Location
- type NFC
- type NumberStyle
- type PWAssociatedApp
- type Pass
- func (p *Pass) GetValidationErrors() []string
- func (p *Pass) IsValid() bool
- func (p *Pass) SetBackgroundColorHex(hex string) error
- func (p *Pass) SetBackgroundColorRGB(r, g, b uint8) error
- func (p *Pass) SetForegroundColorHex(hex string) error
- func (p *Pass) SetForegroundColorRGB(r, g, b uint8) error
- func (p *Pass) SetLabelColorHex(hex string) error
- func (p *Pass) SetLabelColorRGB(r, g, b uint8) error
- type PassPersonalizationField
- type PassTemplate
- type Personalization
- type Signer
- type SigningInformation
- type StoreCard
- type TextAlignment
- type TransitType
- type Validateable
Constants ¶
View Source
const ( //PKTextAlignment TextAlignmentLeft TextAlignment = "PKTextAlignmentLeft" TextAlignmentCenter TextAlignment = "PKTextAlignmentCenter" TextAlignmentRight TextAlignment = "PKTextAlignmentRight" TextAlignmentNatural TextAlignment = "PKTextAlignmentNatural" //PKBarcodeFormat BarcodeFormatQR BarcodeFormat = "PKBarcodeFormatQR" BarcodeFormatPDF417 BarcodeFormat = "PKBarcodeFormatPDF417" BarcodeFormatAztec BarcodeFormat = "PKBarcodeFormatAztec" BarcodeFormatCode128 BarcodeFormat = "PKBarcodeFormatCode128" //PKDataDetectorType DataDetectorTypePhoneNumber DataDetectorType = "PKDataDetectorTypePhoneNumber" DataDetectorTypeLink DataDetectorType = "PKDataDetectorTypeLink" DataDetectorTypeAddress DataDetectorType = "PKDataDetectorTypeAddress" DataDetectorTypeCalendarEvent DataDetectorType = "PKDataDetectorTypeCalendarEvent" //PKDateStyle DateStyleNone DateStyle = "PKDateStyleNone" DateStyleShort DateStyle = "PKDateStyleShort" DateStyleMedium DateStyle = "PKDateStyleMedium" DateStyleLong DateStyle = "PKDateStyleLong" DateStyleFull DateStyle = "PKDateStyleFull" //PKNumberStyle NumberStyleDecimal NumberStyle = "PKNumberStyleDecimal" NumberStylePercent NumberStyle = "PKNumberStylePercent" NumberStyleScientific NumberStyle = "PKNumberStyleScientific" NumberStyleSpellOut NumberStyle = "PKNumberStyleSpellOut" //PKPassPersonalizationField PassPersonalizationFieldName PassPersonalizationField = "PKPassPersonalizationFieldName" PassPersonalizationFieldPostalCode PassPersonalizationField = "PKPassPersonalizationFieldPostalCode" PassPersonalizationFieldEmailAddress PassPersonalizationField = "PKPassPersonalizationFieldEmailAddress" PassPersonalizationFieldPhoneNumber PassPersonalizationField = "PKPassPersonalizationFieldPhoneNumber" //PKTransitType TransitTypeAir TransitType = "PKTransitTypeAir" TransitTypeBoat TransitType = "PKTransitTypeBoat" TransitTypeBus TransitType = "PKTransitTypeBus" TransitTypeGeneric TransitType = "PKTransitTypeGeneric" TransitTypeTrain TransitType = "PKTransitTypeTrain" )
View Source
const ( BundleIconRetinaHD = "icon@3x.png" BundleIconRetina = "icon@2x.png" BundleIcon = "icon.png" BundleLogoRetinaHD = "logo@3x.png" BundleLogoRetina = "logo@2x.png" BundleLogo = "logo.png" BundleThumbnailRetinaHD = "thumbnail@3x.png" BundleThumbnailRetina = "thumbnail@2x.png" BundleThumbnail = "thumbnail.png" BundleStripRetinaHD = "strip@3x.png" BundleStripRetina = "strip@2x.png" BundleStrip = "strip.png" BundleBackgroundRetinaHD = "background@3x.png" BundleBackgroundRetina = "background@2x.png" BundleBackground = "background.png" BundlePersonalizationLogoRetinaHD = "personalizationLogo@3x.png" BundlePersonalizationLogoRetina = "personalizationLogo@2x.png" BundlePersonalizationLogo = "personalizationLogo.png" )
Variables ¶
View Source
var (
BarcodeTypesBeforeIos9 = [3]BarcodeFormat{BarcodeFormatQR, BarcodeFormatPDF417, BarcodeFormatAztec}
)
Functions ¶
This section is empty.
Types ¶
type Barcode ¶
type Barcode struct { Format BarcodeFormat `json:"format,omitempty"` AltText string `json:"altText,omitempty"` Message string `json:"message,omitempty"` MessageEncoding string `json:"messageEncoding,omitempty"` }
func (*Barcode) GetValidationErrors ¶
type BarcodeFormat ¶
type BarcodeFormat string
type Beacon ¶
type Beacon struct { Major int `json:"major,omitempty"` Minor int `json:"minor,omitempty"` ProximityUUID string `json:"proximityUUID,omitempty"` RelevantText string `json:"relevantText,omitempty"` }
func (*Beacon) GetValidationErrors ¶
type BoardingPass ¶
type BoardingPass struct { *GenericPass TransitType TransitType `json:"transitType,omitempty"` }
func NewBoardingPass ¶
func NewBoardingPass(transitType TransitType) *BoardingPass
func (*BoardingPass) GetValidationErrors ¶
func (b *BoardingPass) GetValidationErrors() []string
func (*BoardingPass) IsValid ¶
func (b *BoardingPass) IsValid() bool
type DataDetectorType ¶
type DataDetectorType string
type EventTicket ¶
type EventTicket struct {
*GenericPass
}
func NewEventTicket ¶
func NewEventTicket() *EventTicket
type Field ¶
type Field struct { Key string `json:"key,omitempty"` Label string `json:"label,omitempty"` Value interface{} `json:"value,omitempty"` AttributedValue interface{} `json:"attributedValue,omitempty"` ChangeMessage string `json:"changeMessage,omitempty"` TextAlignment TextAlignment `json:"textAlignment,omitempty"` DataDetectorTypes []DataDetectorType `json:"dataDetectorTypes,omitempty"` CurrencyCode string `json:"currencyCode,omitempty"` NumberStyle NumberStyle `json:"numberStyle,omitempty"` DateStyle DateStyle `json:"dateStyle,omitempty"` TimeStyle DateStyle `json:"timeStyle,omitempty"` IsRelative bool `json:"isRelative,omitempty"` IgnoreTimeZone bool `json:"ignoresTimeZone,omitempty"` Row int `json:"row,omitempty"` }
func (*Field) GetValidationErrors ¶
type FolderPassTemplate ¶
type FolderPassTemplate struct {
// contains filtered or unexported fields
}
func NewFolderPassTemplate ¶
func NewFolderPassTemplate(templateDir string) *FolderPassTemplate
func (*FolderPassTemplate) GetAllFiles ¶
func (f *FolderPassTemplate) GetAllFiles() (map[string][]byte, error)
func (*FolderPassTemplate) ProvisionPassAtDirectory ¶
func (f *FolderPassTemplate) ProvisionPassAtDirectory(tmpDirPath string) error
type GenericPass ¶
type GenericPass struct { HeaderFields []Field `json:"headerFields,omitempty"` PrimaryFields []Field `json:"primaryFields,omitempty"` SecondaryFields []Field `json:"secondaryFields,omitempty"` AuxiliaryFields []Field `json:"auxiliaryFields,omitempty"` BackFields []Field `json:"backFields,omitempty"` }
func NewGenericPass ¶
func NewGenericPass() *GenericPass
func (*GenericPass) AddAuxiliaryFields ¶
func (gp *GenericPass) AddAuxiliaryFields(field Field)
func (*GenericPass) AddBackFields ¶
func (gp *GenericPass) AddBackFields(field Field)
func (*GenericPass) AddHeaderField ¶
func (gp *GenericPass) AddHeaderField(field Field)
func (*GenericPass) AddPrimaryFields ¶
func (gp *GenericPass) AddPrimaryFields(field Field)
func (*GenericPass) AddSecondaryFields ¶
func (gp *GenericPass) AddSecondaryFields(field Field)
func (*GenericPass) GetValidationErrors ¶
func (gp *GenericPass) GetValidationErrors() []string
func (*GenericPass) IsValid ¶
func (gp *GenericPass) IsValid() bool
type InMemoryPassTemplate ¶
type InMemoryPassTemplate struct {
// contains filtered or unexported fields
}
func NewInMemoryPassTemplate ¶
func NewInMemoryPassTemplate() *InMemoryPassTemplate
func (*InMemoryPassTemplate) AddAllFiles ¶
func (m *InMemoryPassTemplate) AddAllFiles(directoryWithFilesToAdd string) error
func (*InMemoryPassTemplate) AddFileBytes ¶
func (m *InMemoryPassTemplate) AddFileBytes(name string, data []byte)
func (*InMemoryPassTemplate) AddFileBytesLocalized ¶
func (m *InMemoryPassTemplate) AddFileBytesLocalized(name, locale string, data []byte)
func (*InMemoryPassTemplate) AddFileFromURL ¶
func (m *InMemoryPassTemplate) AddFileFromURL(name string, u url.URL) error
func (*InMemoryPassTemplate) AddFileFromURLLocalized ¶
func (m *InMemoryPassTemplate) AddFileFromURLLocalized(name, locale string, u url.URL) error
func (*InMemoryPassTemplate) GetAllFiles ¶
func (m *InMemoryPassTemplate) GetAllFiles() (map[string][]byte, error)
func (*InMemoryPassTemplate) ProvisionPassAtDirectory ¶
func (m *InMemoryPassTemplate) ProvisionPassAtDirectory(tmpDirPath string) error
type Location ¶
type Location struct { Latitude float64 `json:"latitude,omitempty"` Longitude float64 `json:"longitude,omitempty"` Altitude float64 `json:"altitude,omitempty"` RelevantText string `json:"relevantText,omitempty"` }
func (*Location) GetValidationErrors ¶
type NumberStyle ¶
type NumberStyle string
type PWAssociatedApp ¶
func (*PWAssociatedApp) GetValidationErrors ¶
func (a *PWAssociatedApp) GetValidationErrors() []string
func (*PWAssociatedApp) IsValid ¶
func (a *PWAssociatedApp) IsValid() bool
type Pass ¶
type Pass struct { FormatVersion int `json:"formatVersion,omitempty"` SerialNumber string `json:"serialNumber,omitempty"` PassTypeIdentifier string `json:"passTypeIdentifier,omitempty"` WebServiceURL string `json:"webServiceURL,omitempty"` AuthenticationToken string `json:"authenticationToken,omitempty"` Description string `json:"description,omitempty"` TeamIdentifier string `json:"teamIdentifier,omitempty"` OrganizationName string `json:"organizationName,omitempty"` LogoText string `json:"logoText,omitempty"` ForegroundColor string `json:"foregroundColor,omitempty"` BackgroundColor string `json:"backgroundColor,omitempty"` LabelColor string `json:"labelColor,omitempty"` GroupingIdentifier string `json:"groupingIdentifier,omitempty"` Beacons []Beacon `json:"beacons,omitempty"` Locations []Location `json:"locations,omitempty"` Barcodes []Barcode `json:"barcodes,omitempty"` EventTicket *EventTicket `json:"eventTicket,omitempty"` Coupon *Coupon `json:"coupon,omitempty"` StoreCard *StoreCard `json:"storeCard,omitempty"` BoardingPass *BoardingPass `json:"boardingPass,omitempty"` Generic *GenericPass `json:"generic,omitempty"` AppLaunchURL string `json:"appLaunchURL,omitempty"` AssociatedStoreIdentifiers []int64 `json:"associatedStoreIdentifiers,omitempty"` UserInfo map[string]interface{} `json:"userInfo,omitempty"` MaxDistance int64 `json:"maxDistance,omitempty"` RelevantDate *time.Time `json:"relevantDate,omitempty"` ExpirationDate *time.Time `json:"expirationDate,omitempty"` Voided bool `json:"voided,omitempty"` Nfc *NFC `json:"nfc,omitempty"` SharingProhibited bool `json:"sharingProhibited,omitempty"` // contains filtered or unexported fields }
func (*Pass) GetValidationErrors ¶
func (*Pass) SetBackgroundColorHex ¶
func (*Pass) SetBackgroundColorRGB ¶
func (*Pass) SetForegroundColorHex ¶
func (*Pass) SetForegroundColorRGB ¶
func (*Pass) SetLabelColorHex ¶
func (*Pass) SetLabelColorRGB ¶
type PassPersonalizationField ¶
type PassPersonalizationField string
type PassTemplate ¶
type Personalization ¶
type Personalization struct { RequiredPersonalizationFields []PassPersonalizationField `json:"requiredPersonalizationFields"` Description string `json:"description"` TermsAndConditions string `json:"termsAndConditions"` }
func (*Personalization) GetValidationErrors ¶
func (pz *Personalization) GetValidationErrors() []string
func (*Personalization) IsValid ¶
func (pz *Personalization) IsValid() bool
type Signer ¶
type Signer interface { CreateSignedAndZippedPassArchive(p *Pass, t PassTemplate, i *SigningInformation) ([]byte, error) CreateSignedAndZippedPersonalizedPassArchive(p *Pass, pz *Personalization, t PassTemplate, i *SigningInformation) ([]byte, error) SignManifestFile(manifestJson []byte, i *SigningInformation) ([]byte, error) }
func NewFileBasedSigner ¶
func NewFileBasedSigner() Signer
func NewMemoryBasedSigner ¶
func NewMemoryBasedSigner() Signer
type SigningInformation ¶
type SigningInformation struct {
// contains filtered or unexported fields
}
func LoadSigningInformationFromBytes ¶
func LoadSigningInformationFromBytes(pkcs12KeyStoreFile []byte, keyStorePassword string, appleWWDRCAFile []byte) (*SigningInformation, error)
func LoadSigningInformationFromFiles ¶
func LoadSigningInformationFromFiles(pkcs12KeyStoreFilePath, keyStorePassword, appleWWDRCAFilePath string) (*SigningInformation, error)
type StoreCard ¶
type StoreCard struct {
*GenericPass
}
func NewStoreCard ¶
func NewStoreCard() *StoreCard
type TextAlignment ¶
type TextAlignment string
type TransitType ¶
type TransitType string
type Validateable ¶
Click to show internal directories.
Click to hide internal directories.