Documentation
¶
Index ¶
Constants ¶
View Source
const COLUMN_BUSINESS_NAME = "business_name"
View Source
const COLUMN_COUNTRY = "country"
View Source
const COLUMN_CREATED_AT = "created_at"
View Source
const COLUMN_EMAIL = "email"
View Source
const COLUMN_FIRST_NAME = "first_name"
View Source
const COLUMN_ID = "id"
View Source
const COLUMN_LAST_NAME = "last_name"
View Source
const COLUMN_MEMO = "memo"
View Source
const COLUMN_METAS = "metas"
View Source
const COLUMN_MIDDLE_NAMES = "middle_names"
View Source
const COLUMN_PASSWORD = "password"
View Source
const COLUMN_PHONE = "phone"
View Source
const COLUMN_PROFILE_IMAGE_URL = "profile_image_url"
View Source
const COLUMN_ROLE = "role"
View Source
const COLUMN_SOFT_DELETED_AT = "soft_deleted_at"
View Source
const COLUMN_STATUS = "status"
View Source
const COLUMN_TIMEZONE = "timezone"
View Source
const COLUMN_UPDATED_AT = "updated_at"
View Source
const ERROR_EMPTY_ARRAY = "array cannot be empty"
View Source
const ERROR_EMPTY_STRING = "string cannot be empty"
View Source
const ERROR_NEGATIVE_NUMBER = "number cannot be negative"
View Source
const USER_ROLE_ADMINISTRATOR = "administrator"
View Source
const USER_ROLE_MANAGER = "manager"
View Source
const USER_ROLE_SUPERUSER = "superuser"
View Source
const USER_ROLE_USER = "user"
View Source
const USER_STATUS_ACTIVE = "active"
View Source
const USER_STATUS_DELETED = "deleted"
View Source
const USER_STATUS_INACTIVE = "inactive"
View Source
const USER_STATUS_UNVERIFIED = "unverified"
Variables ¶
This section is empty.
Functions ¶
func UserNoImageUrl ¶
func UserNoImageUrl() string
Types ¶
type NewStoreOptions ¶
type NewStoreOptions struct {
UserTableName string
DB *sql.DB
DbDriverName string
AutomigrateEnabled bool
DebugEnabled bool
}
NewStoreOptions define the options for creating a new block store
type StoreInterface ¶
type StoreInterface interface {
AutoMigrate() error
EnableDebug(debug bool)
UserCreate(user UserInterface) error
UserCount(options UserQueryInterface) (int64, error)
UserDelete(user UserInterface) error
UserDeleteByID(id string) error
UserFindByEmail(email string) (UserInterface, error)
UserFindByID(userID string) (UserInterface, error)
UserList(query UserQueryInterface) ([]UserInterface, error)
UserSoftDelete(user UserInterface) error
UserSoftDeleteByID(id string) error
UserUpdate(user UserInterface) error
}
func NewStore ¶
func NewStore(opts NewStoreOptions) (StoreInterface, error)
NewStore creates a new block store
type UserInterface ¶
type UserInterface interface {
Data() map[string]string
DataChanged() map[string]string
MarkAsNotDirty()
IsActive() bool
IsInactive() bool
IsSoftDeleted() bool
IsUnverified() bool
IsAdministrator() bool
IsManager() bool
IsSuperuser() bool
IsRegistrationCompleted() bool
BusinessName() string
SetBusinessName(businessName string) UserInterface
Country() string
SetCountry(country string) UserInterface
CreatedAt() string
CreatedAtCarbon() carbon.Carbon
SetCreatedAt(createdAt string) UserInterface
Email() string
SetEmail(email string) UserInterface
ID() string
SetID(id string) UserInterface
FirstName() string
SetFirstName(firstName string) UserInterface
LastName() string
SetLastName(lastName string) UserInterface
Memo() string
SetMemo(memo string) UserInterface
Meta(name string) string
SetMeta(name string, value string) error
Metas() (map[string]string, error)
SetMetas(metas map[string]string) error
UpsertMetas(metas map[string]string) error
MiddleNames() string
SetMiddleNames(middleNames string) UserInterface
Password() string
SetPassword(password string) UserInterface
Phone() string
SetPhone(phone string) UserInterface
ProfileImageUrl() string
SetProfileImageUrl(profileImageUrl string) UserInterface
Role() string
SetRole(role string) UserInterface
SoftDeletedAt() string
SoftDeletedAtCarbon() carbon.Carbon
SetSoftDeletedAt(deletedAt string) UserInterface
Timezone() string
SetTimezone(timezone string) UserInterface
Status() string
SetStatus(status string) UserInterface
PasswordCompare(password string) bool
UpdatedAt() string
UpdatedAtCarbon() carbon.Carbon
SetUpdatedAt(updatedAt string) UserInterface
}
func NewUser ¶
func NewUser() UserInterface
func NewUserFromExistingData ¶
func NewUserFromExistingData(data map[string]string) UserInterface
type UserQueryInterface ¶ added in v0.3.0
type UserQueryInterface interface {
ID() string
SetID(id string) (UserQueryInterface, error)
IDIn() []string
SetIDIn(idIn []string) (UserQueryInterface, error)
Status() string
SetStatus(status string) (UserQueryInterface, error)
StatusIn() []string
SetStatusIn(statusIn []string) (UserQueryInterface, error)
Email() string
SetEmail(email string) (UserQueryInterface, error)
CreatedAtGte() string
SetCreatedAtGte(createdAtGte string) (UserQueryInterface, error)
CreatedAtLte() string
SetCreatedAtLte(createdAtLte string) (UserQueryInterface, error)
Offset() int
SetOffset(offset int) (UserQueryInterface, error)
Limit() int
SetLimit(limit int) (UserQueryInterface, error)
SortOrder() string
SetSortOrder(sortOrder string) (UserQueryInterface, error)
OrderBy() string
SetOrderBy(orderBy string) (UserQueryInterface, error)
CountOnly() bool
SetCountOnly(countOnly bool) UserQueryInterface
WithSoftDeleted() bool
SetWithSoftDeleted(withDeleted bool) UserQueryInterface
}
func NewUserQuery ¶ added in v0.3.0
func NewUserQuery() UserQueryInterface
Click to show internal directories.
Click to hide internal directories.