Versions in this module Expand all Collapse all v1 v1.0.0 Mar 29, 2022 Changes in this version + func GenerateId(prefix string) (string, error) + type OtpLogin struct + CreatedAt int64 + Id string + Otp string + PhoneNumber string + Region []string + Roles string + UserId string + func NewOtpLogin(userId, phoneNumber, roles string, region []string) (*OtpLogin, error) + type OtpVerifyPhoneNumber struct + CreatedAt int64 + Id string + Otp string + PhoneNumber string + func NewOtpVerifyPhoneNumber(phoneNumber string) (*OtpVerifyPhoneNumber, error) + type User struct + Aud string + AuthTime int64 + Exp int64 + Iat int64 + Id string + Iss string + PhoneNumber string + Region []string + Roles string + Sub string + func Authorization(auth *auth.Client, ctx context.Context, roles ...roles.Roles) (*User, error) + func (it *User) IsBranchAdmin() bool + func (it *User) IsCourier() bool + func (it *User) IsCustomer() bool + func (it *User) IsFinanceAdmin() bool + func (it *User) IsFoodServiceAM() bool + func (it *User) IsFoodServiceGM() bool + func (it *User) IsFoodServiceNSM() bool + func (it *User) IsFoodServiceRM() bool + func (it *User) IsFoodServiceSales() bool + func (it *User) IsRetailAM() bool + func (it *User) IsRetailDir() bool + func (it *User) IsRetailGM() bool + func (it *User) IsRetailRM() bool + func (it *User) IsRetailSales() bool + func (it *User) IsSalesAdmin() bool + func (it *User) IsSystemAdmin() bool + func (it *User) IsWalkInCustomer() bool + func (it *User) IsWarehouseAdmin() bool