Documentation
¶
Index ¶
- Variables
- func CreateProfile(profile *Profile) string
- func CreateProfileGroup(name string) string
- func DoesProfileExist(id string) bool
- func DoesProfileGroupExist(id string) bool
- func GetAllProfileGroupIds() []string
- func GetAllProfileIDs() []string
- func RemoveProfile(id string) error
- func RemoveProfileFromProfileGroup(profileId, profileGroupId string) error
- func RemoveProfileGroup(id string) error
- func SetProfileToProfileGroup(profileId, profileGroupId string) error
- type Profile
- type ProfileGroup
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ProfileDoesNotExistErr = errors.New("profile does not exist") ProfileNotAssignedErr = errors.New("profile not assigned") )
View Source
var ( ProfileGroupEmptyErr = errors.New("profile group does not contain any profiles") ProfileGroupDoesNotExistErr = errors.New("profile group does not exist") )
Functions ¶
func CreateProfile ¶
CreateProfile creates a new profile
func CreateProfileGroup ¶
CreateProfileGroup creates a new profile group
func DoesProfileExist ¶
DoesProfileExist checks if a profile exists
func DoesProfileGroupExist ¶
DoesProfileGroupExist checks if a profile group exists
func GetAllProfileGroupIds ¶
func GetAllProfileGroupIds() []string
GetAllProfileGroupIds gets all profile group ids
func RemoveProfileFromProfileGroup ¶
RemoveProfileFromProfileGroup removes a profile from a profile group
func RemoveProfileGroup ¶
RemoveProfileGroup removes a profile group
func SetProfileToProfileGroup ¶
SetProfileToProfileGroup sets a profile to a profile group
Types ¶
type Profile ¶
type Profile struct {
Name string `json:"name"`
ProfileGroup string `json:"profileGroup"`
BillingAddress struct {
Name string `json:"name"`
Email string `json:"email"`
Phone string `json:"phone"`
Line1 string `json:"line1"`
Line2 string `json:"line2"`
Line3 string `json:"line3"`
Postcode string `json:"postCode"`
City string `json:"city"`
Country string `json:"country"`
State string `json:"state"`
} `json:"billingAddress"`
ShippingAddress struct {
Name string `json:"name"`
Email string `json:"email"`
Phone string `json:"phone"`
Line1 string `json:"line1"`
Line2 string `json:"line2"`
Line3 string `json:"line3"`
Postcode string `json:"postCode"`
City string `json:"city"`
Country string `json:"country"`
State string `json:"state"`
} `json:"shippingAddress"`
PaymentDetails struct {
NameOnCard string `json:"nameOnCard"`
CardType string `json:"cardType"`
CardNumber string `json:"cardNumber"`
CardExpMonth string `json:"cardExpMonth"`
CardExpYear string `json:"cardExpYear"`
CardCvv string `json:"cardCvv"`
} `json:"paymentDetails"`
SameBillingAndShipping bool `json:"sameBillingAndShippingAddress"`
}
func GetProfileById ¶
GetProfileById gets a profile by id
func GetProfileFromProfileGroup ¶
GetProfileFromProfileGroup gets a profile from a profile group Gets the first profile, then moves it to the back
type ProfileGroup ¶
type ProfileGroup struct {
ID string `json:"id"`
Name string `json:"name"`
Profiles *orderedmap.OrderedMap `json:"profiles"` // ordered map to make sure our profile selection works
}
func GetProfileGroup ¶
func GetProfileGroup(id string) (*ProfileGroup, error)
GetProfileGroup gets a profile group by id
Click to show internal directories.
Click to hide internal directories.