Documentation
¶
Overview ¶
Package visitor represents abstraction of business layer visitor object
Index ¶
Constants ¶
const ( ConstModelNameVisitor = "Visitor" ConstModelNameVisitorCollection = "VisitorCollection" ConstModelNameVisitorAddress = "VisitorAddress" ConstModelNameVisitorAddressCollection = "VisitorAddressCollection" ConstModelNameVisitorCard = "VisitorCard" ConstModelNameVisitorCardCollection = "VisitorCardCollection" ConstSessionKeyVisitorID = "visitor_id" ConstErrorModule = "visitor" ConstErrorLevel = env.ConstErrorLevelModel )
Package global constants
Variables ¶
This section is empty.
Functions ¶
func GetCurrentVisitorID ¶
func GetCurrentVisitorID(context api.InterfaceApplicationContext) string
GetCurrentVisitorID returns visitor id for current session if registered or ""
Types ¶
type InterfaceVisitor ¶
type InterfaceVisitor interface {
GetEmail() string
GetFacebookID() string
GetGoogleID() string
GetFullName() string
GetFirstName() string
GetLastName() string
GetCreatedAt() time.Time
GetShippingAddress() InterfaceVisitorAddress
GetBillingAddress() InterfaceVisitorAddress
GetToken() InterfaceVisitorCard
SetShippingAddress(address InterfaceVisitorAddress) error
SetBillingAddress(address InterfaceVisitorAddress) error
SetToken(token InterfaceVisitorCard) error
SetPassword(passwd string) error
CheckPassword(passwd string) bool
GenerateNewPassword() error
ResetPassword() error
UpdateResetPassword(key string, passwd string) error
IsAdmin() bool
IsGuest() bool
IsVerified() bool
Invalidate() error
Validate(key string) error
LoadByEmail(email string) error
LoadByFacebookID(facebookID string) error
LoadByGoogleID(googleID string) error
models.InterfaceModel
models.InterfaceObject
models.InterfaceStorable
models.InterfaceListable
models.InterfaceCustomAttributes
}
InterfaceVisitor represents interface to access business layer implementation of visitor object
func GetCurrentVisitor ¶
func GetCurrentVisitor(context api.InterfaceApplicationContext) (InterfaceVisitor, error)
GetCurrentVisitor returns visitor for current session if registered or nil - for guest visitor
func GetVisitorModel ¶
func GetVisitorModel() (InterfaceVisitor, error)
GetVisitorModel retrieves current InterfaceVisitor model implementation
func GetVisitorModelAndSetID ¶
func GetVisitorModelAndSetID(visitorID string) (InterfaceVisitor, error)
GetVisitorModelAndSetID retrieves current InterfaceVisitor model implementation and sets its ID to some value
func LoadVisitorByID ¶
func LoadVisitorByID(visitorID string) (InterfaceVisitor, error)
LoadVisitorByID loads visitor data into current InterfaceVisitor model implementation
type InterfaceVisitorAddress ¶
type InterfaceVisitorAddress interface {
GetVisitorID() string
GetFirstName() string
GetLastName() string
GetCompany() string
GetCountry() string
GetState() string
GetCity() string
GetAddress() string
GetAddressLine1() string
GetAddressLine2() string
GetPhone() string
GetZipCode() string
models.InterfaceModel
models.InterfaceObject
models.InterfaceStorable
}
InterfaceVisitorAddress represents interface to access business layer implementation of visitor address object
func GetVisitorAddressModel ¶
func GetVisitorAddressModel() (InterfaceVisitorAddress, error)
GetVisitorAddressModel retrieves current InterfaceVisitorAddress model implementation
func GetVisitorAddressModelAndSetID ¶
func GetVisitorAddressModelAndSetID(visitorAddressID string) (InterfaceVisitorAddress, error)
GetVisitorAddressModelAndSetID retrieves current InterfaceVisitorAddress model implementation and sets its ID to some value
func LoadVisitorAddressByID ¶
func LoadVisitorAddressByID(visitorAddressID string) (InterfaceVisitorAddress, error)
LoadVisitorAddressByID loads visitor address data into current InterfaceVisitorAddress model implementation
type InterfaceVisitorAddressCollection ¶
type InterfaceVisitorAddressCollection interface {
ListVisitorsAddresses() []InterfaceVisitorAddress
models.InterfaceCollection
}
InterfaceVisitorAddressCollection represents interface to access business layer implementation of visitor address collection
func GetVisitorAddressCollectionModel ¶
func GetVisitorAddressCollectionModel() (InterfaceVisitorAddressCollection, error)
GetVisitorAddressCollectionModel retrieves current InterfaceVisitorAddressCollection model implementation
type InterfaceVisitorCard ¶
type InterfaceVisitorCard interface {
GetVisitorID() string
GetPaymentMethodCode() string
GetToken() string
GetCustomerID() string
GetHolderName() string
GetType() string
GetNumber() string
GetExpirationDate() string
IsExpired() bool
models.InterfaceModel
models.InterfaceObject
models.InterfaceStorable
}
InterfaceVisitorCard represents interface to access business layer implementation of visitor card object
func GetVisitorCardModel ¶
func GetVisitorCardModel() (InterfaceVisitorCard, error)
GetVisitorCardModel retrieves current InterfaceVisitorCard model implementation
func GetVisitorCardModelAndSetID ¶
func GetVisitorCardModelAndSetID(visitorCardID string) (InterfaceVisitorCard, error)
GetVisitorCardModelAndSetID retrieves current InterfaceVisitorCard model implementation and sets its ID
func LoadVisitorCardByID ¶
func LoadVisitorCardByID(visitorCardID string) (InterfaceVisitorCard, error)
LoadVisitorCardByID loads visitor address data into current InterfaceVisitorCard model implementation
type InterfaceVisitorCardCollection ¶
type InterfaceVisitorCardCollection interface {
ListVisitorsCards() []InterfaceVisitorCard
models.InterfaceCollection
}
InterfaceVisitorCardCollection represents interface to access business layer implementation of visitor card collection
func GetVisitorCardCollectionModel ¶
func GetVisitorCardCollectionModel() (InterfaceVisitorCardCollection, error)
GetVisitorCardCollectionModel retrieves current InterfaceVisitorAddressCollection model implementation
type InterfaceVisitorCollection ¶
type InterfaceVisitorCollection interface {
ListVisitors() []InterfaceVisitor
models.InterfaceCollection
}
InterfaceVisitorCollection represents interface to access business layer implementation of visitor collection
func GetVisitorCollectionModel ¶
func GetVisitorCollectionModel() (InterfaceVisitorCollection, error)
GetVisitorCollectionModel retrieves current InterfaceVisitorCollection model implementation