Documentation ¶
Index ¶
- func CleanForID(s string) string
- func DeductNamesFromFullName(fullName string) (firstName, lastName string)
- func GenerateIDFromNameOrRandom(name *NameFields, existingIDs []string) (id string, err error)
- func NewUniqueRandomID(existingIDs []string, idLength int) (id string, err error)
- func ValidateAtLeast1Name(v *NameFields) error
- type Name
- type NameField
- type NameFields
- func (v *NameFields) Equal(v2 *NameFields) bool
- func (v *NameFields) GetFullName() string
- func (v *NameFields) GetName(field NameField) string
- func (v *NameFields) IsEmpty() bool
- func (v *NameFields) SetNames(names ...Name) error
- func (v *NameFields) String() string
- func (v *NameFields) Validate() error
- type NamesHolder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanForID ¶ added in v0.13.0
CleanForID removes non-ASCII characters and converts to a lower case
func DeductNamesFromFullName ¶ added in v0.17.0
func GenerateIDFromNameOrRandom ¶ added in v0.13.0
func GenerateIDFromNameOrRandom(name *NameFields, existingIDs []string) (id string, err error)
GenerateIDFromNameOrRandom generates ContactID from name or random
func NewUniqueRandomID ¶ added in v0.13.0
NewUniqueRandomID generate new team ContactID
func ValidateAtLeast1Name ¶
func ValidateAtLeast1Name(v *NameFields) error
ValidateAtLeast1Name validates required names
Types ¶
type NameFields ¶
type NameFields struct { UserName string `json:"userName,omitempty" dalgo:"userName,omitempty" firestore:"userName,omitempty"` FirstName string `json:"firstName,omitempty" dalgo:"firstName,omitempty" firestore:"firstName,omitempty"` MiddleName string `json:"middleName,omitempty" dalgo:"middleName,omitempty" firestore:"middleName,omitempty"` LastName string `json:"lastName,omitempty" dalgo:"lastName,omitempty" firestore:"lastName,omitempty"` NickName string `json:"nickName,omitempty" dalgo:"nickName,omitempty" firestore:"nickName,omitempty"` ScreenName string `json:"screenName,omitempty" dalgo:"screenName,omitempty" firestore:"screenName,omitempty"` FullName string `json:"fullName,omitempty" dalgo:"fullName,omitempty" firestore:"fullName,omitempty"` }
NameFields is a struct for storing names of a user or a contact
func (*NameFields) Equal ¶ added in v0.14.0
func (v *NameFields) Equal(v2 *NameFields) bool
func (*NameFields) GetFullName ¶
func (v *NameFields) GetFullName() string
GetFullName returns a full NameField of a user or a contact
func (*NameFields) GetName ¶
func (v *NameFields) GetName(field NameField) string
GetName returns a long NameField of a user or a contact
func (*NameFields) IsEmpty ¶ added in v0.14.1
func (v *NameFields) IsEmpty() bool
IsEmpty checks if name is empty
func (*NameFields) SetNames ¶
func (v *NameFields) SetNames(names ...Name) error
SetNames sets names of a user or a contact
func (*NameFields) String ¶
func (v *NameFields) String() string
String returns string representation of a user or a contact names
func (*NameFields) Validate ¶
func (v *NameFields) Validate() error
Validate validates NameField fields
Click to show internal directories.
Click to hide internal directories.