Documentation
¶
Index ¶
- Constants
- Variables
- type Comp
- type Core
- func (c *Core) GetCompanyName() string
- func (c *Core) GetEmail() string
- func (c *Core) GetExternalOwner() owner.Owner
- func (c *Core) GetFirstName() string
- func (c *Core) GetLastName() string
- func (c *Core) GetPhone() string
- func (c *Core) GetPictureID() contract.ID
- func (c *Core) GetPrivacy() Privacy
- func (c *Core) GetQRID() contract.ID
- func (c *Core) GetRestricted() bool
- func (c *Core) GetUID() string
- func (c *Core) GetUserType() contract.UserType
- func (c *Core) GetUserTypeSwitch() contract.UserType
- func (c *Core) GetUsername() string
- func (c *Core) SetCompanyName(x string)
- func (c *Core) SetEmail(x string)
- func (c *Core) SetExternalOwner(x owner.Owner)
- func (c *Core) SetFirstName(x string)
- func (c *Core) SetLastName(x string)
- func (c *Core) SetPhone(x string)
- func (c *Core) SetPictureID(x contract.ID)
- func (c *Core) SetPrivacy(x Privacy)
- func (c *Core) SetQRID(x contract.ID)
- func (c *Core) SetRestricted(x bool)
- func (c *Core) SetUID(x string)
- func (c *Core) SetUserType(x contract.UserType)
- func (c *Core) SetUserTypeSwitch(x contract.UserType)
- func (c *Core) SetUsername(x string)
- type CoreOption
- func WithAddress(x address.Address) CoreOption
- func WithCompanyName(x string) CoreOption
- func WithEmail(x string) CoreOption
- func WithExternalOwner(x owner.Owner) CoreOption
- func WithFirstName(x string) CoreOption
- func WithLastName(x string) CoreOption
- func WithPhone(x string) CoreOption
- func WithPictureID(x contract.ID) CoreOption
- func WithPrivacy(x Privacy) CoreOption
- func WithQRID(x contract.ID) CoreOption
- func WithRestricted(x bool) CoreOption
- func WithUID(x string) CoreOption
- func WithUserType(x contract.UserType) CoreOption
- func WithUserTypeSwitch(x contract.UserType) CoreOption
- func WithUsername(x string) CoreOption
- type Meta
- type MetaOption
- type Privacy
- type User
Constants ¶
View Source
const ( EmailKey = "email" UsernameKey = "username" UIDKey = "uid" FirstNameKey = "first_name" LastNameKey = "last_name" PhoneKey = "phone" CompanyNameKey = "company_name" AddressKey = "address" UserTypeKey = "user_type" UserTypeSwitchKey = "user_type_switch" PrivacyKey = "privacy" RestrictedKey = "restricted" PictureIDKey = "picture_id" QRIDKey = "qr_id" )
View Source
const ( IsSearchableKey = "is_searchable" IsMessageableKey = "is_messageable" )
View Source
const (
FullNameKey = "full_name"
)
Variables ¶
View Source
var ( PrivacyIsSearchableKey = contract.PathKeyDot(PrivacyKey, IsSearchableKey) PrivacyIsMessageableKey = contract.PathKeyDot(PrivacyKey, IsMessageableKey) )
Functions ¶
This section is empty.
Types ¶
type Comp ¶
type Comp struct {
FullName *string `json:"full_name" conform:"title,trim" validate:"nnpt,nz"`
}
func (*Comp) GetFullName ¶ added in v0.0.50
func (*Comp) SetFullName ¶ added in v0.0.50
type Core ¶
type Core struct {
address.Address `bson:",inline" validate:"recurse"`
UID *string `json:"uid" validate:"nnpt"`
Email *string `json:"email" conform:"email" validate:"nnpt,nz"`
Username *string `json:"username" conform:"trim,lower" validate:"nnpt"`
FirstName *string `json:"first_name" conform:"title,trim,alpha" validate:"nnpt,nz"`
LastName *string `json:"last_name" conform:"title,trim,alpha" validate:"nnpt,nz"`
Phone *string `json:"phone" conform:"trim" validate:"nnpt"`
CompanyName *string `json:"company_name" conform:"title,trim" validate:"nnpt"`
UserType *contract.UserType `json:"user_type" conform:"lower,trim" validate:"nnpt,nz"`
UserTypeSwitch *contract.UserType `json:"user_type_switch" conform:"lower,trim" validate:"nnpt,nz"`
Privacy *Privacy `json:"privacy" validate:"nnpt"`
Restricted *bool `json:"restricted" validate:"nnpt"`
PictureID *contract.ID `json:"picture_id" validate:"nnpt"`
QRID *contract.ID `json:"qr_id" validate:"nnpt"`
// WARN: ExternalOwner should be zero-valued if the user is not an external user.
ExternalOwner *owner.Owner `bson:"external_owner" validate:"nnpt"`
}
func ApplyCore ¶
func ApplyCore(c *Core, modifiers ...CoreOption) Core
func (*Core) GetCompanyName ¶ added in v0.0.50
func (*Core) GetExternalOwner ¶ added in v0.0.51
func (*Core) GetFirstName ¶ added in v0.0.50
func (*Core) GetLastName ¶ added in v0.0.50
func (*Core) GetPictureID ¶ added in v0.0.50
func (*Core) GetPrivacy ¶ added in v0.0.50
func (*Core) GetRestricted ¶ added in v0.0.50
func (*Core) GetUserType ¶ added in v0.0.50
func (*Core) GetUserTypeSwitch ¶ added in v0.0.63
func (*Core) GetUsername ¶
func (*Core) SetCompanyName ¶ added in v0.0.50
func (*Core) SetExternalOwner ¶ added in v0.0.51
func (*Core) SetFirstName ¶ added in v0.0.50
func (*Core) SetLastName ¶ added in v0.0.50
func (*Core) SetPictureID ¶ added in v0.0.50
func (*Core) SetPrivacy ¶ added in v0.0.50
func (*Core) SetRestricted ¶ added in v0.0.50
func (*Core) SetUserType ¶ added in v0.0.50
func (*Core) SetUserTypeSwitch ¶ added in v0.0.63
func (*Core) SetUsername ¶
type CoreOption ¶
type CoreOption = contracti.CoreOption[Core]
func WithAddress ¶ added in v0.0.50
func WithAddress(x address.Address) CoreOption
func WithCompanyName ¶ added in v0.0.50
func WithCompanyName(x string) CoreOption
func WithEmail ¶
func WithEmail(x string) CoreOption
func WithExternalOwner ¶ added in v0.0.51
func WithExternalOwner(x owner.Owner) CoreOption
func WithFirstName ¶ added in v0.0.50
func WithFirstName(x string) CoreOption
func WithLastName ¶ added in v0.0.50
func WithLastName(x string) CoreOption
func WithPhone ¶ added in v0.0.50
func WithPhone(x string) CoreOption
func WithPictureID ¶ added in v0.0.50
func WithPictureID(x contract.ID) CoreOption
func WithPrivacy ¶ added in v0.0.50
func WithPrivacy(x Privacy) CoreOption
func WithQRID ¶ added in v0.0.102
func WithQRID(x contract.ID) CoreOption
func WithRestricted ¶ added in v0.0.50
func WithRestricted(x bool) CoreOption
func WithUID ¶
func WithUID(x string) CoreOption
func WithUserType ¶ added in v0.0.50
func WithUserType(x contract.UserType) CoreOption
func WithUserTypeSwitch ¶ added in v0.0.63
func WithUserTypeSwitch(x contract.UserType) CoreOption
func WithUsername ¶
func WithUsername(x string) CoreOption
type MetaOption ¶
type MetaOption = contract.MetaOption[Meta]
func WithCommon ¶
func WithCommon(x common.Common) MetaOption
type Privacy ¶ added in v0.0.50
type Privacy struct {
IsSearchable *bool `json:"is_searchable" validate:"nnpt"`
IsMessageable *bool `json:"is_messageable" validate:"nnpt"`
}
func (*Privacy) GetIsMessageable ¶ added in v0.0.50
func (*Privacy) GetIsSearchable ¶ added in v0.0.50
func (*Privacy) SetIsMessageable ¶ added in v0.0.50
func (*Privacy) SetIsSearchable ¶ added in v0.0.50
Click to show internal directories.
Click to hide internal directories.