Documentation ¶
Index ¶
- Constants
- Variables
- func BuildLookUpTableForInvitesExport(invites []*Invite) map[int]*InviteForExport
- func BuildLookUpTableForUserExport(users []*User) map[int]*UserForExport
- func BuildTeamIDLookUpTableForTeamMemberExport(teamMembers []*TeamMember) map[int]*TeamMemberForExport
- func CreateAccessToken(id int, uid uuid.UUID) (string, error)
- func ExtractUserIDFromToken(accessToken string) (int, uuid.UUID, error)
- func GenerateAndSendVerificationCode(email, usage string) (string, error)
- func GenerateRedirectPageParam(redirectPage string) string
- func PickUpTeamIDsInTeamMembers(teamMembers []*TeamMember) []int
- func PickUpTeamMemberIDsInTeamMembers(teamMembers []*TeamMember) []int
- func PickUpUserIDsInUserMembers(teamMembers []*TeamMember) []int
- func SendInviteEmail(m *EmailInviteMessage) error
- func SendShareAppEmail(m *EmailShareAppMessage) error
- func SendSubscriptionEmail(email string) error
- func SendVerificationEmail(email, code, usage string) error
- func ValidateAccessToken(accessToken string) (bool, error)
- func ValidateVerificationCode(vCode, codeToken, email, usage string) (bool, error)
- type AuthClaims
- type Cache
- type ChangePasswordRequest
- type ConfigInviteLinkRequest
- type CreateDomainRequest
- type CreateInvitationCodeRequest
- type CreateInviteRequest
- type CreateTeamMemberRequest
- type CreateTeamRequest
- type CreateUserRequest
- type CreateUserResponse
- type Drive
- type EmailInviteMessage
- type EmailShareAppMessage
- type ForgetPasswordRequest
- type GenerateInviteLinkResponse
- func (resp *GenerateInviteLinkResponse) ExportForFeedback() interface{}
- func (u *GenerateInviteLinkResponse) SetAppID(appID int)
- func (u *GenerateInviteLinkResponse) SetInviteLink(inviteLink string)
- func (u *GenerateInviteLinkResponse) SetTeamID(teamID int)
- func (u *GenerateInviteLinkResponse) SetUserRole(userRole int)
- type GetAllTeamMembersResponse
- type GetMyTeamsResponse
- type GetTargetTeamByInternalRequestResponse
- type GetTargetUserByInternalRequestResponse
- type GetTargetUsersByInternalRequestResponse
- type GetTeamByTeamIDResponse
- type GetTeamMemberResponse
- type GetTeamPermissionResponse
- type GetUserByIDResponse
- type GetVerificationCodeResponse
- type Invite
- func NewInvite() *Invite
- func NewInviteByCreateInviteRequest(req *CreateInviteRequest) *Invite
- func NewInviteByUpdateInviteRequest(req *UpdateInviteRequest) *Invite
- func NewInviteEmailLinkByTeamAndRequest(team *Team, req *InviteMemberByEmailRequest) *Invite
- func NewInviteLinkByTeamAndUserRole(team *Team, userRole int) *Invite
- func (u *Invite) ConstructByJSON(InviteJSON []byte) error
- func (u *Invite) Export() *InviteForExport
- func (u *Invite) ExportAppIDInString() string
- func (u *Invite) ExportEmail() string
- func (u *Invite) ExportEmailStatus() bool
- func (u *Invite) ExportID() int
- func (u *Invite) ExportInviteLink() string
- func (u *Invite) ExportInviteLinkWithEmailAndTeam(team *Team) string
- func (u *Invite) ExportShareAppLink() string
- func (u *Invite) ExportShareAppLinkWithEmailANDTeamIdentifier(team *Team) string
- func (u *Invite) ExportTeamID() int
- func (u *Invite) ExportTeamMemberID() int
- func (u *Invite) ExportUID() uuid.UUID
- func (u *Invite) ExportUserRole() int
- func (u *Invite) ImportInviteLink(link string) error
- func (u *Invite) InitCreatedAt()
- func (u *Invite) InitUID()
- func (u *Invite) InitUpdatedAt()
- func (u *Invite) IsAvaliable() bool
- func (u *Invite) IsEmailInviteLink() bool
- func (u *Invite) IsInviteLink() bool
- func (u *Invite) IsShareAppInvite() bool
- func (u *Invite) SetAppID(appID int)
- func (u *Invite) SetEmailStatusFailed()
- func (u *Invite) SetEmailStatusSuccess()
- func (u *Invite) SetHosts(hosts string)
- func (u *Invite) SetTeamIdentifier(teamIdentifier string)
- func (u *Invite) SetTeamMemberID(teamMemberID int)
- func (u *Invite) SetUserRole(role int)
- type InviteForExport
- type InviteMemberByEmailRequest
- func (u *InviteMemberByEmailRequest) ExportAppID() int
- func (u *InviteMemberByEmailRequest) ExportEmail() string
- func (u *InviteMemberByEmailRequest) ExportHosts() string
- func (u *InviteMemberByEmailRequest) ExportRedirectPage() string
- func (u *InviteMemberByEmailRequest) ExportUserRole() int
- func (u *InviteMemberByEmailRequest) Init()
- func (u *InviteMemberByEmailRequest) IsShareAppInvite() bool
- type InviteMemberByEmailResponse
- func (resp *InviteMemberByEmailResponse) ExportForFeedback() interface{}
- func (u *InviteMemberByEmailResponse) SetEmail(email string)
- func (u *InviteMemberByEmailResponse) SetEmailStatus(emailStatus bool)
- func (u *InviteMemberByEmailResponse) SetEmailStatusByInvite(i *Invite)
- func (u *InviteMemberByEmailResponse) SetFeedback(f string)
- func (u *InviteMemberByEmailResponse) SetUserRole(userRole int)
- type InviteStorage
- func (d *InviteStorage) Create(u *Invite) (int, error)
- func (d *InviteStorage) DeleteByID(id int) error
- func (d *InviteStorage) DeleteByTeamID(teamID int) error
- func (d *InviteStorage) DeleteByTeamIDAndTeamMemberID(teamID int, teamMemberID int) error
- func (d *InviteStorage) DeleteByUID(uid uuid.UUID) error
- func (d *InviteStorage) RetrieveAvaliableInviteByTeamIDAndEmail(teamID int, email string) (*Invite, error)
- func (d *InviteStorage) RetrieveAvaliableInviteByTeamIDAndTeamMemberID(teamID int, teamMemberID int) (*Invite, error)
- func (d *InviteStorage) RetrieveAvaliableInviteLinkByTeamIDAndUserRole(teamID int, userRole int) (*Invite, error)
- func (d *InviteStorage) RetrieveByID(id int) (*Invite, error)
- func (d *InviteStorage) RetrieveByIDs(ids []int) ([]*Invite, error)
- func (d *InviteStorage) RetrieveByUID(uid uuid.UUID) (*Invite, error)
- func (d *InviteStorage) RetrieveInviteByEmailAndTeamIDAndUserRole(teamID int, email string, userRole int) (*Invite, error)
- func (d *InviteStorage) RetrieveInviteByEmailByIDs(ids []int) ([]*Invite, error)
- func (d *InviteStorage) RetrieveInviteByTeamIDAndEmail(teamID int, email string) (*Invite, error)
- func (d *InviteStorage) Update(u *Invite) error
- type JWTCache
- type MyTeamResponse
- type Response
- type S3Instance
- type SignInRequest
- type SignUpRequest
- type SignUpResponse
- type Storage
- type SystemDrive
- type Team
- func (u *Team) ConfigInviteLinkByRequest(req *ConfigInviteLinkRequest)
- func (u *Team) ConstructByJSON(TeamJSON []byte) error
- func (u *Team) DoesEditorOrViewerCanInviteMember() bool
- func (t *Team) Export() *TeamForExport
- func (u *Team) ExportID() int
- func (u *Team) ExportTeamPermission() *TeamPermission
- func (u *Team) GetIdentifier() string
- func (u *Team) GetUID() uuid.UUID
- func (u *Team) GetUIDInString() string
- func (u *Team) InitCreatedAt()
- func (u *Team) InitUID()
- func (u *Team) InitUpdatedAt()
- func (u *Team) SetTeamPermission(tp *TeamPermission)
- func (u *Team) UpdateByUpdateTeamConfigRawRequest(rawReq map[string]interface{}) error
- func (u *Team) UpdateByUpdateTeamPermissionRawRequest(rawReq map[string]interface{}) error
- type TeamDrive
- type TeamForExport
- type TeamIconUploadAddressResponse
- type TeamMember
- func NewEditorTeamMemberByUserID(userID int) *TeamMember
- func NewPendingTeamMemberByInvite(invite *Invite) *TeamMember
- func NewTeamMember() *TeamMember
- func NewTeamMemberByCreateTeamMemberRequest(req *CreateTeamMemberRequest) *TeamMember
- func NewTeamMemberByInviteAndUserID(invite *Invite, userID int) *TeamMember
- func NewTeamMemberByTeamIDAndUserIDAndUserRole(teamID, userID, userRole int) *TeamMember
- func NewTeamMemberByUpdateTeamMemberRequest(req *UpdateTeamMemberRequest) *TeamMember
- func (u *TeamMember) ActiveUser()
- func (u *TeamMember) ConstructByJSON(TeamMemberJSON []byte) error
- func (u *TeamMember) Export() *TeamMemberForExport
- func (u *TeamMember) ExportID() int
- func (u *TeamMember) ExportPermission() *TeamMemberPermission
- func (u *TeamMember) ExportUserID() int
- func (u *TeamMember) ExportUserRole() int
- func (u *TeamMember) ExportWithPendingUserInfo(userForExport *UserForExport) *TeamMemberWithUserInfoForExport
- func (u *TeamMember) ExportWithUserInfo(userForExport *UserForExport) *TeamMemberWithUserInfoForExport
- func (u *TeamMember) InitCreatedAt()
- func (u *TeamMember) InitUpdatedAt()
- func (u *TeamMember) IsAdmin() bool
- func (u *TeamMember) IsEditor() bool
- func (u *TeamMember) IsOwner() bool
- func (u *TeamMember) IsStatusOK() bool
- func (u *TeamMember) IsStatusPending() bool
- func (u *TeamMember) IsViewer() bool
- func (u *TeamMember) SetID(id int)
- func (u *TeamMember) SetUserID(userID int)
- func (u *TeamMember) SetUserRole(userRole int)
- func (u *TeamMember) UpdateByUpdateTeamMemberRoleRequest(req *UpdateTeamMemberRoleRequest)
- func (u *TeamMember) UpdateTeamMemberRole(userRole int)
- type TeamMemberForExport
- type TeamMemberPermission
- type TeamMemberStorage
- func (d *TeamMemberStorage) Create(u *TeamMember) (int, error)
- func (d *TeamMemberStorage) DeleteByID(id int) error
- func (d *TeamMemberStorage) DeleteByIDAndTeamID(id int, teamID int) error
- func (d *TeamMemberStorage) DeleteByTeamID(teamID int) error
- func (d *TeamMemberStorage) DeleteByTeamIDAndUserID(teamID int, userID int) error
- func (d *TeamMemberStorage) DeleteByUID(uid string) error
- func (d *TeamMemberStorage) DeleteByUserID(userID int) error
- func (d *TeamMemberStorage) DoesTeamIncludedTargetUser(teamID int, userID int) (bool, error)
- func (d *TeamMemberStorage) IsNowUserIsTeamOwner(userID int) (bool, error)
- func (d *TeamMemberStorage) RetrieveByID(id int) (*TeamMember, error)
- func (d *TeamMemberStorage) RetrieveByTeamID(team_id int) ([]*TeamMember, error)
- func (d *TeamMemberStorage) RetrieveByTeamIDAndID(team_id int, id int) (*TeamMember, error)
- func (d *TeamMemberStorage) RetrieveByTeamIDAndUserID(teamID int, userID int) (*TeamMember, error)
- func (d *TeamMemberStorage) RetrieveByUID(uid string) (*TeamMember, error)
- func (d *TeamMemberStorage) RetrieveByUserID(user_id int) ([]*TeamMember, error)
- func (d *TeamMemberStorage) RetrieveTeamMemberByTeamIDAndID(teamID int, id int) (*TeamMember, error)
- func (d *TeamMemberStorage) Update(u *TeamMember) error
- type TeamMemberWithUserInfoForExport
- type TeamMemberWithUserInfoForExportConverted
- type TeamPermission
- func (tp *TeamPermission) DisableInviteLink()
- func (tp *TeamPermission) DoesBlockRegister() bool
- func (tp *TeamPermission) DoesEditorCanManageTeamMember() bool
- func (tp *TeamPermission) DoesInviteLinkEnabled() bool
- func (tp *TeamPermission) DoesViewerCanManageTeamMember() bool
- func (tp *TeamPermission) EnableInviteLink()
- func (tp *TeamPermission) ExportForTeam() string
- func (tp *TeamPermission) ImportFromTeam(team *Team)
- type TeamStorage
- func (d *TeamStorage) Create(u *Team) (int, error)
- func (d *TeamStorage) DeleteByID(id int) error
- func (d *TeamStorage) DeleteByUID(uid string) error
- func (d *TeamStorage) IsIdentifierExists(identifier string) bool
- func (d *TeamStorage) RetrieveByID(id int) (*Team, error)
- func (d *TeamStorage) RetrieveByIDs(ids []int) ([]*Team, error)
- func (d *TeamStorage) RetrieveByIdentifier(identifier string) (*Team, error)
- func (d *TeamStorage) RetrieveByUID(uid string) (*Team, error)
- func (d *TeamStorage) UpdateByID(u *Team) error
- type TeamsForExport
- type UpdateAvatarRequest
- type UpdateDomainRequest
- type UpdateInvitationCodeRequest
- type UpdateInviteRequest
- type UpdateIsTutorialViewedRequest
- type UpdateLanguageRequest
- type UpdateNicknameRequest
- type UpdateTeamConfigRequest
- type UpdateTeamMemberRequest
- type UpdateTeamMemberRoleRequest
- type UpdateTeamPermissionRequest
- type UpdateUserRequest
- type UpdateUserResponse
- type User
- func (u *User) ConstructByJSON(userJSON []byte) error
- func (u *User) Export() *UserForExport
- func (u *User) ExportEmail() string
- func (u *User) ExportID() int
- func (u *User) ExportLanguage() string
- func (u *User) ExportUserCustomization() *UserCustomization
- func (u *User) GetUIDInString() string
- func (u *User) InitCreatedAt()
- func (u *User) InitUID()
- func (u *User) InitUpdatedAt()
- func (u *User) SetAvatar(avatar string)
- func (u *User) SetID(id int)
- func (u *User) SetIsTutorialViewed(isTutorialViewed bool)
- func (u *User) SetLanguage(language string)
- func (u *User) SetNickname(nickname string)
- func (u *User) SetPasswordByByte(password []byte)
- func (u *User) SetUserCustomization(userCustomization *UserCustomization)
- func (u *User) UpdateByUpdateUserAvatarRequest(req *UpdateAvatarRequest)
- func (u *User) UpdatePendingUserBySignUpRequest(req *SignUpRequest) error
- type UserAvatarUploadAddressResponse
- type UserCustomization
- type UserForExport
- type UserSSOConfig
- type UserStorage
- func (d *UserStorage) Create(u *User) (int, error)
- func (d *UserStorage) DeleteByID(id int) error
- func (d *UserStorage) DeleteByUID(uid string) error
- func (d *UserStorage) RetrieveByEmail(email string) (*User, error)
- func (d *UserStorage) RetrieveByID(id int) (*User, error)
- func (d *UserStorage) RetrieveByIDAndUID(id int, uid uuid.UUID) (*User, error)
- func (d *UserStorage) RetrieveByIDs(ids []int) ([]*User, error)
- func (d *UserStorage) RetrieveByUID(uid uuid.UUID) (*User, error)
- func (d *UserStorage) UpdateByID(u *User) error
- func (d *UserStorage) ValidateUser(id int, uid uuid.UUID) (bool, error)
- type VCodeClaims
- type VerificationRequest
Constants ¶
View Source
const ( EMAIL_DELIVER_BASEURL = "https://email.illasoft.com/v1/" EMAIL_DELIVER_USAGE_SUBSCRIBE = "subscribe" EMAIL_DELIVER_USAGE_VERIFICATIONCODE = "code" EMAIL_DELIVER_INVITE_EMAIL = "invite" EMAIL_DELIVER_SHARE_APP_EMAIL = "shareApp" )
View Source
const ( ILLA_UNIT_APPS = 1 ILLA_UNIT_RESOURCES = 2 ILLA_UNIT_ACTIONS = 3 ILLA_UNIT_TREE_STATES = 4 ILLA_UNIT_KV_STATES = 5 ILLA_UNIT_SET_STATES = 6 ILLA_UNIT_USERS = 7 ILLA_UNIT_TEAMS = 8 ILLA_UNIT_TEAM_MEMBERS = 9 ILLA_UNIT_INVITES = 10 ILLA_UNIT_PROMOTE_CODES = 11 ILLA_UNIT_PROMOTE_CODE_USAGES = 12 ILLA_UNIT_ROLES = 13 ILLA_UNIT_USER_ROLE_RELATIONS = 14 ILLA_UNIT_UNIT_ROLE_RELATIONS = 15 ILLA_UNIT_COMPENSATING_TRANSACTIONS = 16 ILLA_UNIT_TRANSACTION_SERIALS = 17 ILLA_UNIT_CAPACITIES = 18 ILLA_UNIT_DRIVE = 19 ILLA_UNIT_APP_SNAPSHOT = 20 )
View Source
const ( USER_ROLE_ANONYMOUS = -1 USER_ROLE_OWNER = 1 USER_ROLE_ADMIN = 2 USER_ROLE_EDITOR = 3 USER_ROLE_VIEWER = 4 )
User Role ID in Team @note: this will extend as role system later.
View Source
const CATEGORY_INVITE_BY_EMAIL = 2
View Source
const CATEGORY_INVITE_BY_LINK = 1
invite record category
View Source
const CUSTOMIZATION_LANGUAGE_CS_CZ = "cs-CZ"
View Source
const CUSTOMIZATION_LANGUAGE_DA_DK = "da-DK"
View Source
const CUSTOMIZATION_LANGUAGE_DE_DE = "de-DE"
View Source
const CUSTOMIZATION_LANGUAGE_EL_GR = "el-GR"
View Source
const CUSTOMIZATION_LANGUAGE_EN_US = "en-US"
View Source
const CUSTOMIZATION_LANGUAGE_ES_ES = "es-ES"
View Source
const CUSTOMIZATION_LANGUAGE_FI_FI = "fi-FI"
View Source
const CUSTOMIZATION_LANGUAGE_FR_FR = "fr-FR"
View Source
const CUSTOMIZATION_LANGUAGE_IT_IT = "it-IT"
View Source
const CUSTOMIZATION_LANGUAGE_JA_JP = "ja-JP"
View Source
const CUSTOMIZATION_LANGUAGE_KO_KR = "ko-KR"
View Source
const CUSTOMIZATION_LANGUAGE_NL_NL = "nl-NL"
View Source
const CUSTOMIZATION_LANGUAGE_NO_NO = "no-NO"
View Source
const CUSTOMIZATION_LANGUAGE_PL_PL = "pl-PL"
View Source
const CUSTOMIZATION_LANGUAGE_PT_PT = "pt-PT"
View Source
const CUSTOMIZATION_LANGUAGE_RO_RO = "ro-RO"
View Source
const CUSTOMIZATION_LANGUAGE_RU_RU = "ru-RU"
View Source
const CUSTOMIZATION_LANGUAGE_SV_SE = "sv-SE"
View Source
const CUSTOMIZATION_LANGUAGE_UK_UA = "uk-UA"
View Source
const CUSTOMIZATION_LANGUAGE_ZH_CN = "zh-CN"
View Source
const INVITE_EMAIL_AND_SHARE_APP_TEMPLATE = "&teamIdentifier=%s&email=%s&appID=%s"
View Source
const INVITE_EMAIL_TEMPLATE = "&teamIdentifier=%s&email=%s"
View Source
const INVITE_RECORD_STATUS_OK = 1
invite record status
View Source
const INVITE_SHARE_APP_TEMPLATE = "&teamIdentifier=%s&appID=%s"
View Source
const INVITE_URI_TEMPLATE = "?inviteToken=%s"
View Source
const PENDING_USER_AVATAR = ""
View Source
const PENDING_USER_ID = 0
View Source
const PENDING_USER_NICKNAME = "pending"
View Source
const PENDING_USER_PASSWORDDIGEST = "pending"
View Source
const SHARE_LINK_RECIRECT_PAGE_URI_PARAM = "&redirectPage="
View Source
const SHARE_LINK_REDIRECT_PAGE_EDIT = "edit"
View Source
const SHARE_LINK_REDIRECT_PAGE_RELEASE = "release"
View Source
const TEAM_DEFAULT_ID = 0
View Source
const TEAM_FIELD_ICON = "icon"
View Source
const TEAM_FIELD_IDENTIFIER = "identifier"
View Source
const TEAM_FIELD_NAME = "name"
View Source
const TEAM_FOLDER_PREFIX = "team-"
View Source
const TEAM_ICON_FOLDER = "/icon"
View Source
const TEAM_MEMBER_STATUS_OK = 1
View Source
const TEAM_MEMBER_STATUS_PENDING = 2
View Source
const TEAM_P_FIELD_ALLOW_EDITOR_INVITE = "allowEditorInvite"
View Source
const TEAM_P_FIELD_ALLOW_EDITOR_MANAGE_TEAM_MEMBER = "allowEditorManageTeamMember"
View Source
const TEAM_P_FIELD_ALLOW_VIEWER_INVITE = "allowViewerInvite"
View Source
const TEAM_P_FIELD_ALLOW_VIEWER_MANAGE_TEAM_MEMBER = "allowViewerManageTeamMember"
View Source
const TEAM_P_FIELD_BLOCK_REGISTER = "blockRegister"
View Source
const TEAM_P_FIELD_INVITE_LINK_ENABLED = "inviteLinkEnabled"
View Source
const TEAM_SPACE_FOLDER = "/team"
View Source
const TEAM_SYSTEM_FOLDER = "/system"
View Source
const USER_AVATAR_FOLVER = "/avatar"
View Source
const USER_FOLDER_PREFIX = "user-"
View Source
const (
USER_JWT_TOKEN_KEY_TEMPLATE = "%d_jwt_expired_at"
)
Variables ¶
View Source
var Config *config.Config
Functions ¶
func BuildLookUpTableForInvitesExport ¶
func BuildLookUpTableForInvitesExport(invites []*Invite) map[int]*InviteForExport
func BuildLookUpTableForUserExport ¶
func BuildLookUpTableForUserExport(users []*User) map[int]*UserForExport
func BuildTeamIDLookUpTableForTeamMemberExport ¶
func BuildTeamIDLookUpTableForTeamMemberExport(teamMembers []*TeamMember) map[int]*TeamMemberForExport
func ExtractUserIDFromToken ¶
func GenerateRedirectPageParam ¶ added in v0.0.12
func PickUpTeamIDsInTeamMembers ¶
func PickUpTeamIDsInTeamMembers(teamMembers []*TeamMember) []int
func PickUpTeamMemberIDsInTeamMembers ¶
func PickUpTeamMemberIDsInTeamMembers(teamMembers []*TeamMember) []int
func PickUpUserIDsInUserMembers ¶
func PickUpUserIDsInUserMembers(teamMembers []*TeamMember) []int
func SendInviteEmail ¶
func SendInviteEmail(m *EmailInviteMessage) error
func SendShareAppEmail ¶
func SendShareAppEmail(m *EmailShareAppMessage) error
func SendSubscriptionEmail ¶
func SendVerificationEmail ¶
func ValidateAccessToken ¶
Types ¶
type AuthClaims ¶
type ChangePasswordRequest ¶
type ChangePasswordRequest struct { CurrentPassword string `json:"currentPassword" validate:"required"` NewPassword string `json:"newPassword" validate:"required"` }
func NewChangePasswordRequest ¶
func NewChangePasswordRequest() *ChangePasswordRequest
type ConfigInviteLinkRequest ¶
type ConfigInviteLinkRequest struct {
InviteLinkEnabled bool `json:"inviteLinkEnabled"`
}
func NewConfigInviteLinkRequest ¶
func NewConfigInviteLinkRequest() *ConfigInviteLinkRequest
type CreateDomainRequest ¶
type CreateDomainRequest struct { TeamID int `json:"team_id" gorm:"column:team_id;type:bigserial;index:domains_team_id"` UserDomain string `json:"user_domain" gorm:"column:user_domain;type:varchar;size:255;not null"` SystemDomainPrefix string `json:"system_domain_prefix" gorm:"column:system_domain_prefix;type:varchar;size:255;not null"` ResolveStatus int `json:"resolve_status" gorm:"column:resolve_status;type:smallint;"` Category int `json:"category" gorm:"column:category;type:smallint;"` }
func NewCreateDomainRequest ¶
func NewCreateDomainRequest() *CreateDomainRequest
type CreateInvitationCodeRequest ¶
type CreateInvitationCodeRequest struct { TeamID int `json:"teamID" gorm:"column:team_id;type:bigserial;index:invitation_code_team_id"` ConsumeStatus int `json:"consumeStatus" gorm:"column:consume_status;type:smallint;"` }
func NewCreateInvitationCodeRequest ¶
func NewCreateInvitationCodeRequest() *CreateInvitationCodeRequest
type CreateInviteRequest ¶
type CreateInviteRequest struct { TeamID int `json:"teamID" gorm:"column:team_id;type:bigserial;index:users_ukey"` Email string `json:"email" gorm:"column:email;type:varchar;size:255;;index:invite_email"` UserRole int `json:"userRole" gorm:"column:user_role;type:smallint;index:invite_user_role"` InviteStatus int `json:"inviteStatus" gorm:"column:invite_status;type:smallint;index:users_ukey"` }
func NewCreateInviteRequest ¶
func NewCreateInviteRequest() *CreateInviteRequest
type CreateTeamMemberRequest ¶
type CreateTeamMemberRequest struct { TeamID int `json:"teamID" gorm:"column:team_id;type:bigserial;index:team_members_team_and_user_id"` UserID int `json:"userID" gorm:"column:user_id;type:bigserial;index:team_members_team_and_user_id"` UserRole int `json:"userRole" gorm:"column:user_role;type:smallint"` Permission string `json:"permission" gorm:"column:authority;type:jsonb"` // for user permission config }
func NewCreateTeamMemberRequest ¶
func NewCreateTeamMemberRequest() *CreateTeamMemberRequest
type CreateTeamRequest ¶
type CreateTeamRequest struct { Name string `json:"name" validate:"required"` TeamDomain string `json:"teamDomain"` Identifier string `json:"identifier" validate:"required"` InvitationCode uuid.UUID `json:"invitationCode" validate:"required"` }
func NewCreateTeamRequest ¶
func NewCreateTeamRequest() *CreateTeamRequest
func (CreateTeamRequest) ExportIdentifier ¶
func (req CreateTeamRequest) ExportIdentifier() string
func (CreateTeamRequest) ExportInvitationCodeInUUID ¶
func (req CreateTeamRequest) ExportInvitationCodeInUUID() uuid.UUID
func (CreateTeamRequest) ExportName ¶
func (req CreateTeamRequest) ExportName() string
func (CreateTeamRequest) ExportTeamDomain ¶
func (req CreateTeamRequest) ExportTeamDomain() string
type CreateUserRequest ¶
type CreateUserRequest struct { Nickname string `json:"nickname" gorm:"column:nickname;type:varchar;size:15;not null"` PasswordDigest string `json:"passworddigest" gorm:"column:password_digest;type:varchar;size:60;not null"` Email string `json:"email" gorm:"column:email;type:varchar;size:255;not null"` SSOConfig string `json:"SSOConfig" gorm:"column:sso_config;type:jsonb"` // for single sign-on data Customization string `json:"customization" gorm:"column:customization;type:jsonb"` // for user itself customization config, including: Language, IsSubscribed }
func NewCreateUserRequest ¶
func NewCreateUserRequest() *CreateUserRequest
type CreateUserResponse ¶
type CreateUserResponse struct {
ID string `json:"id"`
}
func NewCreateUserResponse ¶
func NewCreateUserResponse(id int) *CreateUserResponse
func (*CreateUserResponse) ExportForFeedback ¶
func (resp *CreateUserResponse) ExportForFeedback() interface{}
type Drive ¶
type Drive struct { SystemDriveS3Instance S3Instance TeamDriveS3Instance S3Instance // contains filtered or unexported fields }
func NewDrive ¶
func NewDrive(systemDriveS3Instance S3Instance, teamDriveS3Instance S3Instance, logger *zap.SugaredLogger) *Drive
type EmailInviteMessage ¶
type EmailInviteMessage struct { UserName string `json:"userName"` TeamName string `json:"teamName"` TeamIcon string `json:"teamIcon"` Email string `json:"email"` JoinLink string `json:"joinLink"` Language string `json:"language"` ValidateToken string `json:"validateToken"` // token for query authorize, base64.Encoding(md5(...param + ROTOR_TOKEN)) }
func NewEmailInviteMessage ¶
func NewEmailInviteMessage(invite *Invite, team *Team, user *User) *EmailInviteMessage
func (*EmailInviteMessage) Export ¶
func (m *EmailInviteMessage) Export() map[string]string
func (*EmailInviteMessage) SetValidateToken ¶
func (m *EmailInviteMessage) SetValidateToken(token string)
type EmailShareAppMessage ¶
type EmailShareAppMessage struct {}
func NewEmailShareAppMessage ¶
func NewEmailShareAppMessage(invite *Invite, team *Team, user *User, redirectPage string) *EmailShareAppMessage
func (*EmailShareAppMessage) Export ¶
func (m *EmailShareAppMessage) Export() map[string]string
func (*EmailShareAppMessage) SetValidateToken ¶
func (m *EmailShareAppMessage) SetValidateToken(token string)
type ForgetPasswordRequest ¶
type ForgetPasswordRequest struct { Email string `json:"email" validate:"required"` NewPassword string `json:"newPassword" validate:"required"` VerificationCode string `json:"verificationCode" validate:"required"` VerificationToken string `json:"verificationToken" validate:"required"` }
func NewForgetPasswordRequest ¶
func NewForgetPasswordRequest() *ForgetPasswordRequest
type GenerateInviteLinkResponse ¶
type GenerateInviteLinkResponse struct { TeamID string `json:"teamID"` AppID string `json:"appID"` UserRole int `json:"userRole"` InviteLink string `json:"inviteLink"` }
func NewGenerateInviteLinkResponse ¶
func NewGenerateInviteLinkResponse() *GenerateInviteLinkResponse
func NewGenerateInviteLinkResponseByInvite ¶
func NewGenerateInviteLinkResponseByInvite(invite *Invite, redirectPage string) *GenerateInviteLinkResponse
func (*GenerateInviteLinkResponse) ExportForFeedback ¶
func (resp *GenerateInviteLinkResponse) ExportForFeedback() interface{}
func (*GenerateInviteLinkResponse) SetAppID ¶
func (u *GenerateInviteLinkResponse) SetAppID(appID int)
func (*GenerateInviteLinkResponse) SetInviteLink ¶
func (u *GenerateInviteLinkResponse) SetInviteLink(inviteLink string)
func (*GenerateInviteLinkResponse) SetTeamID ¶
func (u *GenerateInviteLinkResponse) SetTeamID(teamID int)
func (*GenerateInviteLinkResponse) SetUserRole ¶
func (u *GenerateInviteLinkResponse) SetUserRole(userRole int)
type GetAllTeamMembersResponse ¶
type GetAllTeamMembersResponse struct {
AllTeamMembers []*TeamMemberWithUserInfoForExportConverted
}
func NewGetAllTeamMembersResponse ¶
func NewGetAllTeamMembersResponse(d []*TeamMemberWithUserInfoForExport) *GetAllTeamMembersResponse
func (*GetAllTeamMembersResponse) ExportForFeedback ¶
func (resp *GetAllTeamMembersResponse) ExportForFeedback() interface{}
type GetMyTeamsResponse ¶
type GetMyTeamsResponse struct {
MyTeams []*MyTeamResponse
}
func NewGetMyTeamsResponse ¶
func NewGetMyTeamsResponse(teams []*Team, teamMembersLT map[int]*TeamMemberForExport) *GetMyTeamsResponse
func (*GetMyTeamsResponse) ExportForFeedback ¶
func (resp *GetMyTeamsResponse) ExportForFeedback() interface{}
type GetTargetTeamByInternalRequestResponse ¶
type GetTargetTeamByInternalRequestResponse struct { ID string `json:"id"` UID uuid.UUID `json:"uid"` Name string `json:"name"` Identifier string `json:"identifier"` Icon string `json:"icon"` Permission string `json:"permission"` // for team permission config CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
func NewGetTargetTeamByInternalRequestResponse ¶
func NewGetTargetTeamByInternalRequestResponse(team *Team) *GetTargetTeamByInternalRequestResponse
func (*GetTargetTeamByInternalRequestResponse) ExportForFeedback ¶
func (resp *GetTargetTeamByInternalRequestResponse) ExportForFeedback() interface{}
type GetTargetUserByInternalRequestResponse ¶
type GetTargetUserByInternalRequestResponse struct { ID string `json:"id"` UID uuid.UUID `json:"uid"` TeamMemberID string `json:"teamMemberID"` Nickname string `json:"nickname"` Email string `json:"email"` Avatar string `json:"avatar"` Language string `json:"language"` IsSubscribed bool `json:"isSubscribed"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
func NewGetTargetUserByInternalRequestResponse ¶
func NewGetTargetUserByInternalRequestResponse(user *User) *GetTargetUserByInternalRequestResponse
func (*GetTargetUserByInternalRequestResponse) ExportForFeedback ¶
func (resp *GetTargetUserByInternalRequestResponse) ExportForFeedback() interface{}
func (*GetTargetUserByInternalRequestResponse) SetTeamMemberID ¶
func (resp *GetTargetUserByInternalRequestResponse) SetTeamMemberID(id int)
type GetTargetUsersByInternalRequestResponse ¶ added in v0.0.12
type GetTargetUsersByInternalRequestResponse struct {
Users map[string]*GetTargetUserByInternalRequestResponse `json:"users"`
}
func NewGetTargetUsersByInternalRequestResponse ¶ added in v0.0.12
func NewGetTargetUsersByInternalRequestResponse(users []*User) *GetTargetUsersByInternalRequestResponse
func (*GetTargetUsersByInternalRequestResponse) ExportForFeedback ¶ added in v0.0.12
func (resp *GetTargetUsersByInternalRequestResponse) ExportForFeedback() interface{}
type GetTeamByTeamIDResponse ¶
type GetTeamByTeamIDResponse struct { ID string `json:"id"` UID uuid.UUID `json:"uid"` Name string `json:"name"` Identifier string `json:"identifier"` Icon string `json:"icon"` Permission *TeamPermission `json:"permission"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
func NewGetTeamByTeamIDResponse ¶
func NewGetTeamByTeamIDResponse(t *Team) *GetTeamByTeamIDResponse
func (*GetTeamByTeamIDResponse) ExportForFeedback ¶
func (resp *GetTeamByTeamIDResponse) ExportForFeedback() interface{}
type GetTeamMemberResponse ¶
type GetTeamMemberResponse struct { ID string `json:"userID"` UID uuid.UUID `json:"uid"` TeamMemberID string `json:"teamMemberID"` Nickname string `json:"nickname"` Email string `json:"email"` Avatar string `json:"avatar"` Language string `json:"language"` IsSubscribed bool `json:"isSubscribed"` UserRole int `json:"userRole"` Permission *TeamMemberPermission `json:"permission"` // for user permission config UserStatus int `json:"userStatus"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
func NewGetTeamMemberResponse ¶
func NewGetTeamMemberResponse(i *TeamMemberWithUserInfoForExport) *GetTeamMemberResponse
func (*GetTeamMemberResponse) ExportForFeedback ¶
func (resp *GetTeamMemberResponse) ExportForFeedback() interface{}
type GetTeamPermissionResponse ¶
type GetTeamPermissionResponse struct { AllowEditorInvite bool `json:"allowEditorInvite"` AllowViewerInvite bool `json:"allowViewerInvite"` AllowEditorManageTeamMember bool `json:"allowEditorManageTeamMember"` AllowViewerManageTeamMember bool `json:"allowViewerManageTeamMember"` InviteLinkEnabled bool `json:"inviteLinkEnabled"` }
func NewGetTeamPermissionResponse ¶
func NewGetTeamPermissionResponse(team *Team) *GetTeamPermissionResponse
func (*GetTeamPermissionResponse) ExportForFeedback ¶
func (resp *GetTeamPermissionResponse) ExportForFeedback() interface{}
type GetUserByIDResponse ¶
type GetUserByIDResponse struct { ID string `json:"userID"` UID uuid.UUID `json:"uid"` Nickname string `json:"nickname"` Email string `json:"email"` Avatar string `json:"avatar"` Language string `json:"language"` IsTutorialViewed bool `json:"isTutorialViewed"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
func NewGetUserByIDResponse ¶
func NewGetUserByIDResponse(user *User) *GetUserByIDResponse
func (*GetUserByIDResponse) ExportForFeedback ¶
func (resp *GetUserByIDResponse) ExportForFeedback() interface{}
type GetVerificationCodeResponse ¶
type GetVerificationCodeResponse struct {
VerificationToken string `json:"verificationToken"`
}
func NewGetVerificationCodeResponse ¶
func NewGetVerificationCodeResponse(token string) *GetVerificationCodeResponse
func (*GetVerificationCodeResponse) ExportForFeedback ¶
func (resp *GetVerificationCodeResponse) ExportForFeedback() interface{}
type Invite ¶
type Invite struct { ID int `json:"id" gorm:"column:id;type:bigserial;primary_key;index:invite_ukey"` UID uuid.UUID `json:"uid" gorm:"column:uid;type:uuid;not null;index:invite_uid"` Category int `json:"category" gorm:"column:category;type:smallint;not null"` TeamID int `json:"teamID" gorm:"column:team_id;type:bigserial;index:users_ukey"` TeamMemberID int `json:"teamMemberID" gorm:"column:team_member_id;type:bigserial"` TeamIdentifier string `json:"teamIdentifier" sql:"-" gorm:"-"` AppID int `json:"appID" sql:"-" gorm:"-"` Hosts string `json:"hosts" sql:"-" gorm:"-"` Email string `json:"email" gorm:"column:email;type:varchar;size:255;;index:invite_email"` EmailStatus bool `json:"emailStatus" gorm:"column:email_status;type:bool"` UserRole int `json:"userRole" gorm:"column:user_role;type:smallint;index:invite_user_role"` Status int `json:"status" gorm:"column:status;type:smallint;index:users_ukey"` CreatedAt time.Time `gorm:"column:created_at;type:timestamp"` UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp"` }
func NewInviteByCreateInviteRequest ¶
func NewInviteByCreateInviteRequest(req *CreateInviteRequest) *Invite
func NewInviteByUpdateInviteRequest ¶
func NewInviteByUpdateInviteRequest(req *UpdateInviteRequest) *Invite
func NewInviteEmailLinkByTeamAndRequest ¶
func NewInviteEmailLinkByTeamAndRequest(team *Team, req *InviteMemberByEmailRequest) *Invite
func (*Invite) ConstructByJSON ¶
func (*Invite) Export ¶
func (u *Invite) Export() *InviteForExport
func (*Invite) ExportAppIDInString ¶
func (*Invite) ExportEmail ¶
func (*Invite) ExportEmailStatus ¶
func (*Invite) ExportInviteLink ¶
func (*Invite) ExportInviteLinkWithEmailAndTeam ¶
func (*Invite) ExportShareAppLink ¶
func (*Invite) ExportShareAppLinkWithEmailANDTeamIdentifier ¶
func (*Invite) ExportTeamID ¶
func (*Invite) ExportTeamMemberID ¶
func (*Invite) ExportUserRole ¶
func (*Invite) ImportInviteLink ¶
func (*Invite) InitCreatedAt ¶
func (u *Invite) InitCreatedAt()
func (*Invite) InitUpdatedAt ¶
func (u *Invite) InitUpdatedAt()
func (*Invite) IsAvaliable ¶
func (*Invite) IsEmailInviteLink ¶
func (*Invite) IsInviteLink ¶
func (*Invite) IsShareAppInvite ¶
func (*Invite) SetEmailStatusFailed ¶
func (u *Invite) SetEmailStatusFailed()
func (*Invite) SetEmailStatusSuccess ¶
func (u *Invite) SetEmailStatusSuccess()
func (*Invite) SetTeamIdentifier ¶
func (*Invite) SetTeamMemberID ¶
func (*Invite) SetUserRole ¶
type InviteForExport ¶
type InviteForExport struct { ID int `json:"id"` UID uuid.UUID `json:"uid"` Category int `json:"category"` TeamID int `json:"teamID"` TeamMemberID int `json:"teamMemberID"` TeamIdentifier string `json:"teamIdentifier"` AppID int `json:"appID"` Email string `json:"email"` EmailStatus bool `json:"emailStatus"` UserRole int `json:"userRole"` Status int `json:"status"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
type InviteMemberByEmailRequest ¶
type InviteMemberByEmailRequest struct { UserRole int `json:"userRole" validate:"required"` Email string `json:"email" validate:"required,email"` AppIDRaw string `json:"appID"` // optional Hosts string `json:"hosts"` // optional AppID int `json:"-"` // optional RedirectPage string `json:"redirectPage"` // optional }
func NewInviteMemberByEmailRequest ¶
func NewInviteMemberByEmailRequest() *InviteMemberByEmailRequest
func (*InviteMemberByEmailRequest) ExportAppID ¶
func (u *InviteMemberByEmailRequest) ExportAppID() int
func (*InviteMemberByEmailRequest) ExportEmail ¶
func (u *InviteMemberByEmailRequest) ExportEmail() string
func (*InviteMemberByEmailRequest) ExportHosts ¶
func (u *InviteMemberByEmailRequest) ExportHosts() string
func (*InviteMemberByEmailRequest) ExportRedirectPage ¶ added in v0.0.12
func (u *InviteMemberByEmailRequest) ExportRedirectPage() string
func (*InviteMemberByEmailRequest) ExportUserRole ¶
func (u *InviteMemberByEmailRequest) ExportUserRole() int
func (*InviteMemberByEmailRequest) Init ¶
func (u *InviteMemberByEmailRequest) Init()
func (*InviteMemberByEmailRequest) IsShareAppInvite ¶
func (u *InviteMemberByEmailRequest) IsShareAppInvite() bool
type InviteMemberByEmailResponse ¶
type InviteMemberByEmailResponse struct { Email string `json:"email"` EmailStatus bool `json:"emailStatus"` UserRole int `json:"userRole"` TeamMemberID string `json:"teamMemberID"` AppID string `json:"appID"` Feedback string `json:"feedback"` }
func NewInviteMemberByEmailResponse ¶
func NewInviteMemberByEmailResponse() *InviteMemberByEmailResponse
func NewInviteMemberByEmailResponseByInviteRecord ¶
func NewInviteMemberByEmailResponseByInviteRecord(i *Invite, feedback string) *InviteMemberByEmailResponse
func NewInviteMemberByEmailResponseByRequest ¶
func NewInviteMemberByEmailResponseByRequest(req *InviteMemberByEmailRequest) *InviteMemberByEmailResponse
func (*InviteMemberByEmailResponse) ExportForFeedback ¶
func (resp *InviteMemberByEmailResponse) ExportForFeedback() interface{}
func (*InviteMemberByEmailResponse) SetEmail ¶
func (u *InviteMemberByEmailResponse) SetEmail(email string)
func (*InviteMemberByEmailResponse) SetEmailStatus ¶
func (u *InviteMemberByEmailResponse) SetEmailStatus(emailStatus bool)
func (*InviteMemberByEmailResponse) SetEmailStatusByInvite ¶
func (u *InviteMemberByEmailResponse) SetEmailStatusByInvite(i *Invite)
func (*InviteMemberByEmailResponse) SetFeedback ¶
func (u *InviteMemberByEmailResponse) SetFeedback(f string)
func (*InviteMemberByEmailResponse) SetUserRole ¶
func (u *InviteMemberByEmailResponse) SetUserRole(userRole int)
type InviteStorage ¶
type InviteStorage struct {
// contains filtered or unexported fields
}
func NewInviteStorage ¶
func NewInviteStorage(db *gorm.DB, logger *zap.SugaredLogger) *InviteStorage
func (*InviteStorage) DeleteByID ¶
func (d *InviteStorage) DeleteByID(id int) error
func (*InviteStorage) DeleteByTeamID ¶
func (d *InviteStorage) DeleteByTeamID(teamID int) error
func (*InviteStorage) DeleteByTeamIDAndTeamMemberID ¶
func (d *InviteStorage) DeleteByTeamIDAndTeamMemberID(teamID int, teamMemberID int) error
func (*InviteStorage) DeleteByUID ¶
func (d *InviteStorage) DeleteByUID(uid uuid.UUID) error
func (*InviteStorage) RetrieveAvaliableInviteByTeamIDAndEmail ¶
func (d *InviteStorage) RetrieveAvaliableInviteByTeamIDAndEmail(teamID int, email string) (*Invite, error)
func (*InviteStorage) RetrieveAvaliableInviteByTeamIDAndTeamMemberID ¶
func (d *InviteStorage) RetrieveAvaliableInviteByTeamIDAndTeamMemberID(teamID int, teamMemberID int) (*Invite, error)
func (*InviteStorage) RetrieveAvaliableInviteLinkByTeamIDAndUserRole ¶
func (d *InviteStorage) RetrieveAvaliableInviteLinkByTeamIDAndUserRole(teamID int, userRole int) (*Invite, error)
func (*InviteStorage) RetrieveByID ¶
func (d *InviteStorage) RetrieveByID(id int) (*Invite, error)
func (*InviteStorage) RetrieveByIDs ¶
func (d *InviteStorage) RetrieveByIDs(ids []int) ([]*Invite, error)
func (*InviteStorage) RetrieveByUID ¶
func (d *InviteStorage) RetrieveByUID(uid uuid.UUID) (*Invite, error)
func (*InviteStorage) RetrieveInviteByEmailAndTeamIDAndUserRole ¶
func (d *InviteStorage) RetrieveInviteByEmailAndTeamIDAndUserRole(teamID int, email string, userRole int) (*Invite, error)
Note: this method is not avaliable invite record inluded.
func (*InviteStorage) RetrieveInviteByEmailByIDs ¶
func (d *InviteStorage) RetrieveInviteByEmailByIDs(ids []int) ([]*Invite, error)
func (*InviteStorage) RetrieveInviteByTeamIDAndEmail ¶
func (d *InviteStorage) RetrieveInviteByTeamIDAndEmail(teamID int, email string) (*Invite, error)
func (*InviteStorage) Update ¶
func (d *InviteStorage) Update(u *Invite) error
type JWTCache ¶ added in v0.0.8
type JWTCache struct {
// contains filtered or unexported fields
}
func NewJWTCache ¶ added in v0.0.8
func NewJWTCache(cache *redis.Client, logger *zap.SugaredLogger) *JWTCache
func (*JWTCache) CleanUserJWTTokenExpiredAt ¶ added in v0.0.8
func (*JWTCache) DoesUserJWTTokenAvaliable ¶ added in v0.0.8
type MyTeamResponse ¶ added in v0.0.5
type MyTeamResponse struct { ID string `json:"id"` UID uuid.UUID `json:"uid"` Name string `json:"name"` Identifier string `json:"identifier"` Icon string `json:"icon"` MyRole int `json:"myRole"` TeamMemberID string `json:"teamMemberID"` TeamMemberPermission *TeamMemberPermission `json:"teamMemberPermission"` TeamPermission *TeamPermission `json:"permission"` JoinedAt time.Time `json:"-"` }
func NewMyTeamResponse ¶ added in v0.0.5
func NewMyTeamResponse(team *Team, targetTeamMember *TeamMember) *MyTeamResponse
func (*MyTeamResponse) ExportForFeedback ¶ added in v0.0.5
func (resp *MyTeamResponse) ExportForFeedback() interface{}
type S3Instance ¶
type SignInRequest ¶
type SignInRequest struct { Email string `json:"email" validate:"required"` Password string `json:"password" validate:"required"` }
func NewSignInRequest ¶
func NewSignInRequest() *SignInRequest
type SignUpRequest ¶
type SignUpRequest struct { Nickname string `json:"nickname" validate:"required"` Email string `json:"email" validate:"required"` Password string `json:"password" validate:"required"` Language string `` /* 152-byte string literal not displayed */ IsSubscribed bool `json:"isSubscribed"` // is subscribed are optional IsTutorialViewed bool `json:"isTutorialViewed"` VerificationCode string `json:"verificationCode"` // @todo: add validate:"required" when uset smtp server configureable VerificationToken string `json:"verificationToken"` // @todo: add validate:"required" when uset smtp server configureable InviteToken string `json:"inviteToken"` // invite token are optional }
func NewSignUpRequest ¶
func NewSignUpRequest() *SignUpRequest
func (*SignUpRequest) ExportEmail ¶
func (u *SignUpRequest) ExportEmail() string
func (*SignUpRequest) ExportInviteToken ¶
func (u *SignUpRequest) ExportInviteToken() string
func (*SignUpRequest) IsSignUpWithInviteLink ¶
func (u *SignUpRequest) IsSignUpWithInviteLink() bool
type SignUpResponse ¶
type SignUpResponse struct { ID string `json:"id"` UID uuid.UUID `json:"uid"` TeamMemberID string `json:"teamMemberID"` Nickname string `json:"nickname"` Email string `json:"email"` Avatar string `json:"avatar"` Language string `json:"language"` IsSubscribed bool `json:"isSubscribed"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
func NewSignUpResponse ¶
func NewSignUpResponse(u *User) *SignUpResponse
func (*SignUpResponse) ExportForFeedback ¶
func (resp *SignUpResponse) ExportForFeedback() interface{}
type Storage ¶
type Storage struct { UserStorage *UserStorage TeamStorage *TeamStorage TeamMemberStorage *TeamMemberStorage InviteStorage *InviteStorage }
func NewStorage ¶
func NewStorage(postgresDriver *gorm.DB, logger *zap.SugaredLogger) *Storage
type SystemDrive ¶
type SystemDrive struct { Drive S3Instance `json:"-"` UserFolder string `json:"userFolder"` }
func NewSystemDrive ¶
func NewSystemDrive(drive *Drive) *SystemDrive
func (*SystemDrive) GetUserAvatarUploadPreSignedURL ¶
func (d *SystemDrive) GetUserAvatarUploadPreSignedURL(fileName string) (string, error)
func (*SystemDrive) SetUser ¶
func (d *SystemDrive) SetUser(user *User)
type Team ¶
type Team struct { ID int `json:"id" gorm:"column:id;type:bigserial;primary_key;index:teams_ukey"` UID uuid.UUID `json:"uid" gorm:"column:uid;type:uuid;not null;index:teams_ukey"` Name string `json:"name" gorm:"column:name;type:varchar;size:255;not null"` Identifier string `json:"identifier" gorm:"column:identifier;type:varchar;size:255;not null"` Icon string `json:"icon" gorm:"column:icon;type:varchar;size:255;not null"` Permission string `json:"permission" gorm:"column:permission;type:jsonb"` // for team permission config CreatedAt time.Time `gorm:"column:created_at;type:timestamp"` UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp"` }
func (*Team) ConfigInviteLinkByRequest ¶
func (u *Team) ConfigInviteLinkByRequest(req *ConfigInviteLinkRequest)
func (*Team) ConstructByJSON ¶
func (*Team) DoesEditorOrViewerCanInviteMember ¶
func (*Team) Export ¶
func (t *Team) Export() *TeamForExport
func (*Team) ExportTeamPermission ¶
func (u *Team) ExportTeamPermission() *TeamPermission
func (*Team) GetIdentifier ¶
func (*Team) GetUIDInString ¶
func (*Team) InitCreatedAt ¶
func (u *Team) InitCreatedAt()
func (*Team) InitUpdatedAt ¶
func (u *Team) InitUpdatedAt()
func (*Team) SetTeamPermission ¶
func (u *Team) SetTeamPermission(tp *TeamPermission)
func (*Team) UpdateByUpdateTeamConfigRawRequest ¶
func (*Team) UpdateByUpdateTeamPermissionRawRequest ¶
type TeamDrive ¶
type TeamDrive struct { UID uuid.UUID `json:"uid"` Drive S3Instance `json:"-"` TeamSystemFolder string `json:"teamsystemfolder"` TeamSpaceFolder string `json:"teamspacefolder"` }
func NewTeamDrive ¶
func (*TeamDrive) GetIconUploadPreSignedURL ¶
type TeamForExport ¶
type TeamIconUploadAddressResponse ¶
type TeamIconUploadAddressResponse struct {
UploadAddress string `json:"uploadAddress"`
}
func NewTeamIconUploadAddressResponse ¶
func NewTeamIconUploadAddressResponse(presignedURL string) *TeamIconUploadAddressResponse
func (*TeamIconUploadAddressResponse) ExportForFeedback ¶
func (resp *TeamIconUploadAddressResponse) ExportForFeedback() interface{}
type TeamMember ¶
type TeamMember struct { ID int `json:"id" gorm:"column:id;type:bigserial;primary_key;index:team_members_ukey"` TeamID int `json:"team_id" gorm:"column:team_id;type:bigserial;index:team_members_team_and_user_id"` UserID int `json:"user_id" gorm:"column:user_id;type:bigserial;index:team_members_team_and_user_id"` UserRole int `json:"user_role" gorm:"column:user_role;type:smallint"` Permission string `json:"permission" gorm:"column:permission;type:jsonb"` // for user permission config Status int `json:"status" gorm:"column:status;type:smallint"` CreatedAt time.Time `gorm:"column:created_at;type:timestamp"` UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp"` }
func NewEditorTeamMemberByUserID ¶
func NewEditorTeamMemberByUserID(userID int) *TeamMember
func NewPendingTeamMemberByInvite ¶
func NewPendingTeamMemberByInvite(invite *Invite) *TeamMember
func NewTeamMember ¶
func NewTeamMember() *TeamMember
func NewTeamMemberByCreateTeamMemberRequest ¶
func NewTeamMemberByCreateTeamMemberRequest(req *CreateTeamMemberRequest) *TeamMember
func NewTeamMemberByInviteAndUserID ¶
func NewTeamMemberByInviteAndUserID(invite *Invite, userID int) *TeamMember
func NewTeamMemberByTeamIDAndUserIDAndUserRole ¶
func NewTeamMemberByTeamIDAndUserIDAndUserRole(teamID, userID, userRole int) *TeamMember
func NewTeamMemberByUpdateTeamMemberRequest ¶
func NewTeamMemberByUpdateTeamMemberRequest(req *UpdateTeamMemberRequest) *TeamMember
func (*TeamMember) ActiveUser ¶
func (u *TeamMember) ActiveUser()
func (*TeamMember) ConstructByJSON ¶
func (u *TeamMember) ConstructByJSON(TeamMemberJSON []byte) error
func (*TeamMember) Export ¶
func (u *TeamMember) Export() *TeamMemberForExport
func (*TeamMember) ExportID ¶
func (u *TeamMember) ExportID() int
func (*TeamMember) ExportPermission ¶
func (u *TeamMember) ExportPermission() *TeamMemberPermission
func (*TeamMember) ExportUserID ¶
func (u *TeamMember) ExportUserID() int
func (*TeamMember) ExportUserRole ¶
func (u *TeamMember) ExportUserRole() int
func (*TeamMember) ExportWithPendingUserInfo ¶
func (u *TeamMember) ExportWithPendingUserInfo(userForExport *UserForExport) *TeamMemberWithUserInfoForExport
func (*TeamMember) ExportWithUserInfo ¶
func (u *TeamMember) ExportWithUserInfo(userForExport *UserForExport) *TeamMemberWithUserInfoForExport
func (*TeamMember) InitCreatedAt ¶
func (u *TeamMember) InitCreatedAt()
func (*TeamMember) InitUpdatedAt ¶
func (u *TeamMember) InitUpdatedAt()
func (*TeamMember) IsAdmin ¶
func (u *TeamMember) IsAdmin() bool
func (*TeamMember) IsEditor ¶
func (u *TeamMember) IsEditor() bool
func (*TeamMember) IsOwner ¶
func (u *TeamMember) IsOwner() bool
func (*TeamMember) IsStatusOK ¶
func (u *TeamMember) IsStatusOK() bool
func (*TeamMember) IsStatusPending ¶
func (u *TeamMember) IsStatusPending() bool
func (*TeamMember) IsViewer ¶
func (u *TeamMember) IsViewer() bool
func (*TeamMember) SetID ¶
func (u *TeamMember) SetID(id int)
func (*TeamMember) SetUserID ¶
func (u *TeamMember) SetUserID(userID int)
func (*TeamMember) SetUserRole ¶
func (u *TeamMember) SetUserRole(userRole int)
func (*TeamMember) UpdateByUpdateTeamMemberRoleRequest ¶
func (u *TeamMember) UpdateByUpdateTeamMemberRoleRequest(req *UpdateTeamMemberRoleRequest)
func (*TeamMember) UpdateTeamMemberRole ¶
func (u *TeamMember) UpdateTeamMemberRole(userRole int)
type TeamMemberForExport ¶
type TeamMemberForExport struct { ID int `json:"id"` TeamID int `json:"teamID"` UserID int `json:"userID"` UserRole int `json:"userRole"` Permission *TeamMemberPermission `json:"permission"` // for user permission config Status int `json:"status"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
type TeamMemberPermission ¶
type TeamMemberPermission struct {
Config int `json:"config"`
}
func NewTeamMemberPermission ¶
func NewTeamMemberPermission() *TeamMemberPermission
func (*TeamMemberPermission) ExportForTeam ¶
func (tmp *TeamMemberPermission) ExportForTeam() string
type TeamMemberStorage ¶
type TeamMemberStorage struct {
// contains filtered or unexported fields
}
func NewTeamMemberStorage ¶
func NewTeamMemberStorage(db *gorm.DB, logger *zap.SugaredLogger) *TeamMemberStorage
func (*TeamMemberStorage) Create ¶
func (d *TeamMemberStorage) Create(u *TeamMember) (int, error)
func (*TeamMemberStorage) DeleteByID ¶
func (d *TeamMemberStorage) DeleteByID(id int) error
func (*TeamMemberStorage) DeleteByIDAndTeamID ¶
func (d *TeamMemberStorage) DeleteByIDAndTeamID(id int, teamID int) error
func (*TeamMemberStorage) DeleteByTeamID ¶
func (d *TeamMemberStorage) DeleteByTeamID(teamID int) error
func (*TeamMemberStorage) DeleteByTeamIDAndUserID ¶
func (d *TeamMemberStorage) DeleteByTeamIDAndUserID(teamID int, userID int) error
func (*TeamMemberStorage) DeleteByUID ¶
func (d *TeamMemberStorage) DeleteByUID(uid string) error
func (*TeamMemberStorage) DeleteByUserID ¶
func (d *TeamMemberStorage) DeleteByUserID(userID int) error
func (*TeamMemberStorage) DoesTeamIncludedTargetUser ¶
func (d *TeamMemberStorage) DoesTeamIncludedTargetUser(teamID int, userID int) (bool, error)
func (*TeamMemberStorage) IsNowUserIsTeamOwner ¶
func (d *TeamMemberStorage) IsNowUserIsTeamOwner(userID int) (bool, error)
func (*TeamMemberStorage) RetrieveByID ¶
func (d *TeamMemberStorage) RetrieveByID(id int) (*TeamMember, error)
func (*TeamMemberStorage) RetrieveByTeamID ¶
func (d *TeamMemberStorage) RetrieveByTeamID(team_id int) ([]*TeamMember, error)
func (*TeamMemberStorage) RetrieveByTeamIDAndID ¶
func (d *TeamMemberStorage) RetrieveByTeamIDAndID(team_id int, id int) (*TeamMember, error)
func (*TeamMemberStorage) RetrieveByTeamIDAndUserID ¶
func (d *TeamMemberStorage) RetrieveByTeamIDAndUserID(teamID int, userID int) (*TeamMember, error)
func (*TeamMemberStorage) RetrieveByUID ¶
func (d *TeamMemberStorage) RetrieveByUID(uid string) (*TeamMember, error)
func (*TeamMemberStorage) RetrieveByUserID ¶
func (d *TeamMemberStorage) RetrieveByUserID(user_id int) ([]*TeamMember, error)
func (*TeamMemberStorage) RetrieveTeamMemberByTeamIDAndID ¶
func (d *TeamMemberStorage) RetrieveTeamMemberByTeamIDAndID(teamID int, id int) (*TeamMember, error)
func (*TeamMemberStorage) Update ¶
func (d *TeamMemberStorage) Update(u *TeamMember) error
type TeamMemberWithUserInfoForExport ¶
type TeamMemberWithUserInfoForExport struct { ID int `json:"userID"` UID uuid.UUID `json:"uid"` TeamMemberID int `json:"teamMemberID"` Nickname string `json:"nickname"` Email string `json:"email"` Avatar string `json:"avatar"` Language string `json:"language"` IsSubscribed bool `json:"isSubscribed"` UserRole int `json:"userRole"` Permission *TeamMemberPermission `json:"permission"` // for user permission config UserStatus int `json:"userStatus"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
type TeamMemberWithUserInfoForExportConverted ¶
type TeamMemberWithUserInfoForExportConverted struct { ID string `json:"userID"` UID uuid.UUID `json:"uid"` TeamMemberID string `json:"teamMemberID"` Nickname string `json:"nickname"` Email string `json:"email"` Avatar string `json:"avatar"` Language string `json:"language"` IsSubscribed bool `json:"isSubscribed"` UserRole int `json:"userRole"` Permission *TeamMemberPermission `json:"permission"` // for user permission config UserStatus int `json:"userStatus"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` }
func NewTeamMemberWithUserInfoForExportConverted ¶
func NewTeamMemberWithUserInfoForExportConverted(i *TeamMemberWithUserInfoForExport) *TeamMemberWithUserInfoForExportConverted
type TeamPermission ¶
type TeamPermission struct { AllowEditorInvite bool `json:"allowEditorInvite"` AllowViewerInvite bool `json:"allowViewerInvite"` AllowEditorManageTeamMember bool `json:"allowEditorManageTeamMember"` AllowViewerManageTeamMember bool `json:"allowViewerManageTeamMember"` InviteLinkEnabled bool `json:"inviteLinkEnabled"` BlockRegister bool `json:"blockRegister"` }
func NewTeamPermission ¶
func NewTeamPermission() *TeamPermission
func (*TeamPermission) DisableInviteLink ¶
func (tp *TeamPermission) DisableInviteLink()
func (*TeamPermission) DoesBlockRegister ¶ added in v0.0.15
func (tp *TeamPermission) DoesBlockRegister() bool
func (*TeamPermission) DoesEditorCanManageTeamMember ¶
func (tp *TeamPermission) DoesEditorCanManageTeamMember() bool
func (*TeamPermission) DoesInviteLinkEnabled ¶
func (tp *TeamPermission) DoesInviteLinkEnabled() bool
func (*TeamPermission) DoesViewerCanManageTeamMember ¶
func (tp *TeamPermission) DoesViewerCanManageTeamMember() bool
func (*TeamPermission) EnableInviteLink ¶
func (tp *TeamPermission) EnableInviteLink()
func (*TeamPermission) ExportForTeam ¶
func (tp *TeamPermission) ExportForTeam() string
func (*TeamPermission) ImportFromTeam ¶
func (tp *TeamPermission) ImportFromTeam(team *Team)
type TeamStorage ¶
type TeamStorage struct {
// contains filtered or unexported fields
}
func NewTeamStorage ¶
func NewTeamStorage(db *gorm.DB, logger *zap.SugaredLogger) *TeamStorage
func (*TeamStorage) DeleteByID ¶
func (d *TeamStorage) DeleteByID(id int) error
func (*TeamStorage) DeleteByUID ¶
func (d *TeamStorage) DeleteByUID(uid string) error
func (*TeamStorage) IsIdentifierExists ¶
func (d *TeamStorage) IsIdentifierExists(identifier string) bool
func (*TeamStorage) RetrieveByID ¶
func (d *TeamStorage) RetrieveByID(id int) (*Team, error)
func (*TeamStorage) RetrieveByIDs ¶
func (d *TeamStorage) RetrieveByIDs(ids []int) ([]*Team, error)
func (*TeamStorage) RetrieveByIdentifier ¶
func (d *TeamStorage) RetrieveByIdentifier(identifier string) (*Team, error)
func (*TeamStorage) RetrieveByUID ¶
func (d *TeamStorage) RetrieveByUID(uid string) (*Team, error)
func (*TeamStorage) UpdateByID ¶
func (d *TeamStorage) UpdateByID(u *Team) error
type TeamsForExport ¶
type TeamsForExport []*TeamForExport
func NewTeamsForExport ¶
func NewTeamsForExport(teams []*Team) (r TeamsForExport)
type UpdateAvatarRequest ¶
type UpdateAvatarRequest struct {
Avatar string `json:"avatar" validate:"required"`
}
func NewUpdateAvatarRequest ¶
func NewUpdateAvatarRequest() *UpdateAvatarRequest
type UpdateDomainRequest ¶
type UpdateDomainRequest struct { ID int `json:"id" gorm:"column:id;type:bigserial;primary_key;index:domains_ukey"` UID uuid.UUID `json:"uid" gorm:"column:uid;type:uuid;not null;index:domains_ukey"` TeamID int `json:"teamID" gorm:"column:team_id;type:bigserial;index:domains_team_id"` UserDomain string `json:"userDomain" gorm:"column:user_domain;type:varchar;size:255;not null"` SystemDomainPrefix string `json:"systemDomain_prefix" gorm:"column:system_domain_prefix;type:varchar;size:255;not null"` ResolveStatus int `json:"resolveStatus" gorm:"column:resolve_status;type:smallint;"` Category int `json:"category" gorm:"column:category;type:smallint;"` }
func NewUpdateDomainRequest ¶
func NewUpdateDomainRequest() *UpdateDomainRequest
type UpdateInvitationCodeRequest ¶
type UpdateInvitationCodeRequest struct { ID int `json:"id" gorm:"column:id;type:bigserial;primary_key;index:teams_ukey"` UID uuid.UUID `json:"uid" gorm:"column:uid;type:uuid;not null;index:teams_ukey"` TeamID int `json:"teamID" gorm:"column:team_id;type:bigserial;index:invitation_code_team_id"` ConsumeStatus int `json:"consumeStatus" gorm:"column:consume_status;type:smallint;"` }
func NewUpdateInvitationCodeRequest ¶
func NewUpdateInvitationCodeRequest() *UpdateInvitationCodeRequest
type UpdateInviteRequest ¶
type UpdateInviteRequest struct { ID int `json:"id" gorm:"column:id;type:bigserial;primary_key;index:invite_ukey"` UID uuid.UUID `json:"uid" gorm:"column:uid;type:uuid;not null;index:invite_uid"` TeamID int `json:"teamID" gorm:"column:team_id;type:bigserial;index:users_ukey"` Email string `json:"email" gorm:"column:email;type:varchar;size:255;;index:invite_email"` UserRole int `json:"userRole" gorm:"column:user_role;type:smallint;index:invite_user_role"` Status int `json:"status" gorm:"column:status;type:smallint;index:users_ukey"` }
func NewUpdateInviteRequest ¶
func NewUpdateInviteRequest() *UpdateInviteRequest
type UpdateIsTutorialViewedRequest ¶ added in v0.0.7
type UpdateIsTutorialViewedRequest struct {
IsTutorialViewed bool `json:"isTutorialViewed" validate:"boolean"`
}
func NewUpdateIsTutorialViewedRequest ¶ added in v0.0.7
func NewUpdateIsTutorialViewedRequest() *UpdateIsTutorialViewedRequest
type UpdateLanguageRequest ¶
type UpdateLanguageRequest struct {
Language string `` /* 152-byte string literal not displayed */
}
func NewUpdateLanguageRequest ¶
func NewUpdateLanguageRequest() *UpdateLanguageRequest
type UpdateNicknameRequest ¶
type UpdateNicknameRequest struct {
Nickname string `json:"nickname" validate:"required"`
}
func NewUpdateNicknameRequest ¶
func NewUpdateNicknameRequest() *UpdateNicknameRequest
type UpdateTeamConfigRequest ¶
type UpdateTeamConfigRequest struct { Name string `json:"name" validate:"required"` Identifier string `json:"identifier" validate:"required"` Icon string `json:"icon"` }
func NewUpdateTeamConfigRequest ¶
func NewUpdateTeamConfigRequest(rawReq map[string]interface{}) *UpdateTeamConfigRequest
type UpdateTeamMemberRequest ¶
type UpdateTeamMemberRequest struct { ID int `json:"id" gorm:"column:id;type:bigserial;primary_key;index:team_members_ukey"` TeamID int `json:"teamID" gorm:"column:team_id;type:bigserial;index:team_members_team_and_user_id"` UserID int `json:"userID" gorm:"column:user_id;type:bigserial;index:team_members_team_and_user_id"` UserRole int `json:"userRole" gorm:"column:user_role;type:smallint"` Permission string `json:"permission" gorm:"column:authority;type:jsonb"` // for user permission config }
func NewUpdateTeamMemberRequest ¶
func NewUpdateTeamMemberRequest() *UpdateTeamMemberRequest
type UpdateTeamMemberRoleRequest ¶
type UpdateTeamMemberRoleRequest struct {
UserRole int `json:"userRole" validate:"required"`
}
func NewUpdateTeamMemberRoleRequest ¶
func NewUpdateTeamMemberRoleRequest() *UpdateTeamMemberRoleRequest
func (*UpdateTeamMemberRoleRequest) ExportUserRole ¶
func (u *UpdateTeamMemberRoleRequest) ExportUserRole() int
func (*UpdateTeamMemberRoleRequest) IsTransferOwner ¶
func (u *UpdateTeamMemberRoleRequest) IsTransferOwner() bool
type UpdateTeamPermissionRequest ¶
type UpdateTeamPermissionRequest struct { AllowEditorInvite bool `json:"allowEditorInvite"` AllowViewerInvite bool `json:"allowViewerInvite"` AllowEditorManageTeamMember bool `json:"allowEditorManageTeamMember"` AllowViewerManageTeamMember bool `json:"allowViewerManageTeamMember"` }
func NewUpdateTeamPermissionRequest ¶
func NewUpdateTeamPermissionRequest(rawReq map[string]interface{}) *UpdateTeamPermissionRequest
type UpdateUserRequest ¶
type UpdateUserRequest struct { ID string `json:"id" gorm:"column:id;type:bigserial;primary_key;index:users_ukey"` UID uuid.UUID `json:"uid" gorm:"column:uid;type:uuid;not null;index:users_ukey"` Nickname string `json:"nickname" gorm:"column:nickname;type:varchar;size:15;not null"` PasswordDigest string `json:"passworddigest" gorm:"column:password_digest;type:varchar;size:60;not null"` Email string `json:"email" gorm:"column:email;type:varchar;size:255;not null"` Avatar string `json:"avatar" gorm:"column:avatar;type:varchar;size:255;not null"` SSOConfig string `json:"SSOConfig" gorm:"column:sso_config;type:jsonb"` // for single sign-on data Customization string `json:"customization" gorm:"column:customization;type:jsonb"` // for user itself customization config, including: Language, IsSubscribed }
func NewUpdateUserRequest ¶
func NewUpdateUserRequest() *UpdateUserRequest
type UpdateUserResponse ¶
type UpdateUserResponse struct { ID string `json:"id"` UID uuid.UUID `json:"uid"` TeamMemberID string `json:"teamMemberID"` Nickname string `json:"nickname"` Email string `json:"email"` Avatar string `json:"avatar"` Language string `json:"language"` IsSubscribed bool `json:"isSubscribed"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
func NewUpdateUserResponse ¶
func NewUpdateUserResponse(user *User) *UpdateUserResponse
func (*UpdateUserResponse) ExportForFeedback ¶
func (resp *UpdateUserResponse) ExportForFeedback() interface{}
type User ¶
type User struct { ID int `json:"id" gorm:"column:id;type:bigserial;primary_key;index:users_ukey"` UID uuid.UUID `json:"uid" gorm:"column:uid;type:uuid;not null;index:users_ukey"` Nickname string `json:"nickname" gorm:"column:nickname;type:varchar;size:15"` PasswordDigest string `json:"passworddigest" gorm:"column:password_digest;type:varchar;size:60;not null"` Email string `json:"email" gorm:"column:email;type:varchar;size:255;not null"` Avatar string `json:"avatar" gorm:"column:avatar;type:varchar;size:255;not null"` SSOConfig string `json:"SSOConfig" gorm:"column:sso_config;type:jsonb"` // for single sign-on data Customization string `json:"customization" gorm:"column:customization;type:jsonb"` // for user itself customization config, including: Language, IsSubscribed CreatedAt time.Time `gorm:"column:created_at;type:timestamp"` UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp"` }
func NewPendingUserByInvite ¶
func NewPendingUserByInviteForExport ¶
func NewPendingUserByInviteForExport(inviteForExport *InviteForExport) (*User, error)
func NewUserByCreateUserRequest ¶
func NewUserByCreateUserRequest(req *CreateUserRequest) *User
func NewUserBySignUpRequest ¶
func NewUserBySignUpRequest(req *SignUpRequest) (*User, error)
func (*User) ConstructByJSON ¶
func (*User) Export ¶
func (u *User) Export() *UserForExport
func (*User) ExportEmail ¶
func (*User) ExportLanguage ¶
func (*User) ExportUserCustomization ¶
func (u *User) ExportUserCustomization() *UserCustomization
func (*User) GetUIDInString ¶
func (*User) InitCreatedAt ¶
func (u *User) InitCreatedAt()
func (*User) InitUpdatedAt ¶
func (u *User) InitUpdatedAt()
func (*User) SetIsTutorialViewed ¶ added in v0.0.7
func (*User) SetLanguage ¶
func (*User) SetNickname ¶
func (*User) SetPasswordByByte ¶
func (*User) SetUserCustomization ¶
func (u *User) SetUserCustomization(userCustomization *UserCustomization)
func (*User) UpdateByUpdateUserAvatarRequest ¶
func (u *User) UpdateByUpdateUserAvatarRequest(req *UpdateAvatarRequest)
func (*User) UpdatePendingUserBySignUpRequest ¶
func (u *User) UpdatePendingUserBySignUpRequest(req *SignUpRequest) error
type UserAvatarUploadAddressResponse ¶
type UserAvatarUploadAddressResponse struct {
UploadAddress string `json:"uploadAddress"`
}
func NewUserAvatarUploadAddressResponse ¶
func NewUserAvatarUploadAddressResponse(presignedURL string) *UserAvatarUploadAddressResponse
func (*UserAvatarUploadAddressResponse) ExportForFeedback ¶
func (resp *UserAvatarUploadAddressResponse) ExportForFeedback() interface{}
type UserCustomization ¶
func NewUserCustomization ¶
func NewUserCustomization() *UserCustomization
func NewUserCustomizationBySignUpRequest ¶
func NewUserCustomizationBySignUpRequest(req *SignUpRequest) *UserCustomization
func (*UserCustomization) Export ¶
func (c *UserCustomization) Export() (string, error)
func (*UserCustomization) SetIsSubscribed ¶
func (c *UserCustomization) SetIsSubscribed(isSubscribed bool)
func (*UserCustomization) SetIsTutorialViewed ¶ added in v0.0.7
func (c *UserCustomization) SetIsTutorialViewed(isTutorialViewed bool)
func (*UserCustomization) SetLanguage ¶
func (c *UserCustomization) SetLanguage(language string)
type UserForExport ¶
type UserForExport struct { ID int `json:"id"` UID uuid.UUID `json:"uid"` TeamMemberID int `json:"teamMemberID"` Nickname string `json:"nickname"` Email string `json:"email"` Avatar string `json:"avatar"` Language string `json:"language"` IsSubscribed bool `json:"isSubscribed"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
func (*UserForExport) SetTeamMemberID ¶
func (ufe *UserForExport) SetTeamMemberID(teamMemberID int)
type UserSSOConfig ¶
type UserSSOConfig struct {
Github string
}
func NewUserSSOConfig ¶
func NewUserSSOConfig() *UserSSOConfig
func (*UserSSOConfig) Export ¶
func (u *UserSSOConfig) Export() string
type UserStorage ¶
type UserStorage struct {
// contains filtered or unexported fields
}
func NewUserStorage ¶
func NewUserStorage(db *gorm.DB, logger *zap.SugaredLogger) *UserStorage
func (*UserStorage) DeleteByID ¶
func (d *UserStorage) DeleteByID(id int) error
func (*UserStorage) DeleteByUID ¶
func (d *UserStorage) DeleteByUID(uid string) error
func (*UserStorage) RetrieveByEmail ¶
func (d *UserStorage) RetrieveByEmail(email string) (*User, error)
func (*UserStorage) RetrieveByID ¶
func (d *UserStorage) RetrieveByID(id int) (*User, error)
func (*UserStorage) RetrieveByIDAndUID ¶
func (*UserStorage) RetrieveByIDs ¶
func (d *UserStorage) RetrieveByIDs(ids []int) ([]*User, error)
func (*UserStorage) RetrieveByUID ¶
func (d *UserStorage) RetrieveByUID(uid uuid.UUID) (*User, error)
func (*UserStorage) UpdateByID ¶
func (d *UserStorage) UpdateByID(u *User) error
func (*UserStorage) ValidateUser ¶
type VCodeClaims ¶
type VerificationRequest ¶
type VerificationRequest struct { Email string `json:"email" validate:"required"` Usage string `json:"usage" validate:"oneof=signup forgetpwd"` }
func NewVerificationRequest ¶
func NewVerificationRequest() *VerificationRequest
Source Files ¶
- access_token.go
- cache.go
- change_password_request.go
- config_invite_link_request.go
- create_domain_request.go
- create_invitation_code_request.go
- create_invite_request.go
- create_team_member_request.go
- create_team_request.go
- create_user_request.go
- create_user_response.go
- drive.go
- forget_password_request.go
- generate_invite_link_response.go
- get_all_team_members_response.go
- get_my_teams_response.go
- get_target_team_by_internal_request_response.go
- get_target_user_by_internal_request_response.go
- get_target_users_by_internal_request_response.go
- get_team_by_team_id_response.go
- get_team_icon_upload_address_response.go
- get_team_member_response.go
- get_team_permission_response.go
- get_user_avatar_upload_address_response.go
- get_user_by_id_response.go
- get_verfication_code_response.go
- illa_cloud_peripheral_api.go
- illa_unit.go
- init.go
- invite.go
- invite_member_by_email_request.go
- invite_member_by_email_response.go
- invite_storage.go
- jwt_cache.go
- response.go
- sign_in_request.go
- sign_up_request.go
- sign_up_response.go
- storage.go
- system_drive.go
- team.go
- team_drive.go
- team_member.go
- team_member_storage.go
- team_storage.go
- update_avatar_request.go
- update_domain_request.go
- update_invitation_code_request.go
- update_invite_request.go
- update_is_tutorial_viewed_request.go
- update_language_request.go
- update_nickname_request.go
- update_nickname_response.go
- update_team_config_request.go
- update_team_member_request.go
- update_team_member_role_request.go
- update_team_permission_request.go
- update_user_request.go
- user.go
- user_storage.go
- verification_code.go
- verification_request.go
Click to show internal directories.
Click to hide internal directories.