Documentation ¶
Index ¶
- Constants
- Variables
- type AlphaProgramField
- type AsProjectMember
- type AuditLogEntry
- type AuditLogField
- type BetaProgramField
- type BulkFetched
- type CreatedAtField
- type EditorConfig
- type EditorConfigField
- type EmailConfirmedAtField
- type EmailDetails
- type EmailDetailsWithDefaultFlag
- type EmailField
- type EmailsField
- type EpochField
- type Features
- type FeaturesField
- type FirstNameField
- type ForActivateUserPage
- type ForCreation
- type ForEmailChange
- type ForPasswordChange
- type ForSession
- type ForSettingsPage
- type HashedPasswordField
- type IdField
- type LastLoggedInField
- type LastLoginIpField
- type LastNameField
- type LearnedWordsField
- type LoginCountField
- type Manager
- type MustReconfirmField
- type ProjectListViewCaller
- type WithLoadEditorInfo
- type WithLoginInfo
- type WithNames
- type WithPublicInfo
- type WithPublicInfoAndFeatures
- type WithPublicInfoAndNonStandardId
Constants ¶
View Source
const ( AuditLogOperationChangePrimaryEmail = "change-primary-email" AuditLogOperationClearSessions = "clear-sessions" AuditLogOperationLogin = "login" AuditLogOperationResetPassword = "reset-password" AuditLogOperationUpdatePassword = "update-password" AuditLogOperationSoftDeletion = "soft-deletion" AuditLogOperationCreateAccount = "create-account" )
View Source
const (
AnonymousUserEpoch = 1
)
Variables ¶
View Source
var DefaultEditorConfig = EditorConfig{ AutoComplete: true, AutoPairDelimiters: true, FontFamily: editorFontFamilyLucida, FontSize: 12, LineHeight: editorLineHightNormal, Mode: editorModeDefault, OverallTheme: editorOverallThemeNone, PDFViewer: editorPdfViewerPdfjs, SyntaxValidation: true, SpellCheckLanguage: "en", Theme: "textmate", }
View Source
var EditorThemes = []string{
"ambiance",
"chaos",
"chrome",
"clouds",
"clouds_midnight",
"cobalt",
"crimson_editor",
"dawn",
"dracula",
"dreamweaver",
"eclipse",
"github",
"gob",
"gruvbox",
"idle_fingers",
"iplastic",
"katzenmilch",
"kr_theme",
"kuroir",
"merbivore",
"merbivore_soft",
"mono_industrial",
"monokai",
"overleaf",
"pastel_on_dark",
"solarized_dark",
"solarized_light",
"sqlserver",
"terminal",
"textmate",
"tomorrow",
"tomorrow_night",
"tomorrow_night_blue",
"tomorrow_night_bright",
"tomorrow_night_eighties",
"twilight",
"vibrant_ink",
"xcode",
}
EditorThemes lists all the available theme names for the editor.
View Source
var ErrEmailAlreadyRegistered = &errors.InvalidStateError{
Msg: "email already registered",
}
View Source
var ErrEpochChanged = &errors.InvalidStateError{Msg: "user epoch changed"}
Functions ¶
This section is empty.
Types ¶
type AlphaProgramField ¶
type AlphaProgramField struct {
AlphaProgram bool `json:"alphaProgram"`
}
type AsProjectMember ¶
type AsProjectMember struct { WithPublicInfo PrivilegeLevel sharedTypes.PrivilegeLevel `json:"privileges"` }
type AuditLogEntry ¶
type AuditLogField ¶
type AuditLogField struct {
AuditLog []AuditLogEntry
}
type BetaProgramField ¶
type BetaProgramField struct {
BetaProgram bool `json:"betaProgram"`
}
type BulkFetched ¶
type BulkFetched []WithPublicInfo
func (BulkFetched) Get ¶
func (b BulkFetched) Get(uuid sharedTypes.UUID) WithPublicInfo
func (BulkFetched) GetUserNonStandardId ¶
func (b BulkFetched) GetUserNonStandardId(uuid sharedTypes.UUID) WithPublicInfoAndNonStandardId
func (*BulkFetched) ScanFrom ¶
func (b *BulkFetched) ScanFrom(r pgx.Rows) error
type CreatedAtField ¶
type EditorConfig ¶
type EditorConfig struct { FontFamily string `json:"fontFamily"` FontSize int64 `json:"fontSize"` LineHeight string `json:"lineHeight"` Mode string `json:"mode"` OverallTheme string `json:"overallTheme"` PDFViewer string `json:"pdfViewer"` SpellCheckLanguage spellingTypes.SpellCheckLanguage `json:"spellCheckLanguage"` Theme string `json:"theme"` SyntaxValidation bool `json:"syntaxValidation"` AutoComplete bool `json:"autoComplete"` AutoPairDelimiters bool `json:"autoPairDelimiters"` }
func (*EditorConfig) Validate ¶
func (e *EditorConfig) Validate() error
type EditorConfigField ¶
type EditorConfigField struct {
EditorConfig EditorConfig `json:"ace"`
}
type EmailConfirmedAtField ¶
type EmailDetails ¶
type EmailDetails struct { ConfirmedAt *time.Time `json:"confirmedAt"` Email sharedTypes.Email `json:"email"` }
type EmailDetailsWithDefaultFlag ¶
type EmailDetailsWithDefaultFlag struct { EmailDetails IsDefault bool `json:"default"` }
type EmailField ¶
type EmailField struct {
Email sharedTypes.Email `json:"email"`
}
type EmailsField ¶
type EmailsField struct {
Emails []EmailDetails `json:"emails"`
}
type EpochField ¶
type EpochField struct {
Epoch int64 `json:"epoch"`
}
type Features ¶
type Features struct { Collaborators int `json:"collaborators,omitempty"` CompileTimeout sharedTypes.ComputeTimeout `json:"compileTimeout"` CompileGroup sharedTypes.CompileGroup `json:"compileGroup"` Versioning bool `json:"versioning,omitempty"` }
type FeaturesField ¶
type FeaturesField struct {
Features Features `json:"features"`
}
type FirstNameField ¶
type FirstNameField struct {
FirstName string `json:"first_name"`
}
type ForActivateUserPage ¶
type ForActivateUserPage struct { EmailField LoginCountField }
type ForCreation ¶
type ForCreation struct { ForSession AuditLogField EditorConfigField EmailsField FeaturesField HashedPasswordField LastLoggedInField LastLoginIpField LoginCountField CreatedAtField oneTimeToken.OneTimeToken OneTimeTokenUse string }
func NewUser ¶
func NewUser(email sharedTypes.Email) ForCreation
type ForEmailChange ¶
type ForEmailChange struct { EmailField EpochField IdField }
type ForPasswordChange ¶
type ForPasswordChange struct { WithPublicInfo EpochField HashedPasswordField }
type ForSession ¶
type ForSession struct { EpochField WithPublicInfo }
type ForSettingsPage ¶
type ForSettingsPage struct { WithPublicInfo BetaProgramField }
type HashedPasswordField ¶
type HashedPasswordField struct {
HashedPassword string `json:"-"`
}
type IdField ¶
type IdField struct {
Id sharedTypes.UUID `json:"_id"`
}
type LastLoggedInField ¶
type LastLoginIpField ¶
type LastLoginIpField struct {
LastLoginIp string
}
type LastNameField ¶
type LastNameField struct {
LastName string `json:"last_name"`
}
type LearnedWordsField ¶
type LearnedWordsField struct {
LearnedWords []string `json:"learnedWords"`
}
type LoginCountField ¶
type LoginCountField struct {
LoginCount int64
}
type Manager ¶
type Manager interface { CreateUser(ctx context.Context, u *ForCreation) error SoftDelete(ctx context.Context, userId sharedTypes.UUID, ip string) error HardDelete(ctx context.Context, userId sharedTypes.UUID) error ProcessSoftDeleted(ctx context.Context, cutOff time.Time, fn func(userId sharedTypes.UUID) bool) error TrackClearSessions(ctx context.Context, userId sharedTypes.UUID, ip string, info interface{}) error BumpEpoch(ctx context.Context, userId sharedTypes.UUID) error CheckEmailAlreadyRegistered(ctx context.Context, email sharedTypes.Email) error GetUser(ctx context.Context, userId sharedTypes.UUID, target interface{}) error GetUserByEmail(ctx context.Context, email sharedTypes.Email, target interface{}) error GetContacts(ctx context.Context, userId sharedTypes.UUID) ([]WithPublicInfo, error) SetBetaProgram(ctx context.Context, userId sharedTypes.UUID, joined bool) error UpdateEditorConfig(ctx context.Context, userId sharedTypes.UUID, config EditorConfig) error TrackLogin(ctx context.Context, userId sharedTypes.UUID, epoch int64, ip string) error ChangeEmailAddress(ctx context.Context, change ForEmailChange, ip string, newEmail sharedTypes.Email) error SetUserName(ctx context.Context, userId sharedTypes.UUID, u WithNames) error ChangePassword(ctx context.Context, change ForPasswordChange, ip, operation string, newHashedPassword string) error DeleteDictionary(ctx context.Context, userId sharedTypes.UUID) error LearnWord(ctx context.Context, userId sharedTypes.UUID, word string) error UnlearnWord(ctx context.Context, userId sharedTypes.UUID, word string) error GetByPasswordResetToken(ctx context.Context, token oneTimeToken.OneTimeToken, u *ForPasswordChange) error }
type MustReconfirmField ¶
type MustReconfirmField struct {
MustReconfirm bool
}
type ProjectListViewCaller ¶
type ProjectListViewCaller struct { WithPublicInfoAndNonStandardId EmailConfirmedAtField }
func (*ProjectListViewCaller) ToUserEmails ¶
func (u *ProjectListViewCaller) ToUserEmails() []EmailDetailsWithDefaultFlag
type WithLoadEditorInfo ¶
type WithLoadEditorInfo struct { EditorConfigField AlphaProgramField BetaProgramField EpochField LearnedWordsField WithPublicInfoAndFeatures }
type WithLoginInfo ¶
type WithLoginInfo struct { ForSession HashedPasswordField MustReconfirmField }
type WithNames ¶
type WithNames struct { FirstNameField LastNameField }
type WithPublicInfo ¶
type WithPublicInfo struct { EmailField FirstNameField IdField LastNameField }
func (*WithPublicInfo) DisplayName ¶
func (u *WithPublicInfo) DisplayName() string
type WithPublicInfoAndFeatures ¶
type WithPublicInfoAndFeatures struct { FeaturesField WithPublicInfo }
type WithPublicInfoAndNonStandardId ¶
type WithPublicInfoAndNonStandardId struct { WithPublicInfo IdNoUnderscore sharedTypes.UUID `json:"id"` }
Click to show internal directories.
Click to hide internal directories.