Documentation
¶
Index ¶
- Constants
- Variables
- type ActivityAssetPermit
- type ActivityAssetRepo
- func (r *ActivityAssetRepo) CheckConnection() error
- func (r *ActivityAssetRepo) Close()
- func (r *ActivityAssetRepo) Connect(ctx context.Context, activityAsset *data.ActivityAsset) (*ActivityAssetPermit, error)
- func (r *ActivityAssetRepo) CountByActivity(ctx context.Context, activityID string) (int32, error)
- func (r *ActivityAssetRepo) Disconnect(ctx context.Context, activityAsset *data.ActivityAsset) error
- func (r *ActivityAssetRepo) Get(ctx context.Context, assetID string) (*ActivityAssetPermit, error)
- func (r *ActivityAssetRepo) GetByActivity(ctx context.Context, activityID string, po *data.PageOptions) ([]*ActivityAssetPermit, error)
- func (r *ActivityAssetRepo) GetByActivityAndNumber(ctx context.Context, activityID string, number int32) (*ActivityAssetPermit, error)
- func (r *ActivityAssetRepo) Move(ctx context.Context, activityAsset *data.ActivityAsset, afterAssetID string) (*data.ActivityAsset, error)
- func (r *ActivityAssetRepo) Open(p *Permitter) error
- type ActivityPermit
- func (r *ActivityPermit) AdvancedAt() (*time.Time, error)
- func (r *ActivityPermit) CreatedAt() (time.Time, error)
- func (r *ActivityPermit) Description() (string, error)
- func (r *ActivityPermit) Get() *data.Activity
- func (r *ActivityPermit) ID() (*mytype.OID, error)
- func (r *ActivityPermit) LessonID() (*mytype.OID, error)
- func (r *ActivityPermit) Name() (string, error)
- func (r *ActivityPermit) Number() (int32, error)
- func (r *ActivityPermit) StudyID() (*mytype.OID, error)
- func (r *ActivityPermit) UpdatedAt() (time.Time, error)
- func (r *ActivityPermit) UserID() (*mytype.OID, error)
- type ActivityRepo
- func (r *ActivityRepo) CheckConnection() error
- func (r *ActivityRepo) Close()
- func (r *ActivityRepo) CountByLesson(ctx context.Context, lessonID string, filters *data.ActivityFilterOptions) (int32, error)
- func (r *ActivityRepo) CountBySearch(ctx context.Context, filters *data.ActivityFilterOptions) (int32, error)
- func (r *ActivityRepo) CountByStudy(ctx context.Context, studyID string, filters *data.ActivityFilterOptions) (int32, error)
- func (r *ActivityRepo) CountByUser(ctx context.Context, userID string, filters *data.ActivityFilterOptions) (int32, error)
- func (r *ActivityRepo) Create(ctx context.Context, c *data.Activity) (*ActivityPermit, error)
- func (r *ActivityRepo) Delete(ctx context.Context, activity *data.Activity) error
- func (r *ActivityRepo) Get(ctx context.Context, id string) (*ActivityPermit, error)
- func (r *ActivityRepo) GetByLesson(ctx context.Context, lessonID string, po *data.PageOptions, ...) ([]*ActivityPermit, error)
- func (r *ActivityRepo) GetByName(ctx context.Context, studyID, name string) (*ActivityPermit, error)
- func (r *ActivityRepo) GetByNumber(ctx context.Context, studyID string, number int32) (*ActivityPermit, error)
- func (r *ActivityRepo) GetByStudy(ctx context.Context, studyID string, po *data.PageOptions, ...) ([]*ActivityPermit, error)
- func (r *ActivityRepo) GetByStudyAndName(ctx context.Context, study, name string) (*ActivityPermit, error)
- func (r *ActivityRepo) GetByUser(ctx context.Context, userID string, po *data.PageOptions, ...) ([]*ActivityPermit, error)
- func (r *ActivityRepo) Open(p *Permitter) error
- func (r *ActivityRepo) Pull(ctx context.Context, id string) (*ActivityPermit, error)
- func (r *ActivityRepo) Search(ctx context.Context, po *data.PageOptions, filters *data.ActivityFilterOptions) ([]*ActivityPermit, error)
- func (r *ActivityRepo) Update(ctx context.Context, c *data.Activity) (*ActivityPermit, error)
- func (r *ActivityRepo) ViewerCanAdmin(ctx context.Context, c *data.Activity) (bool, error)
- type AppleablePermit
- type AppledPermit
- type AppledRepo
- func (r *AppledRepo) CheckConnection() error
- func (r *AppledRepo) Close()
- func (r *AppledRepo) Connect(ctx context.Context, appled *data.Appled) (*AppledPermit, error)
- func (r *AppledRepo) CountByAppleable(ctx context.Context, appleableID string) (int32, error)
- func (r *AppledRepo) CountByUser(ctx context.Context, userID string) (int32, error)
- func (r *AppledRepo) Disconnect(ctx context.Context, a *data.Appled) error
- func (r *AppledRepo) Get(ctx context.Context, a *data.Appled) (*AppledPermit, error)
- func (r *AppledRepo) GetByAppleable(ctx context.Context, appleableID string, po *data.PageOptions) ([]*AppledPermit, error)
- func (r *AppledRepo) GetByUser(ctx context.Context, userID string, po *data.PageOptions) ([]*AppledPermit, error)
- func (r *AppledRepo) Open(p *Permitter) error
- func (r *AppledRepo) ViewerCanApple(ctx context.Context, e *data.Appled) (bool, error)
- type AssetPermit
- func (r *AssetPermit) ContentType() (string, error)
- func (r *AssetPermit) CreatedAt() (time.Time, error)
- func (r *AssetPermit) Get() *data.Asset
- func (r *AssetPermit) ID() (int64, error)
- func (r *AssetPermit) Key() (string, error)
- func (r *AssetPermit) Name() (string, error)
- func (r *AssetPermit) Size() (int64, error)
- func (r *AssetPermit) Subtype() (string, error)
- func (r *AssetPermit) Type() (string, error)
- func (r *AssetPermit) UserID() (*mytype.OID, error)
- type AssetRepo
- func (r *AssetRepo) CheckConnection() error
- func (r *AssetRepo) Close()
- func (r *AssetRepo) Create(ctx context.Context, a *data.Asset) (*AssetPermit, error)
- func (r *AssetRepo) Delete(ctx context.Context, asset *data.Asset) error
- func (r *AssetRepo) Get(ctx context.Context, id int64) (*AssetPermit, error)
- func (r *AssetRepo) GetByKey(ctx context.Context, key string) (*AssetPermit, error)
- func (r *AssetRepo) Open(p *Permitter) error
- func (r *AssetRepo) ViewerCanDelete(ctx context.Context, l *data.Asset) bool
- type CommentDraftBackupPermit
- func (r *CommentDraftBackupPermit) CommentID() (*mytype.OID, error)
- func (r *CommentDraftBackupPermit) CreatedAt() (time.Time, error)
- func (r *CommentDraftBackupPermit) Draft() (string, error)
- func (r *CommentDraftBackupPermit) Get() *data.CommentDraftBackup
- func (r *CommentDraftBackupPermit) ID() (int32, error)
- func (r *CommentDraftBackupPermit) UpdatedAt() (time.Time, error)
- type CommentDraftBackupRepo
- func (r *CommentDraftBackupRepo) CheckConnection() error
- func (r *CommentDraftBackupRepo) Clear(id string)
- func (r *CommentDraftBackupRepo) Close()
- func (r *CommentDraftBackupRepo) Get(ctx context.Context, commentID string, id int32) (*CommentDraftBackupPermit, error)
- func (r *CommentDraftBackupRepo) GetByComment(ctx context.Context, commentID string) ([]*CommentDraftBackupPermit, error)
- func (r *CommentDraftBackupRepo) Open(p *Permitter) error
- func (r *CommentDraftBackupRepo) Pull(ctx context.Context, commentID string, id int32) (*CommentDraftBackupPermit, error)
- func (r *CommentDraftBackupRepo) Restore(ctx context.Context, comment *data.Comment, backupID int32) error
- type CommentPermit
- func (r *CommentPermit) Body() (*mytype.Markdown, error)
- func (r *CommentPermit) CommentableID() (*mytype.OID, error)
- func (r *CommentPermit) CreatedAt() (time.Time, error)
- func (r *CommentPermit) Draft() (string, error)
- func (r *CommentPermit) Get() *data.Comment
- func (r *CommentPermit) ID() (*mytype.OID, error)
- func (r *CommentPermit) IsPublished() (bool, error)
- func (r *CommentPermit) LastEditedAt() (time.Time, error)
- func (r *CommentPermit) PublishedAt() (time.Time, error)
- func (r *CommentPermit) StudyID() (*mytype.OID, error)
- func (r *CommentPermit) Type() (string, error)
- func (r *CommentPermit) UpdatedAt() (time.Time, error)
- func (r *CommentPermit) UserID() (*mytype.OID, error)
- type CommentRepo
- func (r *CommentRepo) BatchGet(ctx context.Context, ids []string) ([]*CommentPermit, error)
- func (r *CommentRepo) CheckConnection() error
- func (r *CommentRepo) Close()
- func (r *CommentRepo) CountByCommentable(ctx context.Context, commentableID string, filters *data.CommentFilterOptions) (int32, error)
- func (r *CommentRepo) CountByLabel(ctx context.Context, labelID string, filters *data.CommentFilterOptions) (int32, error)
- func (r *CommentRepo) CountByStudy(ctx context.Context, studyID string, filters *data.CommentFilterOptions) (int32, error)
- func (r *CommentRepo) CountByUser(ctx context.Context, userID string, filters *data.CommentFilterOptions) (int32, error)
- func (r *CommentRepo) Create(ctx context.Context, lc *data.Comment) (*CommentPermit, error)
- func (r *CommentRepo) Delete(ctx context.Context, lc *data.Comment) error
- func (r *CommentRepo) Get(ctx context.Context, id string) (*CommentPermit, error)
- func (r *CommentRepo) GetByCommentable(ctx context.Context, commentableID string, po *data.PageOptions, ...) ([]*CommentPermit, error)
- func (r *CommentRepo) GetByLabel(ctx context.Context, labelID string, po *data.PageOptions, ...) ([]*CommentPermit, error)
- func (r *CommentRepo) GetByStudy(ctx context.Context, studyID string, po *data.PageOptions, ...) ([]*CommentPermit, error)
- func (r *CommentRepo) GetByUser(ctx context.Context, userID string, po *data.PageOptions, ...) ([]*CommentPermit, error)
- func (r *CommentRepo) GetUserNewComment(ctx context.Context, userID, commentableID string) (*CommentPermit, error)
- func (r *CommentRepo) Open(p *Permitter) error
- func (r *CommentRepo) Update(ctx context.Context, lc *data.Comment) (*CommentPermit, error)
- func (r *CommentRepo) ViewerCanDelete(ctx context.Context, l *data.Comment) bool
- func (r *CommentRepo) ViewerCanUpdate(ctx context.Context, l *data.Comment) bool
- type CourseLessonPermit
- type CourseLessonRepo
- func (r *CourseLessonRepo) CheckConnection() error
- func (r *CourseLessonRepo) Close()
- func (r *CourseLessonRepo) Connect(ctx context.Context, courseLesson *data.CourseLesson) (*CourseLessonPermit, error)
- func (r *CourseLessonRepo) CountByCourse(ctx context.Context, courseID string) (int32, error)
- func (r *CourseLessonRepo) Disconnect(ctx context.Context, courseLesson *data.CourseLesson) error
- func (r *CourseLessonRepo) Get(ctx context.Context, lessonID string) (*CourseLessonPermit, error)
- func (r *CourseLessonRepo) GetByCourse(ctx context.Context, courseID string, po *data.PageOptions) ([]*CourseLessonPermit, error)
- func (r *CourseLessonRepo) GetByCourseAndNumber(ctx context.Context, courseID string, number int32) (*CourseLessonPermit, error)
- func (r *CourseLessonRepo) Move(ctx context.Context, courseLesson *data.CourseLesson, afterLessonID string) (*data.CourseLesson, error)
- func (r *CourseLessonRepo) Open(p *Permitter) error
- type CoursePermit
- func (r *CoursePermit) AdvancedAt() (*time.Time, error)
- func (r *CoursePermit) AppledAt() time.Time
- func (r *CoursePermit) CompletedAt() (*time.Time, error)
- func (r *CoursePermit) CreatedAt() (time.Time, error)
- func (r *CoursePermit) Description() (string, error)
- func (r *CoursePermit) Get() *data.Course
- func (r *CoursePermit) ID() (*mytype.OID, error)
- func (r *CoursePermit) IsPublished() (bool, error)
- func (r *CoursePermit) Name() (string, error)
- func (r *CoursePermit) Number() (int32, error)
- func (r *CoursePermit) PublishedAt() (*time.Time, error)
- func (r *CoursePermit) Status() (*mytype.CourseStatus, error)
- func (r *CoursePermit) StudyID() (*mytype.OID, error)
- func (r *CoursePermit) TopicedAt() time.Time
- func (r *CoursePermit) UpdatedAt() (time.Time, error)
- func (r *CoursePermit) UserID() (*mytype.OID, error)
- type CourseRepo
- func (r *CourseRepo) CheckConnection() error
- func (r *CourseRepo) Close()
- func (r *CourseRepo) CountByApplee(ctx context.Context, appleeID string, filters *data.CourseFilterOptions) (int32, error)
- func (r *CourseRepo) CountBySearch(ctx context.Context, filters *data.CourseFilterOptions) (int32, error)
- func (r *CourseRepo) CountByStudy(ctx context.Context, studyID string, filters *data.CourseFilterOptions) (int32, error)
- func (r *CourseRepo) CountByTopic(ctx context.Context, topicID string, filters *data.CourseFilterOptions) (int32, error)
- func (r *CourseRepo) CountByUser(ctx context.Context, userID string, filters *data.CourseFilterOptions) (int32, error)
- func (r *CourseRepo) Create(ctx context.Context, c *data.Course) (*CoursePermit, error)
- func (r *CourseRepo) Delete(ctx context.Context, course *data.Course) error
- func (r *CourseRepo) Get(ctx context.Context, id string) (*CoursePermit, error)
- func (r *CourseRepo) GetByApplee(ctx context.Context, appleeID string, po *data.PageOptions, ...) ([]*CoursePermit, error)
- func (r *CourseRepo) GetByName(ctx context.Context, studyID, name string) (*CoursePermit, error)
- func (r *CourseRepo) GetByNumber(ctx context.Context, studyID string, number int32) (*CoursePermit, error)
- func (r *CourseRepo) GetByStudy(ctx context.Context, studyID string, po *data.PageOptions, ...) ([]*CoursePermit, error)
- func (r *CourseRepo) GetByStudyAndName(ctx context.Context, study, name string) (*CoursePermit, error)
- func (r *CourseRepo) GetByTopic(ctx context.Context, topicID string, po *data.PageOptions, ...) ([]*CoursePermit, error)
- func (r *CourseRepo) GetByUser(ctx context.Context, userID string, po *data.PageOptions, ...) ([]*CoursePermit, error)
- func (r *CourseRepo) IsPublishable(ctx context.Context, id string) (bool, error)
- func (r *CourseRepo) Open(p *Permitter) error
- func (r *CourseRepo) Pull(ctx context.Context, id string) (*CoursePermit, error)
- func (r *CourseRepo) Search(ctx context.Context, po *data.PageOptions, filters *data.CourseFilterOptions) ([]*CoursePermit, error)
- func (r *CourseRepo) Update(ctx context.Context, c *data.Course) (*CoursePermit, error)
- func (r *CourseRepo) ViewerCanAdmin(ctx context.Context, c *data.Course) (bool, error)
- type EVTPermit
- func (r *EVTPermit) EmailID() (*mytype.OID, error)
- func (r *EVTPermit) ExpiresAt() (time.Time, error)
- func (r *EVTPermit) Get() *data.EVT
- func (r *EVTPermit) IssuedAt() (time.Time, error)
- func (r *EVTPermit) Token() (string, error)
- func (r *EVTPermit) UserID() (*mytype.OID, error)
- func (r *EVTPermit) VerifiedAt() (time.Time, error)
- type EVTRepo
- type EmailPermit
- func (r *EmailPermit) CreatedAt() (time.Time, error)
- func (r *EmailPermit) Get() *data.Email
- func (r *EmailPermit) ID() (*mytype.OID, error)
- func (r *EmailPermit) IsVerified() (bool, error)
- func (r *EmailPermit) Type() (string, error)
- func (r *EmailPermit) UpdatedAt() (time.Time, error)
- func (r *EmailPermit) UserID() (*mytype.OID, error)
- func (r *EmailPermit) Value() (string, error)
- func (r *EmailPermit) VerifiedAt() (*time.Time, error)
- type EmailRepo
- func (r *EmailRepo) CheckConnection() error
- func (r *EmailRepo) Close()
- func (r *EmailRepo) CountByUser(ctx context.Context, userID string, filters *data.EmailFilterOptions) (int32, error)
- func (r *EmailRepo) Create(ctx context.Context, e *data.Email) (*EmailPermit, error)
- func (r *EmailRepo) Delete(ctx context.Context, email *data.Email) error
- func (r *EmailRepo) Get(ctx context.Context, id string) (*EmailPermit, error)
- func (r *EmailRepo) GetByUser(ctx context.Context, userID string, po *data.PageOptions, ...) ([]*EmailPermit, error)
- func (r *EmailRepo) GetByValue(ctx context.Context, value string) (*EmailPermit, error)
- func (r *EmailRepo) Open(p *Permitter) error
- func (r *EmailRepo) Update(ctx context.Context, e *data.Email) (*EmailPermit, error)
- func (r *EmailRepo) ViewerCanDelete(ctx context.Context, e *data.Email) bool
- type EnrollablePermit
- type EnrolledPermit
- func (r *EnrolledPermit) CreatedAt() (time.Time, error)
- func (r *EnrolledPermit) EnrollableID() (*mytype.OID, error)
- func (r *EnrolledPermit) Get() *data.Enrolled
- func (r *EnrolledPermit) ID() (int32, error)
- func (r *EnrolledPermit) Status() (*mytype.EnrollmentStatus, error)
- func (r *EnrolledPermit) UserID() (*mytype.OID, error)
- type EnrolledRepo
- func (r *EnrolledRepo) CheckConnection() error
- func (r *EnrolledRepo) Close()
- func (r *EnrolledRepo) Connect(ctx context.Context, enrolled *data.Enrolled) (*EnrolledPermit, error)
- func (r *EnrolledRepo) CountByEnrollable(ctx context.Context, enrollableID string, filters *data.EnrolledFilterOptions) (int32, error)
- func (r *EnrolledRepo) CountByUser(ctx context.Context, userID string, filters *data.EnrolledFilterOptions) (int32, error)
- func (r *EnrolledRepo) Disconnect(ctx context.Context, enrolled *data.Enrolled) error
- func (r *EnrolledRepo) Get(ctx context.Context, e *data.Enrolled) (*EnrolledPermit, error)
- func (r *EnrolledRepo) GetByEnrollable(ctx context.Context, enrollableID string, po *data.PageOptions, ...) ([]*EnrolledPermit, error)
- func (r *EnrolledRepo) GetByUser(ctx context.Context, userID string, po *data.PageOptions, ...) ([]*EnrolledPermit, error)
- func (r *EnrolledRepo) Open(p *Permitter) error
- func (r *EnrolledRepo) Pull(ctx context.Context, e *data.Enrolled) (*EnrolledPermit, error)
- func (r *EnrolledRepo) Update(ctx context.Context, e *data.Enrolled) (*EnrolledPermit, error)
- func (r *EnrolledRepo) ViewerCanEnroll(ctx context.Context, e *data.Enrolled) (bool, error)
- type EventPermit
- func (r *EventPermit) CreatedAt() (time.Time, error)
- func (r *EventPermit) Get() *data.Event
- func (r *EventPermit) ID() (*mytype.OID, error)
- func (r *EventPermit) Payload() (*pgtype.JSONB, error)
- func (r *EventPermit) Public() (bool, error)
- func (r *EventPermit) StudyID() (*mytype.OID, error)
- func (r *EventPermit) Type() (string, error)
- func (r *EventPermit) UserID() (*mytype.OID, error)
- type EventRepo
- func (r *EventRepo) CheckConnection() error
- func (r *EventRepo) Close()
- func (r *EventRepo) CountByLesson(ctx context.Context, lessonID string, filters *data.EventFilterOptions) (int32, error)
- func (r *EventRepo) CountByStudy(ctx context.Context, studyID string, filters *data.EventFilterOptions) (int32, error)
- func (r *EventRepo) CountByUser(ctx context.Context, userID string, filters *data.EventFilterOptions) (int32, error)
- func (r *EventRepo) CountByUserAsset(ctx context.Context, assetID string, filters *data.EventFilterOptions) (int32, error)
- func (r *EventRepo) CountReceivedByUser(ctx context.Context, userID string, filters *data.EventFilterOptions) (int32, error)
- func (r *EventRepo) Create(ctx context.Context, event *data.Event) (*EventPermit, error)
- func (r *EventRepo) Delete(ctx context.Context, event *data.Event) error
- func (r *EventRepo) Get(ctx context.Context, id string) (*EventPermit, error)
- func (r *EventRepo) GetByLesson(ctx context.Context, lessonID string, po *data.PageOptions, ...) ([]*EventPermit, error)
- func (r *EventRepo) GetByStudy(ctx context.Context, studyID string, po *data.PageOptions, ...) ([]*EventPermit, error)
- func (r *EventRepo) GetByUser(ctx context.Context, userID string, po *data.PageOptions, ...) ([]*EventPermit, error)
- func (r *EventRepo) GetByUserAsset(ctx context.Context, userID string, po *data.PageOptions, ...) ([]*EventPermit, error)
- func (r *EventRepo) GetReceivedByUser(ctx context.Context, userID string, po *data.PageOptions, ...) ([]*EventPermit, error)
- func (r *EventRepo) Open(p *Permitter) error
- type FieldPermissionFunc
- type LabelPermit
- func (r *LabelPermit) Color() (string, error)
- func (r *LabelPermit) CreatedAt() (time.Time, error)
- func (r *LabelPermit) Description() (string, error)
- func (r *LabelPermit) Get() *data.Label
- func (r *LabelPermit) ID() (*mytype.OID, error)
- func (r *LabelPermit) IsDefault() (bool, error)
- func (r *LabelPermit) Name() (string, error)
- func (r *LabelPermit) StudyID() (*mytype.OID, error)
- func (r *LabelPermit) UpdatedAt() (time.Time, error)
- type LabelRepo
- func (r *LabelRepo) CheckConnection() error
- func (r *LabelRepo) Close()
- func (r *LabelRepo) CountByLabelable(ctx context.Context, labelableID string, filters *data.LabelFilterOptions) (int32, error)
- func (r *LabelRepo) CountBySearch(ctx context.Context, filters *data.LabelFilterOptions) (int32, error)
- func (r *LabelRepo) CountByStudy(ctx context.Context, studyID string, filters *data.LabelFilterOptions) (int32, error)
- func (r *LabelRepo) Create(ctx context.Context, l *data.Label) (*LabelPermit, error)
- func (r *LabelRepo) Delete(ctx context.Context, label *data.Label) error
- func (r *LabelRepo) Get(ctx context.Context, id string) (*LabelPermit, error)
- func (r *LabelRepo) GetByLabelable(ctx context.Context, labelableID string, po *data.PageOptions, ...) ([]*LabelPermit, error)
- func (r *LabelRepo) GetByName(ctx context.Context, studyID, name string) (*LabelPermit, error)
- func (r *LabelRepo) GetByStudy(ctx context.Context, studyID string, po *data.PageOptions, ...) ([]*LabelPermit, error)
- func (r *LabelRepo) Open(p *Permitter) error
- func (r *LabelRepo) Search(ctx context.Context, po *data.PageOptions, filters *data.LabelFilterOptions) ([]*LabelPermit, error)
- func (r *LabelRepo) Update(ctx context.Context, l *data.Label) (*LabelPermit, error)
- func (r *LabelRepo) ViewerCanDelete(ctx context.Context, l *data.Label) bool
- func (r *LabelRepo) ViewerCanUpdate(ctx context.Context, l *data.Label) bool
- type LabelablePermit
- type LabeledPermit
- type LabeledRepo
- func (r *LabeledRepo) CheckConnection() error
- func (r *LabeledRepo) Close()
- func (r *LabeledRepo) Connect(ctx context.Context, labeled *data.Labeled) (*LabeledPermit, error)
- func (r *LabeledRepo) CountByLabel(ctx context.Context, labelID string) (int32, error)
- func (r *LabeledRepo) CountByLabelable(ctx context.Context, labelableID string) (int32, error)
- func (r *LabeledRepo) Disconnect(ctx context.Context, l *data.Labeled) error
- func (r *LabeledRepo) Get(ctx context.Context, l *data.Labeled) (*LabeledPermit, error)
- func (r *LabeledRepo) GetByLabel(ctx context.Context, labelID string, po *data.PageOptions) ([]*LabeledPermit, error)
- func (r *LabeledRepo) GetByLabelable(ctx context.Context, labelableID string, po *data.PageOptions) ([]*LabeledPermit, error)
- func (r *LabeledRepo) Open(p *Permitter) error
- type LessonDraftBackupPermit
- func (r *LessonDraftBackupPermit) CreatedAt() (time.Time, error)
- func (r *LessonDraftBackupPermit) Draft() (string, error)
- func (r *LessonDraftBackupPermit) Get() *data.LessonDraftBackup
- func (r *LessonDraftBackupPermit) ID() (int32, error)
- func (r *LessonDraftBackupPermit) LessonID() (*mytype.OID, error)
- func (r *LessonDraftBackupPermit) UpdatedAt() (time.Time, error)
- type LessonDraftBackupRepo
- func (r *LessonDraftBackupRepo) CheckConnection() error
- func (r *LessonDraftBackupRepo) Clear(id string)
- func (r *LessonDraftBackupRepo) Close()
- func (r *LessonDraftBackupRepo) Get(ctx context.Context, lessonID string, id int32) (*LessonDraftBackupPermit, error)
- func (r *LessonDraftBackupRepo) GetByLesson(ctx context.Context, lessonID string) ([]*LessonDraftBackupPermit, error)
- func (r *LessonDraftBackupRepo) Open(p *Permitter) error
- func (r *LessonDraftBackupRepo) Pull(ctx context.Context, lessonID string, id int32) (*LessonDraftBackupPermit, error)
- func (r *LessonDraftBackupRepo) Restore(ctx context.Context, lesson *data.Lesson, backupID int32) error
- type LessonPermit
- func (r *LessonPermit) Body() (*mytype.Markdown, error)
- func (r *LessonPermit) CourseID() (*mytype.OID, error)
- func (r *LessonPermit) CourseNumber() (*int32, error)
- func (r *LessonPermit) CreatedAt() (time.Time, error)
- func (r *LessonPermit) Draft() (string, error)
- func (r *LessonPermit) Get() *data.Lesson
- func (r *LessonPermit) ID() (*mytype.OID, error)
- func (r *LessonPermit) IsPublished() (bool, error)
- func (r *LessonPermit) LastEditedAt() (time.Time, error)
- func (r *LessonPermit) Number() (int32, error)
- func (r *LessonPermit) PublishedAt() (time.Time, error)
- func (r *LessonPermit) StudyID() (*mytype.OID, error)
- func (r *LessonPermit) Title() (string, error)
- func (r *LessonPermit) UpdatedAt() (time.Time, error)
- func (r *LessonPermit) UserID() (*mytype.OID, error)
- type LessonRepo
- func (r *LessonRepo) BatchGetByNumber(ctx context.Context, studyID string, numbers []int32) ([]*LessonPermit, error)
- func (r *LessonRepo) CheckConnection() error
- func (r *LessonRepo) Clear(id string)
- func (r *LessonRepo) Close()
- func (r *LessonRepo) CountByCourse(ctx context.Context, courseID string, filters *data.LessonFilterOptions) (int32, error)
- func (r *LessonRepo) CountByEnrollee(ctx context.Context, userID string, filters *data.LessonFilterOptions) (int32, error)
- func (r *LessonRepo) CountByLabel(ctx context.Context, labelID string, filters *data.LessonFilterOptions) (int32, error)
- func (r *LessonRepo) CountBySearch(ctx context.Context, filters *data.LessonFilterOptions) (int32, error)
- func (r *LessonRepo) CountByStudy(ctx context.Context, studyID string, filters *data.LessonFilterOptions) (int32, error)
- func (r *LessonRepo) CountByUser(ctx context.Context, userID string, filters *data.LessonFilterOptions) (int32, error)
- func (r *LessonRepo) Create(ctx context.Context, l *data.Lesson) (*LessonPermit, error)
- func (r *LessonRepo) Delete(ctx context.Context, lesson *data.Lesson) error
- func (r *LessonRepo) Exists(ctx context.Context, id string) (bool, error)
- func (r *LessonRepo) ExistsByNumber(ctx context.Context, studyID string, number int32) (bool, error)
- func (r *LessonRepo) ExistsByOwnerStudyAndNumber(ctx context.Context, ownerLogin, studyName string, number int32) (bool, error)
- func (r *LessonRepo) Get(ctx context.Context, id string) (*LessonPermit, error)
- func (r *LessonRepo) GetByCourse(ctx context.Context, courseID string, po *data.PageOptions, ...) ([]*LessonPermit, error)
- func (r *LessonRepo) GetByCourseNumber(ctx context.Context, courseID string, courseNumber int32) (*LessonPermit, error)
- func (r *LessonRepo) GetByEnrollee(ctx context.Context, userID string, po *data.PageOptions, ...) ([]*LessonPermit, error)
- func (r *LessonRepo) GetByLabel(ctx context.Context, labelID string, po *data.PageOptions, ...) ([]*LessonPermit, error)
- func (r *LessonRepo) GetByNumber(ctx context.Context, studyID string, number int32) (*LessonPermit, error)
- func (r *LessonRepo) GetByOwnerStudyAndNumber(ctx context.Context, owner, study string, number int32) (*LessonPermit, error)
- func (r *LessonRepo) GetByStudy(ctx context.Context, studyID string, po *data.PageOptions, ...) ([]*LessonPermit, error)
- func (r *LessonRepo) GetByUser(ctx context.Context, userID string, po *data.PageOptions, ...) ([]*LessonPermit, error)
- func (r *LessonRepo) Open(p *Permitter) error
- func (r *LessonRepo) Pull(ctx context.Context, id string) (*LessonPermit, error)
- func (r *LessonRepo) Search(ctx context.Context, po *data.PageOptions, filters *data.LessonFilterOptions) ([]*LessonPermit, error)
- func (r *LessonRepo) Update(ctx context.Context, l *data.Lesson) (*LessonPermit, error)
- func (r *LessonRepo) ViewerCanDelete(ctx context.Context, l *data.Lesson) bool
- func (r *LessonRepo) ViewerCanUpdate(ctx context.Context, l *data.Lesson) bool
- type NodePermit
- type NotificationPermit
- func (r *NotificationPermit) CreatedAt() (time.Time, error)
- func (r *NotificationPermit) Get() *data.Notification
- func (r *NotificationPermit) ID() (*mytype.OID, error)
- func (r *NotificationPermit) LastReadAt() (time.Time, error)
- func (r *NotificationPermit) Reason() (string, error)
- func (r *NotificationPermit) StudyID() (*mytype.OID, error)
- func (r *NotificationPermit) Subject() (string, error)
- func (r *NotificationPermit) SubjectID() (*mytype.OID, error)
- func (r *NotificationPermit) Unread() (bool, error)
- func (r *NotificationPermit) UpdatedAt() (time.Time, error)
- func (r *NotificationPermit) UserID() (*mytype.OID, error)
- type NotificationRepo
- func (r *NotificationRepo) CheckConnection() error
- func (r *NotificationRepo) Close()
- func (r *NotificationRepo) CountByStudy(ctx context.Context, studyID string) (int32, error)
- func (r *NotificationRepo) CountByUser(ctx context.Context, userID string) (int32, error)
- func (r *NotificationRepo) Create(ctx context.Context, notification *data.Notification) (*NotificationPermit, error)
- func (r *NotificationRepo) Delete(ctx context.Context, n *data.Notification) error
- func (r *NotificationRepo) DeleteByStudy(ctx context.Context, n *data.Notification) error
- func (r *NotificationRepo) DeleteByUser(ctx context.Context, n *data.Notification) error
- func (r *NotificationRepo) Get(ctx context.Context, id string) (*NotificationPermit, error)
- func (r *NotificationRepo) GetByStudy(ctx context.Context, studyID string, po *data.PageOptions) ([]*NotificationPermit, error)
- func (r *NotificationRepo) GetByUser(ctx context.Context, userID string, po *data.PageOptions) ([]*NotificationPermit, error)
- func (r *NotificationRepo) Open(p *Permitter) error
- type PRTPermit
- func (r *PRTPermit) EmailID() (*mytype.OID, error)
- func (r *PRTPermit) EndedAt() (time.Time, error)
- func (r *PRTPermit) ExpiresAt() (time.Time, error)
- func (r *PRTPermit) Get() *data.PRT
- func (r *PRTPermit) IssuedAt() (time.Time, error)
- func (r *PRTPermit) Token() (string, error)
- func (r *PRTPermit) UserID() (*mytype.OID, error)
- type PRTRepo
- func (r *PRTRepo) CheckConnection() error
- func (r *PRTRepo) Close()
- func (r *PRTRepo) Create(ctx context.Context, t *data.PRT) (*PRTPermit, error)
- func (r *PRTRepo) Get(ctx context.Context, userID, token string) (*PRTPermit, error)
- func (r *PRTRepo) Open(p *Permitter) error
- func (r *PRTRepo) Update(ctx context.Context, token *data.PRT) (*PRTPermit, error)
- type Permitter
- func (r *Permitter) Check(ctx context.Context, a mytype.AccessLevel, node interface{}) (FieldPermissionFunc, error)
- func (r *Permitter) CheckConnection() error
- func (r *Permitter) ClearCache()
- func (r *Permitter) ClearCacheOperation(o mytype.Operation)
- func (r *Permitter) ViewerCanAdmin(ctx context.Context, node interface{}) (bool, error)
- func (r *Permitter) ViewerCanCreateWithOwnership(ctx context.Context, node interface{}) (bool, error)
- func (r *Permitter) ViewerCanRead(ctx context.Context, node interface{}) (bool, error)
- type Repo
- type Repos
- func (r *Repos) Activity() *ActivityRepo
- func (r *Repos) ActivityAsset() *ActivityAssetRepo
- func (r *Repos) Appled() *AppledRepo
- func (r *Repos) Asset() *AssetRepo
- func (r *Repos) CloseAll()
- func (r *Repos) Comment() *CommentRepo
- func (r *Repos) CommentDraftBackup() *CommentDraftBackupRepo
- func (r *Repos) Course() *CourseRepo
- func (r *Repos) CourseLesson() *CourseLessonRepo
- func (r *Repos) EVT() *EVTRepo
- func (r *Repos) Email() *EmailRepo
- func (r *Repos) Enrolled() *EnrolledRepo
- func (r *Repos) Event() *EventRepo
- func (r *Repos) GetAppleable(ctx context.Context, appleableID *mytype.OID) (NodePermit, error)
- func (r *Repos) GetCommentable(ctx context.Context, nodeID *mytype.OID) (NodePermit, error)
- func (r *Repos) GetCreateable(ctx context.Context, nodeID *mytype.OID) (NodePermit, error)
- func (r *Repos) GetEnrollable(ctx context.Context, enrollableID *mytype.OID) (NodePermit, error)
- func (r *Repos) GetLabelable(ctx context.Context, labelableID *mytype.OID) (NodePermit, error)
- func (r *Repos) GetNode(ctx context.Context, nodeID *mytype.OID) (NodePermit, error)
- func (r *Repos) GetNotificationSubject(ctx context.Context, nodeID *mytype.OID) (NodePermit, error)
- func (r *Repos) GetPublishable(ctx context.Context, nodeID *mytype.OID) (NodePermit, error)
- func (r *Repos) GetReferenceable(ctx context.Context, nodeID *mytype.OID) (NodePermit, error)
- func (r *Repos) GetRenameable(ctx context.Context, nodeID *mytype.OID) (NodePermit, error)
- func (r *Repos) GetTopicable(ctx context.Context, topicableID *mytype.OID) (NodePermit, error)
- func (r *Repos) Label() *LabelRepo
- func (r *Repos) Labeled() *LabeledRepo
- func (r *Repos) Lesson() *LessonRepo
- func (r *Repos) LessonDraftBackup() *LessonDraftBackupRepo
- func (r *Repos) Notification() *NotificationRepo
- func (r *Repos) OpenAll(p *Permitter) error
- func (r *Repos) PRT() *PRTRepo
- func (r *Repos) ParseLessonBodyForEvents(ctx context.Context, body *mytype.Markdown, ...) error
- func (r *Repos) ParseUserAssetBodyForEvents(ctx context.Context, body *mytype.Markdown, ...) error
- func (r *Repos) ReplaceMarkdownLinksWithRefs(ctx context.Context, markdown, studyID string) (string, error, bool)
- func (r *Repos) ReplaceMarkdownRefsWithLinks(ctx context.Context, markdown mytype.Markdown, studyID string) (*mytype.Markdown, error, bool)
- func (r *Repos) Study() *StudyRepo
- func (r *Repos) Topic() *TopicRepo
- func (r *Repos) Topiced() *TopicedRepo
- func (r *Repos) Use(h http.Handler) http.Handler
- func (r *Repos) User() *UserRepo
- func (r *Repos) UserAsset() *UserAssetRepo
- type StudyNodePermit
- type StudyPermit
- func (r *StudyPermit) AdvancedAt() (*time.Time, error)
- func (r *StudyPermit) AppledAt() time.Time
- func (r *StudyPermit) CreatedAt() (time.Time, error)
- func (r *StudyPermit) Description() (string, error)
- func (r *StudyPermit) EnrolledAt() time.Time
- func (r *StudyPermit) Get() *data.Study
- func (r *StudyPermit) ID() (*mytype.OID, error)
- func (r *StudyPermit) Name() (string, error)
- func (r *StudyPermit) Private() (bool, error)
- func (r *StudyPermit) TopicedAt() time.Time
- func (r *StudyPermit) UpdatedAt() (time.Time, error)
- func (r *StudyPermit) UserID() (*mytype.OID, error)
- type StudyRepo
- func (r *StudyRepo) CheckConnection() error
- func (r *StudyRepo) Close()
- func (r *StudyRepo) CountByApplee(ctx context.Context, appleeID string, filters *data.StudyFilterOptions) (int32, error)
- func (r *StudyRepo) CountByEnrollee(ctx context.Context, enrolleeID string, filters *data.StudyFilterOptions) (int32, error)
- func (r *StudyRepo) CountBySearch(ctx context.Context, filters *data.StudyFilterOptions) (int32, error)
- func (r *StudyRepo) CountByTopic(ctx context.Context, topicID string, filters *data.StudyFilterOptions) (int32, error)
- func (r *StudyRepo) CountByUser(ctx context.Context, userID string, filters *data.StudyFilterOptions) (int32, error)
- func (r *StudyRepo) Create(ctx context.Context, s *data.Study) (*StudyPermit, error)
- func (r *StudyRepo) Delete(ctx context.Context, study *data.Study) error
- func (r *StudyRepo) Get(ctx context.Context, id string) (*StudyPermit, error)
- func (r *StudyRepo) GetByApplee(ctx context.Context, appleeID string, po *data.PageOptions, ...) ([]*StudyPermit, error)
- func (r *StudyRepo) GetByEnrollee(ctx context.Context, enrolleeID string, po *data.PageOptions, ...) ([]*StudyPermit, error)
- func (r *StudyRepo) GetByName(ctx context.Context, userID, name string) (*StudyPermit, error)
- func (r *StudyRepo) GetByTopic(ctx context.Context, topicID string, po *data.PageOptions, ...) ([]*StudyPermit, error)
- func (r *StudyRepo) GetByUser(ctx context.Context, userID string, po *data.PageOptions, ...) ([]*StudyPermit, error)
- func (r *StudyRepo) GetByUserAndName(ctx context.Context, owner, name string) (*StudyPermit, error)
- func (r *StudyRepo) Open(p *Permitter) error
- func (r *StudyRepo) Search(ctx context.Context, po *data.PageOptions, filters *data.StudyFilterOptions) ([]*StudyPermit, error)
- func (r *StudyRepo) Update(ctx context.Context, s *data.Study) (*StudyPermit, error)
- func (r *StudyRepo) ViewerCanAdmin(ctx context.Context, s *data.Study) (bool, error)
- type TopicPermit
- type TopicRepo
- func (r *TopicRepo) CheckConnection() error
- func (r *TopicRepo) Close()
- func (r *TopicRepo) CountBySearch(ctx context.Context, filters *data.TopicFilterOptions) (int32, error)
- func (r *TopicRepo) CountByTopicable(ctx context.Context, topicableID string, filters *data.TopicFilterOptions) (int32, error)
- func (r *TopicRepo) Create(ctx context.Context, s *data.Topic) (*TopicPermit, error)
- func (r *TopicRepo) Get(ctx context.Context, id string) (*TopicPermit, error)
- func (r *TopicRepo) GetByName(ctx context.Context, name string) (*TopicPermit, error)
- func (r *TopicRepo) GetByTopicable(ctx context.Context, topicableID string, po *data.PageOptions, ...) ([]*TopicPermit, error)
- func (r *TopicRepo) Open(p *Permitter) error
- func (r *TopicRepo) Search(ctx context.Context, po *data.PageOptions, filters *data.TopicFilterOptions) ([]*TopicPermit, error)
- func (r *TopicRepo) Update(ctx context.Context, s *data.Topic) (*TopicPermit, error)
- type TopicablePermit
- type TopicedPermit
- type TopicedRepo
- func (r *TopicedRepo) CheckConnection() error
- func (r *TopicedRepo) Close()
- func (r *TopicedRepo) Connect(ctx context.Context, topiced *data.Topiced) (*TopicedPermit, error)
- func (r *TopicedRepo) CountByTopic(ctx context.Context, topicID string) (int32, error)
- func (r *TopicedRepo) CountByTopicable(ctx context.Context, topicableID string) (int32, error)
- func (r *TopicedRepo) Disconnect(ctx context.Context, topiced *data.Topiced) error
- func (r *TopicedRepo) Get(ctx context.Context, t *data.Topiced) (*TopicedPermit, error)
- func (r *TopicedRepo) GetByTopic(ctx context.Context, topicID string, po *data.PageOptions) ([]*TopicedPermit, error)
- func (r *TopicedRepo) GetByTopicable(ctx context.Context, topicableID string, po *data.PageOptions) ([]*TopicedPermit, error)
- func (r *TopicedRepo) Open(p *Permitter) error
- type UserAssetPermit
- func (r *UserAssetPermit) ActivityID() (*mytype.OID, error)
- func (r *UserAssetPermit) ActivityNumber() (*int32, error)
- func (r *UserAssetPermit) CreatedAt() (time.Time, error)
- func (r *UserAssetPermit) Description() (string, error)
- func (r *UserAssetPermit) Get() *data.UserAsset
- func (r *UserAssetPermit) ID() (*mytype.OID, error)
- func (r *UserAssetPermit) Key() (string, error)
- func (r *UserAssetPermit) Name() (string, error)
- func (r *UserAssetPermit) OriginalName() (string, error)
- func (r *UserAssetPermit) Size() (int64, error)
- func (r *UserAssetPermit) StudyID() (*mytype.OID, error)
- func (r *UserAssetPermit) Subtype() (string, error)
- func (r *UserAssetPermit) Type() (string, error)
- func (r *UserAssetPermit) UpdatedAt() (time.Time, error)
- func (r *UserAssetPermit) UserID() (*mytype.OID, error)
- type UserAssetRepo
- func (r *UserAssetRepo) BatchGetByName(ctx context.Context, studyID string, names []string) ([]*UserAssetPermit, error)
- func (r *UserAssetRepo) CheckConnection() error
- func (r *UserAssetRepo) Close()
- func (r *UserAssetRepo) CountByActivity(ctx context.Context, activityID string, filters *data.UserAssetFilterOptions) (int32, error)
- func (r *UserAssetRepo) CountByLabel(ctx context.Context, labelID string, filters *data.UserAssetFilterOptions) (int32, error)
- func (r *UserAssetRepo) CountBySearch(ctx context.Context, filters *data.UserAssetFilterOptions) (int32, error)
- func (r *UserAssetRepo) CountByStudy(ctx context.Context, studyID string, filters *data.UserAssetFilterOptions) (int32, error)
- func (r *UserAssetRepo) CountByUser(ctx context.Context, userID string, filters *data.UserAssetFilterOptions) (int32, error)
- func (r *UserAssetRepo) Create(ctx context.Context, a *data.UserAsset) (*UserAssetPermit, error)
- func (r *UserAssetRepo) Delete(ctx context.Context, userAsset *data.UserAsset) error
- func (r *UserAssetRepo) Get(ctx context.Context, id string) (*UserAssetPermit, error)
- func (r *UserAssetRepo) GetByActivity(ctx context.Context, activityID string, po *data.PageOptions, ...) ([]*UserAssetPermit, error)
- func (r *UserAssetRepo) GetByActivityNumber(ctx context.Context, activityID string, activityNumber int32) (*UserAssetPermit, error)
- func (r *UserAssetRepo) GetByLabel(ctx context.Context, labelID string, po *data.PageOptions, ...) ([]*UserAssetPermit, error)
- func (r *UserAssetRepo) GetByName(ctx context.Context, studyID, name string) (*UserAssetPermit, error)
- func (r *UserAssetRepo) GetByStudy(ctx context.Context, studyID string, po *data.PageOptions, ...) ([]*UserAssetPermit, error)
- func (r *UserAssetRepo) GetByUser(ctx context.Context, userID string, po *data.PageOptions, ...) ([]*UserAssetPermit, error)
- func (r *UserAssetRepo) GetByUserStudyAndName(ctx context.Context, userLogin, studyName, name string) (*UserAssetPermit, error)
- func (r *UserAssetRepo) Open(p *Permitter) error
- func (r *UserAssetRepo) Search(ctx context.Context, po *data.PageOptions, ...) ([]*UserAssetPermit, error)
- func (r *UserAssetRepo) Update(ctx context.Context, a *data.UserAsset) (*UserAssetPermit, error)
- func (r *UserAssetRepo) ViewerCanDelete(ctx context.Context, l *data.UserAsset) bool
- func (r *UserAssetRepo) ViewerCanUpdate(ctx context.Context, l *data.UserAsset) bool
- type UserPermit
- func (r *UserPermit) AccountUpdatedAt() (time.Time, error)
- func (r *UserPermit) AppledAt() time.Time
- func (r *UserPermit) Bio() (string, error)
- func (r *UserPermit) CreatedAt() (time.Time, error)
- func (r *UserPermit) EnrolledAt() time.Time
- func (r *UserPermit) Get() *data.User
- func (r *UserPermit) ID() (*mytype.OID, error)
- func (r *UserPermit) Login() (string, error)
- func (r *UserPermit) Name() (string, error)
- func (r *UserPermit) ProfileEmailID() (*mytype.OID, error)
- func (r *UserPermit) ProfileUpdatedAt() (time.Time, error)
- func (r *UserPermit) Roles() []string
- func (r *UserPermit) Verified() (bool, error)
- type UserRepo
- func (r *UserRepo) BatchGetByLogin(ctx context.Context, logins []string) ([]*UserPermit, error)
- func (r *UserRepo) CheckConnection() error
- func (r *UserRepo) Close()
- func (r *UserRepo) CountByAppleable(ctx context.Context, studyID string, filters *data.UserFilterOptions) (int32, error)
- func (r *UserRepo) CountByEnrollable(ctx context.Context, enrollableID string, filters *data.UserFilterOptions) (int32, error)
- func (r *UserRepo) CountByEnrollee(ctx context.Context, enrolleeID string, filters *data.UserFilterOptions) (int32, error)
- func (r *UserRepo) CountBySearch(ctx context.Context, filters *data.UserFilterOptions) (int32, error)
- func (r *UserRepo) Create(ctx context.Context, u *data.User) (*UserPermit, error)
- func (r *UserRepo) Delete(ctx context.Context, user *data.User) error
- func (r *UserRepo) Exists(ctx context.Context, id string) (bool, error)
- func (r *UserRepo) ExistsByLogin(ctx context.Context, login string) (bool, error)
- func (r *UserRepo) Get(ctx context.Context, id string) (*UserPermit, error)
- func (r *UserRepo) GetByAppleable(ctx context.Context, appleableID string, po *data.PageOptions, ...) ([]*UserPermit, error)
- func (r *UserRepo) GetByEnrollable(ctx context.Context, enrollableID string, po *data.PageOptions, ...) ([]*UserPermit, error)
- func (r *UserRepo) GetByEnrollee(ctx context.Context, enrolleeID string, po *data.PageOptions, ...) ([]*UserPermit, error)
- func (r *UserRepo) GetByLogin(ctx context.Context, login string) (*UserPermit, error)
- func (r *UserRepo) Open(p *Permitter) error
- func (r *UserRepo) Search(ctx context.Context, po *data.PageOptions, filters *data.UserFilterOptions) ([]*UserPermit, error)
- func (r *UserRepo) UpdateAccount(ctx context.Context, u *data.User) (*UserPermit, error)
- func (r *UserRepo) UpdateProfile(ctx context.Context, u *data.User) (*UserPermit, error)
Constants ¶
View Source
const Guest = "guest"
Variables ¶
View Source
var ErrAccessDenied = errors.New("access denied")
View Source
var ErrConnClosed = errors.New("connection is closed")
View Source
var ErrFieldAccessDenied = errors.New("field access denied")
View Source
var ErrNilPermitter = errors.New("permitter is nil")
View Source
var LessonLinkRegexp = regexp.MustCompile(`<!---LESSON_LINK--->\[(#\d+)\]\(.*?\)`)
View Source
var StudyLinkRegexp = regexp.MustCompile(`<!---STUDY_LINK--->\[(\w+\/[\w-]{1,39}#\d+)\]\(.*?\)`)
View Source
var UserAssetLinkRegexp = regexp.MustCompile(`<figure(?: class="(.*)")?><!---USER_ASSET_LINK---><a href=".*" rel="nofollow"><img src="(.*)" alt="(.*)"\/><\/a>(?:<figcaption>(.*)<\/figcaption>)?<\/figure>`)
View Source
var UserLinkRegexp = regexp.MustCompile(`<!---USER_LINK--->\[(@\w+)\]\(.*?\)`)
Functions ¶
This section is empty.
Types ¶
type ActivityAssetPermit ¶
type ActivityAssetPermit struct {
// contains filtered or unexported fields
}
func (*ActivityAssetPermit) ActivityID ¶
func (r *ActivityAssetPermit) ActivityID() (*mytype.OID, error)
func (*ActivityAssetPermit) CreatedAt ¶
func (r *ActivityAssetPermit) CreatedAt() (time.Time, error)
func (*ActivityAssetPermit) Get ¶
func (r *ActivityAssetPermit) Get() *data.ActivityAsset
func (*ActivityAssetPermit) Number ¶
func (r *ActivityAssetPermit) Number() (int32, error)
type ActivityAssetRepo ¶
type ActivityAssetRepo struct {
// contains filtered or unexported fields
}
func NewActivityAssetRepo ¶
func NewActivityAssetRepo(conf *myconf.Config) *ActivityAssetRepo
func (*ActivityAssetRepo) CheckConnection ¶
func (r *ActivityAssetRepo) CheckConnection() error
func (*ActivityAssetRepo) Close ¶
func (r *ActivityAssetRepo) Close()
func (*ActivityAssetRepo) Connect ¶
func (r *ActivityAssetRepo) Connect( ctx context.Context, activityAsset *data.ActivityAsset, ) (*ActivityAssetPermit, error)
func (*ActivityAssetRepo) CountByActivity ¶
func (*ActivityAssetRepo) Disconnect ¶
func (r *ActivityAssetRepo) Disconnect( ctx context.Context, activityAsset *data.ActivityAsset, ) error
func (*ActivityAssetRepo) Get ¶
func (r *ActivityAssetRepo) Get( ctx context.Context, assetID string, ) (*ActivityAssetPermit, error)
func (*ActivityAssetRepo) GetByActivity ¶
func (r *ActivityAssetRepo) GetByActivity( ctx context.Context, activityID string, po *data.PageOptions, ) ([]*ActivityAssetPermit, error)
func (*ActivityAssetRepo) GetByActivityAndNumber ¶
func (r *ActivityAssetRepo) GetByActivityAndNumber( ctx context.Context, activityID string, number int32, ) (*ActivityAssetPermit, error)
func (*ActivityAssetRepo) Move ¶
func (r *ActivityAssetRepo) Move( ctx context.Context, activityAsset *data.ActivityAsset, afterAssetID string, ) (*data.ActivityAsset, error)
func (*ActivityAssetRepo) Open ¶
func (r *ActivityAssetRepo) Open(p *Permitter) error
type ActivityPermit ¶
type ActivityPermit struct {
// contains filtered or unexported fields
}
func (*ActivityPermit) AdvancedAt ¶
func (r *ActivityPermit) AdvancedAt() (*time.Time, error)
func (*ActivityPermit) Description ¶
func (r *ActivityPermit) Description() (string, error)
func (*ActivityPermit) Get ¶
func (r *ActivityPermit) Get() *data.Activity
func (*ActivityPermit) Name ¶
func (r *ActivityPermit) Name() (string, error)
func (*ActivityPermit) Number ¶
func (r *ActivityPermit) Number() (int32, error)
type ActivityRepo ¶
type ActivityRepo struct {
// contains filtered or unexported fields
}
func NewActivityRepo ¶
func NewActivityRepo(conf *myconf.Config) *ActivityRepo
func (*ActivityRepo) CheckConnection ¶
func (r *ActivityRepo) CheckConnection() error
func (*ActivityRepo) Close ¶
func (r *ActivityRepo) Close()
func (*ActivityRepo) CountByLesson ¶
func (r *ActivityRepo) CountByLesson( ctx context.Context, lessonID string, filters *data.ActivityFilterOptions, ) (int32, error)
func (*ActivityRepo) CountBySearch ¶
func (r *ActivityRepo) CountBySearch( ctx context.Context, filters *data.ActivityFilterOptions, ) (int32, error)
func (*ActivityRepo) CountByStudy ¶
func (r *ActivityRepo) CountByStudy( ctx context.Context, studyID string, filters *data.ActivityFilterOptions, ) (int32, error)
func (*ActivityRepo) CountByUser ¶
func (r *ActivityRepo) CountByUser( ctx context.Context, userID string, filters *data.ActivityFilterOptions, ) (int32, error)
func (*ActivityRepo) Create ¶
func (r *ActivityRepo) Create( ctx context.Context, c *data.Activity, ) (*ActivityPermit, error)
func (*ActivityRepo) Get ¶
func (r *ActivityRepo) Get( ctx context.Context, id string, ) (*ActivityPermit, error)
func (*ActivityRepo) GetByLesson ¶
func (r *ActivityRepo) GetByLesson( ctx context.Context, lessonID string, po *data.PageOptions, filters *data.ActivityFilterOptions, ) ([]*ActivityPermit, error)
func (*ActivityRepo) GetByName ¶
func (r *ActivityRepo) GetByName( ctx context.Context, studyID, name string, ) (*ActivityPermit, error)
func (*ActivityRepo) GetByNumber ¶
func (r *ActivityRepo) GetByNumber( ctx context.Context, studyID string, number int32, ) (*ActivityPermit, error)
func (*ActivityRepo) GetByStudy ¶
func (r *ActivityRepo) GetByStudy( ctx context.Context, studyID string, po *data.PageOptions, filters *data.ActivityFilterOptions, ) ([]*ActivityPermit, error)
func (*ActivityRepo) GetByStudyAndName ¶
func (r *ActivityRepo) GetByStudyAndName( ctx context.Context, study, name string, ) (*ActivityPermit, error)
func (*ActivityRepo) GetByUser ¶
func (r *ActivityRepo) GetByUser( ctx context.Context, userID string, po *data.PageOptions, filters *data.ActivityFilterOptions, ) ([]*ActivityPermit, error)
func (*ActivityRepo) Open ¶
func (r *ActivityRepo) Open(p *Permitter) error
func (*ActivityRepo) Pull ¶
func (r *ActivityRepo) Pull( ctx context.Context, id string, ) (*ActivityPermit, error)
func (*ActivityRepo) Search ¶
func (r *ActivityRepo) Search( ctx context.Context, po *data.PageOptions, filters *data.ActivityFilterOptions, ) ([]*ActivityPermit, error)
func (*ActivityRepo) Update ¶
func (r *ActivityRepo) Update( ctx context.Context, c *data.Activity, ) (*ActivityPermit, error)
func (*ActivityRepo) ViewerCanAdmin ¶
type AppleablePermit ¶
type AppledPermit ¶
type AppledPermit struct {
// contains filtered or unexported fields
}
func (*AppledPermit) AppleableID ¶
func (r *AppledPermit) AppleableID() (*mytype.OID, error)
func (*AppledPermit) Get ¶
func (r *AppledPermit) Get() *data.Appled
func (*AppledPermit) ID ¶
func (r *AppledPermit) ID() (int32, error)
type AppledRepo ¶
type AppledRepo struct {
// contains filtered or unexported fields
}
func NewAppledRepo ¶
func NewAppledRepo(conf *myconf.Config) *AppledRepo
func (*AppledRepo) CheckConnection ¶
func (r *AppledRepo) CheckConnection() error
func (*AppledRepo) Close ¶
func (r *AppledRepo) Close()
func (*AppledRepo) Connect ¶
func (r *AppledRepo) Connect( ctx context.Context, appled *data.Appled, ) (*AppledPermit, error)
func (*AppledRepo) CountByAppleable ¶
func (*AppledRepo) CountByUser ¶
func (*AppledRepo) Disconnect ¶
func (*AppledRepo) Get ¶
func (r *AppledRepo) Get( ctx context.Context, a *data.Appled, ) (*AppledPermit, error)
func (*AppledRepo) GetByAppleable ¶
func (r *AppledRepo) GetByAppleable( ctx context.Context, appleableID string, po *data.PageOptions, ) ([]*AppledPermit, error)
func (*AppledRepo) GetByUser ¶
func (r *AppledRepo) GetByUser( ctx context.Context, userID string, po *data.PageOptions, ) ([]*AppledPermit, error)
func (*AppledRepo) Open ¶
func (r *AppledRepo) Open(p *Permitter) error
func (*AppledRepo) ViewerCanApple ¶
type AssetPermit ¶
type AssetPermit struct {
// contains filtered or unexported fields
}
func (*AssetPermit) ContentType ¶
func (r *AssetPermit) ContentType() (string, error)
func (*AssetPermit) Get ¶
func (r *AssetPermit) Get() *data.Asset
func (*AssetPermit) ID ¶
func (r *AssetPermit) ID() (int64, error)
func (*AssetPermit) Key ¶
func (r *AssetPermit) Key() (string, error)
func (*AssetPermit) Name ¶
func (r *AssetPermit) Name() (string, error)
func (*AssetPermit) Size ¶
func (r *AssetPermit) Size() (int64, error)
func (*AssetPermit) Subtype ¶
func (r *AssetPermit) Subtype() (string, error)
func (*AssetPermit) Type ¶
func (r *AssetPermit) Type() (string, error)
type AssetRepo ¶
type AssetRepo struct {
// contains filtered or unexported fields
}
func NewAssetRepo ¶
func (*AssetRepo) CheckConnection ¶
type CommentDraftBackupPermit ¶
type CommentDraftBackupPermit struct {
// contains filtered or unexported fields
}
func (*CommentDraftBackupPermit) CommentID ¶
func (r *CommentDraftBackupPermit) CommentID() (*mytype.OID, error)
func (*CommentDraftBackupPermit) CreatedAt ¶
func (r *CommentDraftBackupPermit) CreatedAt() (time.Time, error)
func (*CommentDraftBackupPermit) Draft ¶
func (r *CommentDraftBackupPermit) Draft() (string, error)
func (*CommentDraftBackupPermit) Get ¶
func (r *CommentDraftBackupPermit) Get() *data.CommentDraftBackup
func (*CommentDraftBackupPermit) ID ¶
func (r *CommentDraftBackupPermit) ID() (int32, error)
type CommentDraftBackupRepo ¶
type CommentDraftBackupRepo struct {
// contains filtered or unexported fields
}
func NewCommentDraftBackupRepo ¶
func NewCommentDraftBackupRepo(conf *myconf.Config) *CommentDraftBackupRepo
func (*CommentDraftBackupRepo) CheckConnection ¶
func (r *CommentDraftBackupRepo) CheckConnection() error
func (*CommentDraftBackupRepo) Clear ¶
func (r *CommentDraftBackupRepo) Clear(id string)
func (*CommentDraftBackupRepo) Close ¶
func (r *CommentDraftBackupRepo) Close()
func (*CommentDraftBackupRepo) Get ¶
func (r *CommentDraftBackupRepo) Get( ctx context.Context, commentID string, id int32, ) (*CommentDraftBackupPermit, error)
func (*CommentDraftBackupRepo) GetByComment ¶
func (r *CommentDraftBackupRepo) GetByComment( ctx context.Context, commentID string, ) ([]*CommentDraftBackupPermit, error)
func (*CommentDraftBackupRepo) Open ¶
func (r *CommentDraftBackupRepo) Open(p *Permitter) error
func (*CommentDraftBackupRepo) Pull ¶
func (r *CommentDraftBackupRepo) Pull( ctx context.Context, commentID string, id int32, ) (*CommentDraftBackupPermit, error)
Same as Get(), but doesn't use the dataloader
type CommentPermit ¶
type CommentPermit struct {
// contains filtered or unexported fields
}
func (*CommentPermit) CommentableID ¶
func (r *CommentPermit) CommentableID() (*mytype.OID, error)
func (*CommentPermit) Draft ¶
func (r *CommentPermit) Draft() (string, error)
func (*CommentPermit) Get ¶
func (r *CommentPermit) Get() *data.Comment
func (*CommentPermit) IsPublished ¶
func (r *CommentPermit) IsPublished() (bool, error)
func (*CommentPermit) LastEditedAt ¶
func (r *CommentPermit) LastEditedAt() (time.Time, error)
func (*CommentPermit) PublishedAt ¶
func (r *CommentPermit) PublishedAt() (time.Time, error)
func (*CommentPermit) Type ¶
func (r *CommentPermit) Type() (string, error)
type CommentRepo ¶
type CommentRepo struct {
// contains filtered or unexported fields
}
func NewCommentRepo ¶
func NewCommentRepo(conf *myconf.Config) *CommentRepo
func (*CommentRepo) BatchGet ¶
func (r *CommentRepo) BatchGet( ctx context.Context, ids []string, ) ([]*CommentPermit, error)
func (*CommentRepo) CheckConnection ¶
func (r *CommentRepo) CheckConnection() error
func (*CommentRepo) Close ¶
func (r *CommentRepo) Close()
func (*CommentRepo) CountByCommentable ¶
func (r *CommentRepo) CountByCommentable( ctx context.Context, commentableID string, filters *data.CommentFilterOptions, ) (int32, error)
func (*CommentRepo) CountByLabel ¶
func (r *CommentRepo) CountByLabel( ctx context.Context, labelID string, filters *data.CommentFilterOptions, ) (int32, error)
func (*CommentRepo) CountByStudy ¶
func (r *CommentRepo) CountByStudy( ctx context.Context, studyID string, filters *data.CommentFilterOptions, ) (int32, error)
func (*CommentRepo) CountByUser ¶
func (r *CommentRepo) CountByUser( ctx context.Context, userID string, filters *data.CommentFilterOptions, ) (int32, error)
func (*CommentRepo) Create ¶
func (r *CommentRepo) Create( ctx context.Context, lc *data.Comment, ) (*CommentPermit, error)
func (*CommentRepo) Get ¶
func (r *CommentRepo) Get( ctx context.Context, id string, ) (*CommentPermit, error)
func (*CommentRepo) GetByCommentable ¶
func (r *CommentRepo) GetByCommentable( ctx context.Context, commentableID string, po *data.PageOptions, filters *data.CommentFilterOptions, ) ([]*CommentPermit, error)
func (*CommentRepo) GetByLabel ¶
func (r *CommentRepo) GetByLabel( ctx context.Context, labelID string, po *data.PageOptions, filters *data.CommentFilterOptions, ) ([]*CommentPermit, error)
func (*CommentRepo) GetByStudy ¶
func (r *CommentRepo) GetByStudy( ctx context.Context, studyID string, po *data.PageOptions, filters *data.CommentFilterOptions, ) ([]*CommentPermit, error)
func (*CommentRepo) GetByUser ¶
func (r *CommentRepo) GetByUser( ctx context.Context, userID string, po *data.PageOptions, filters *data.CommentFilterOptions, ) ([]*CommentPermit, error)
func (*CommentRepo) GetUserNewComment ¶
func (r *CommentRepo) GetUserNewComment( ctx context.Context, userID, commentableID string, ) (*CommentPermit, error)
func (*CommentRepo) Open ¶
func (r *CommentRepo) Open(p *Permitter) error
func (*CommentRepo) Update ¶
func (r *CommentRepo) Update( ctx context.Context, lc *data.Comment, ) (*CommentPermit, error)
func (*CommentRepo) ViewerCanDelete ¶
func (*CommentRepo) ViewerCanUpdate ¶
type CourseLessonPermit ¶
type CourseLessonPermit struct {
// contains filtered or unexported fields
}
func (*CourseLessonPermit) Get ¶
func (r *CourseLessonPermit) Get() *data.CourseLesson
func (*CourseLessonPermit) Number ¶
func (r *CourseLessonPermit) Number() (int32, error)
type CourseLessonRepo ¶
type CourseLessonRepo struct {
// contains filtered or unexported fields
}
func NewCourseLessonRepo ¶
func NewCourseLessonRepo(conf *myconf.Config) *CourseLessonRepo
func (*CourseLessonRepo) CheckConnection ¶
func (r *CourseLessonRepo) CheckConnection() error
func (*CourseLessonRepo) Close ¶
func (r *CourseLessonRepo) Close()
func (*CourseLessonRepo) Connect ¶
func (r *CourseLessonRepo) Connect( ctx context.Context, courseLesson *data.CourseLesson, ) (*CourseLessonPermit, error)
func (*CourseLessonRepo) CountByCourse ¶
func (*CourseLessonRepo) Disconnect ¶
func (r *CourseLessonRepo) Disconnect( ctx context.Context, courseLesson *data.CourseLesson, ) error
func (*CourseLessonRepo) Get ¶
func (r *CourseLessonRepo) Get( ctx context.Context, lessonID string, ) (*CourseLessonPermit, error)
func (*CourseLessonRepo) GetByCourse ¶
func (r *CourseLessonRepo) GetByCourse( ctx context.Context, courseID string, po *data.PageOptions, ) ([]*CourseLessonPermit, error)
func (*CourseLessonRepo) GetByCourseAndNumber ¶
func (r *CourseLessonRepo) GetByCourseAndNumber( ctx context.Context, courseID string, number int32, ) (*CourseLessonPermit, error)
func (*CourseLessonRepo) Move ¶
func (r *CourseLessonRepo) Move( ctx context.Context, courseLesson *data.CourseLesson, afterLessonID string, ) (*data.CourseLesson, error)
func (*CourseLessonRepo) Open ¶
func (r *CourseLessonRepo) Open(p *Permitter) error
type CoursePermit ¶
type CoursePermit struct {
// contains filtered or unexported fields
}
func (*CoursePermit) AdvancedAt ¶
func (r *CoursePermit) AdvancedAt() (*time.Time, error)
func (*CoursePermit) AppledAt ¶
func (r *CoursePermit) AppledAt() time.Time
func (*CoursePermit) CompletedAt ¶
func (r *CoursePermit) CompletedAt() (*time.Time, error)
func (*CoursePermit) Description ¶
func (r *CoursePermit) Description() (string, error)
func (*CoursePermit) Get ¶
func (r *CoursePermit) Get() *data.Course
func (*CoursePermit) IsPublished ¶
func (r *CoursePermit) IsPublished() (bool, error)
func (*CoursePermit) Name ¶
func (r *CoursePermit) Name() (string, error)
func (*CoursePermit) Number ¶
func (r *CoursePermit) Number() (int32, error)
func (*CoursePermit) PublishedAt ¶
func (r *CoursePermit) PublishedAt() (*time.Time, error)
func (*CoursePermit) Status ¶
func (r *CoursePermit) Status() (*mytype.CourseStatus, error)
func (*CoursePermit) TopicedAt ¶
func (r *CoursePermit) TopicedAt() time.Time
type CourseRepo ¶
type CourseRepo struct {
// contains filtered or unexported fields
}
func NewCourseRepo ¶
func NewCourseRepo(conf *myconf.Config) *CourseRepo
func (*CourseRepo) CheckConnection ¶
func (r *CourseRepo) CheckConnection() error
func (*CourseRepo) Close ¶
func (r *CourseRepo) Close()
func (*CourseRepo) CountByApplee ¶
func (r *CourseRepo) CountByApplee( ctx context.Context, appleeID string, filters *data.CourseFilterOptions, ) (int32, error)
func (*CourseRepo) CountBySearch ¶
func (r *CourseRepo) CountBySearch( ctx context.Context, filters *data.CourseFilterOptions, ) (int32, error)
func (*CourseRepo) CountByStudy ¶
func (r *CourseRepo) CountByStudy( ctx context.Context, studyID string, filters *data.CourseFilterOptions, ) (int32, error)
func (*CourseRepo) CountByTopic ¶
func (r *CourseRepo) CountByTopic( ctx context.Context, topicID string, filters *data.CourseFilterOptions, ) (int32, error)
func (*CourseRepo) CountByUser ¶
func (r *CourseRepo) CountByUser( ctx context.Context, userID string, filters *data.CourseFilterOptions, ) (int32, error)
func (*CourseRepo) Create ¶
func (r *CourseRepo) Create( ctx context.Context, c *data.Course, ) (*CoursePermit, error)
func (*CourseRepo) Get ¶
func (r *CourseRepo) Get( ctx context.Context, id string, ) (*CoursePermit, error)
func (*CourseRepo) GetByApplee ¶
func (r *CourseRepo) GetByApplee( ctx context.Context, appleeID string, po *data.PageOptions, filters *data.CourseFilterOptions, ) ([]*CoursePermit, error)
func (*CourseRepo) GetByName ¶
func (r *CourseRepo) GetByName( ctx context.Context, studyID, name string, ) (*CoursePermit, error)
func (*CourseRepo) GetByNumber ¶
func (r *CourseRepo) GetByNumber( ctx context.Context, studyID string, number int32, ) (*CoursePermit, error)
func (*CourseRepo) GetByStudy ¶
func (r *CourseRepo) GetByStudy( ctx context.Context, studyID string, po *data.PageOptions, filters *data.CourseFilterOptions, ) ([]*CoursePermit, error)
func (*CourseRepo) GetByStudyAndName ¶
func (r *CourseRepo) GetByStudyAndName( ctx context.Context, study, name string, ) (*CoursePermit, error)
func (*CourseRepo) GetByTopic ¶
func (r *CourseRepo) GetByTopic( ctx context.Context, topicID string, po *data.PageOptions, filters *data.CourseFilterOptions, ) ([]*CoursePermit, error)
func (*CourseRepo) GetByUser ¶
func (r *CourseRepo) GetByUser( ctx context.Context, userID string, po *data.PageOptions, filters *data.CourseFilterOptions, ) ([]*CoursePermit, error)
func (*CourseRepo) IsPublishable ¶
func (*CourseRepo) Open ¶
func (r *CourseRepo) Open(p *Permitter) error
func (*CourseRepo) Pull ¶
func (r *CourseRepo) Pull( ctx context.Context, id string, ) (*CoursePermit, error)
func (*CourseRepo) Search ¶
func (r *CourseRepo) Search( ctx context.Context, po *data.PageOptions, filters *data.CourseFilterOptions, ) ([]*CoursePermit, error)
func (*CourseRepo) Update ¶
func (r *CourseRepo) Update( ctx context.Context, c *data.Course, ) (*CoursePermit, error)
func (*CourseRepo) ViewerCanAdmin ¶
type EVTRepo ¶
type EVTRepo struct {
// contains filtered or unexported fields
}
func NewEVTRepo ¶
func (*EVTRepo) CheckConnection ¶
type EmailPermit ¶
type EmailPermit struct {
// contains filtered or unexported fields
}
func (*EmailPermit) Get ¶
func (r *EmailPermit) Get() *data.Email
func (*EmailPermit) IsVerified ¶
func (r *EmailPermit) IsVerified() (bool, error)
func (*EmailPermit) Type ¶
func (r *EmailPermit) Type() (string, error)
func (*EmailPermit) Value ¶
func (r *EmailPermit) Value() (string, error)
func (*EmailPermit) VerifiedAt ¶
func (r *EmailPermit) VerifiedAt() (*time.Time, error)
type EmailRepo ¶
type EmailRepo struct {
// contains filtered or unexported fields
}
func NewEmailRepo ¶
func (*EmailRepo) CheckConnection ¶
func (*EmailRepo) CountByUser ¶
func (*EmailRepo) GetByUser ¶
func (r *EmailRepo) GetByUser( ctx context.Context, userID string, po *data.PageOptions, filters *data.EmailFilterOptions, ) ([]*EmailPermit, error)
func (*EmailRepo) GetByValue ¶
type EnrollablePermit ¶
type EnrolledPermit ¶
type EnrolledPermit struct {
// contains filtered or unexported fields
}
func (*EnrolledPermit) EnrollableID ¶
func (r *EnrolledPermit) EnrollableID() (*mytype.OID, error)
func (*EnrolledPermit) Get ¶
func (r *EnrolledPermit) Get() *data.Enrolled
func (*EnrolledPermit) ID ¶
func (r *EnrolledPermit) ID() (int32, error)
func (*EnrolledPermit) Status ¶
func (r *EnrolledPermit) Status() (*mytype.EnrollmentStatus, error)
type EnrolledRepo ¶
type EnrolledRepo struct {
// contains filtered or unexported fields
}
func NewEnrolledRepo ¶
func NewEnrolledRepo(conf *myconf.Config) *EnrolledRepo
func (*EnrolledRepo) CheckConnection ¶
func (r *EnrolledRepo) CheckConnection() error
func (*EnrolledRepo) Close ¶
func (r *EnrolledRepo) Close()
func (*EnrolledRepo) Connect ¶
func (r *EnrolledRepo) Connect( ctx context.Context, enrolled *data.Enrolled, ) (*EnrolledPermit, error)
func (*EnrolledRepo) CountByEnrollable ¶
func (r *EnrolledRepo) CountByEnrollable( ctx context.Context, enrollableID string, filters *data.EnrolledFilterOptions, ) (int32, error)
func (*EnrolledRepo) CountByUser ¶
func (r *EnrolledRepo) CountByUser( ctx context.Context, userID string, filters *data.EnrolledFilterOptions, ) (int32, error)
func (*EnrolledRepo) Disconnect ¶
func (*EnrolledRepo) Get ¶
func (r *EnrolledRepo) Get( ctx context.Context, e *data.Enrolled, ) (*EnrolledPermit, error)
func (*EnrolledRepo) GetByEnrollable ¶
func (r *EnrolledRepo) GetByEnrollable( ctx context.Context, enrollableID string, po *data.PageOptions, filters *data.EnrolledFilterOptions, ) ([]*EnrolledPermit, error)
func (*EnrolledRepo) GetByUser ¶
func (r *EnrolledRepo) GetByUser( ctx context.Context, userID string, po *data.PageOptions, filters *data.EnrolledFilterOptions, ) ([]*EnrolledPermit, error)
func (*EnrolledRepo) Open ¶
func (r *EnrolledRepo) Open(p *Permitter) error
func (*EnrolledRepo) Pull ¶
func (r *EnrolledRepo) Pull( ctx context.Context, e *data.Enrolled, ) (*EnrolledPermit, error)
Same as Get(), but doesn't use the dataloader, so it always requests from the db.
func (*EnrolledRepo) Update ¶
func (r *EnrolledRepo) Update( ctx context.Context, e *data.Enrolled, ) (*EnrolledPermit, error)
func (*EnrolledRepo) ViewerCanEnroll ¶
type EventPermit ¶
type EventPermit struct {
// contains filtered or unexported fields
}
func (*EventPermit) Get ¶
func (r *EventPermit) Get() *data.Event
func (*EventPermit) Public ¶
func (r *EventPermit) Public() (bool, error)
func (*EventPermit) Type ¶
func (r *EventPermit) Type() (string, error)
type EventRepo ¶
type EventRepo struct {
// contains filtered or unexported fields
}
func NewEventRepo ¶
func (*EventRepo) CheckConnection ¶
func (*EventRepo) CountByLesson ¶
func (*EventRepo) CountByStudy ¶
func (*EventRepo) CountByUser ¶
func (*EventRepo) CountByUserAsset ¶
func (*EventRepo) CountReceivedByUser ¶
func (*EventRepo) GetByLesson ¶
func (r *EventRepo) GetByLesson( ctx context.Context, lessonID string, po *data.PageOptions, filters *data.EventFilterOptions, ) ([]*EventPermit, error)
func (*EventRepo) GetByStudy ¶
func (r *EventRepo) GetByStudy( ctx context.Context, studyID string, po *data.PageOptions, filters *data.EventFilterOptions, ) ([]*EventPermit, error)
func (*EventRepo) GetByUser ¶
func (r *EventRepo) GetByUser( ctx context.Context, userID string, po *data.PageOptions, filters *data.EventFilterOptions, ) ([]*EventPermit, error)
func (*EventRepo) GetByUserAsset ¶
func (r *EventRepo) GetByUserAsset( ctx context.Context, userID string, po *data.PageOptions, filters *data.EventFilterOptions, ) ([]*EventPermit, error)
func (*EventRepo) GetReceivedByUser ¶
func (r *EventRepo) GetReceivedByUser( ctx context.Context, userID string, po *data.PageOptions, filters *data.EventFilterOptions, ) ([]*EventPermit, error)
type FieldPermissionFunc ¶
var AdminPermissionFunc FieldPermissionFunc = func(field string) bool { return true }
type LabelPermit ¶
type LabelPermit struct {
// contains filtered or unexported fields
}
func (*LabelPermit) Color ¶
func (r *LabelPermit) Color() (string, error)
func (*LabelPermit) Description ¶
func (r *LabelPermit) Description() (string, error)
func (*LabelPermit) Get ¶
func (r *LabelPermit) Get() *data.Label
func (*LabelPermit) IsDefault ¶
func (r *LabelPermit) IsDefault() (bool, error)
func (*LabelPermit) Name ¶
func (r *LabelPermit) Name() (string, error)
type LabelRepo ¶
type LabelRepo struct {
// contains filtered or unexported fields
}
func NewLabelRepo ¶
func (*LabelRepo) CheckConnection ¶
func (*LabelRepo) CountByLabelable ¶
func (*LabelRepo) CountBySearch ¶
func (*LabelRepo) CountByStudy ¶
func (*LabelRepo) GetByLabelable ¶
func (r *LabelRepo) GetByLabelable( ctx context.Context, labelableID string, po *data.PageOptions, filters *data.LabelFilterOptions, ) ([]*LabelPermit, error)
func (*LabelRepo) GetByStudy ¶
func (r *LabelRepo) GetByStudy( ctx context.Context, studyID string, po *data.PageOptions, filters *data.LabelFilterOptions, ) ([]*LabelPermit, error)
func (*LabelRepo) Search ¶
func (r *LabelRepo) Search( ctx context.Context, po *data.PageOptions, filters *data.LabelFilterOptions, ) ([]*LabelPermit, error)
func (*LabelRepo) ViewerCanDelete ¶
type LabelablePermit ¶
type LabeledPermit ¶
type LabeledPermit struct {
// contains filtered or unexported fields
}
func (*LabeledPermit) Get ¶
func (r *LabeledPermit) Get() *data.Labeled
func (*LabeledPermit) ID ¶
func (r *LabeledPermit) ID() (int32, error)
func (*LabeledPermit) LabelableID ¶
func (r *LabeledPermit) LabelableID() (*mytype.OID, error)
type LabeledRepo ¶
type LabeledRepo struct {
// contains filtered or unexported fields
}
func NewLabeledRepo ¶
func NewLabeledRepo(conf *myconf.Config) *LabeledRepo
func (*LabeledRepo) CheckConnection ¶
func (r *LabeledRepo) CheckConnection() error
func (*LabeledRepo) Close ¶
func (r *LabeledRepo) Close()
func (*LabeledRepo) Connect ¶
func (r *LabeledRepo) Connect( ctx context.Context, labeled *data.Labeled, ) (*LabeledPermit, error)
func (*LabeledRepo) CountByLabel ¶
func (*LabeledRepo) CountByLabelable ¶
func (*LabeledRepo) Disconnect ¶
func (*LabeledRepo) Get ¶
func (r *LabeledRepo) Get( ctx context.Context, l *data.Labeled, ) (*LabeledPermit, error)
func (*LabeledRepo) GetByLabel ¶
func (r *LabeledRepo) GetByLabel( ctx context.Context, labelID string, po *data.PageOptions, ) ([]*LabeledPermit, error)
func (*LabeledRepo) GetByLabelable ¶
func (r *LabeledRepo) GetByLabelable( ctx context.Context, labelableID string, po *data.PageOptions, ) ([]*LabeledPermit, error)
func (*LabeledRepo) Open ¶
func (r *LabeledRepo) Open(p *Permitter) error
type LessonDraftBackupPermit ¶
type LessonDraftBackupPermit struct {
// contains filtered or unexported fields
}
func (*LessonDraftBackupPermit) CreatedAt ¶
func (r *LessonDraftBackupPermit) CreatedAt() (time.Time, error)
func (*LessonDraftBackupPermit) Draft ¶
func (r *LessonDraftBackupPermit) Draft() (string, error)
func (*LessonDraftBackupPermit) Get ¶
func (r *LessonDraftBackupPermit) Get() *data.LessonDraftBackup
func (*LessonDraftBackupPermit) ID ¶
func (r *LessonDraftBackupPermit) ID() (int32, error)
type LessonDraftBackupRepo ¶
type LessonDraftBackupRepo struct {
// contains filtered or unexported fields
}
func NewLessonDraftBackupRepo ¶
func NewLessonDraftBackupRepo(conf *myconf.Config) *LessonDraftBackupRepo
func (*LessonDraftBackupRepo) CheckConnection ¶
func (r *LessonDraftBackupRepo) CheckConnection() error
func (*LessonDraftBackupRepo) Clear ¶
func (r *LessonDraftBackupRepo) Clear(id string)
func (*LessonDraftBackupRepo) Close ¶
func (r *LessonDraftBackupRepo) Close()
func (*LessonDraftBackupRepo) Get ¶
func (r *LessonDraftBackupRepo) Get( ctx context.Context, lessonID string, id int32, ) (*LessonDraftBackupPermit, error)
func (*LessonDraftBackupRepo) GetByLesson ¶
func (r *LessonDraftBackupRepo) GetByLesson( ctx context.Context, lessonID string, ) ([]*LessonDraftBackupPermit, error)
func (*LessonDraftBackupRepo) Open ¶
func (r *LessonDraftBackupRepo) Open(p *Permitter) error
func (*LessonDraftBackupRepo) Pull ¶
func (r *LessonDraftBackupRepo) Pull( ctx context.Context, lessonID string, id int32, ) (*LessonDraftBackupPermit, error)
Same as Get(), but doesn't use the dataloader
type LessonPermit ¶
type LessonPermit struct {
// contains filtered or unexported fields
}
func (*LessonPermit) CourseNumber ¶
func (r *LessonPermit) CourseNumber() (*int32, error)
func (*LessonPermit) Draft ¶
func (r *LessonPermit) Draft() (string, error)
func (*LessonPermit) Get ¶
func (r *LessonPermit) Get() *data.Lesson
func (*LessonPermit) IsPublished ¶
func (r *LessonPermit) IsPublished() (bool, error)
func (*LessonPermit) LastEditedAt ¶
func (r *LessonPermit) LastEditedAt() (time.Time, error)
func (*LessonPermit) Number ¶
func (r *LessonPermit) Number() (int32, error)
func (*LessonPermit) PublishedAt ¶
func (r *LessonPermit) PublishedAt() (time.Time, error)
func (*LessonPermit) Title ¶
func (r *LessonPermit) Title() (string, error)
type LessonRepo ¶
type LessonRepo struct {
// contains filtered or unexported fields
}
func NewLessonRepo ¶
func NewLessonRepo(conf *myconf.Config) *LessonRepo
func (*LessonRepo) BatchGetByNumber ¶
func (r *LessonRepo) BatchGetByNumber( ctx context.Context, studyID string, numbers []int32, ) ([]*LessonPermit, error)
func (*LessonRepo) CheckConnection ¶
func (r *LessonRepo) CheckConnection() error
func (*LessonRepo) Clear ¶
func (r *LessonRepo) Clear(id string)
func (*LessonRepo) Close ¶
func (r *LessonRepo) Close()
func (*LessonRepo) CountByCourse ¶
func (r *LessonRepo) CountByCourse( ctx context.Context, courseID string, filters *data.LessonFilterOptions, ) (int32, error)
func (*LessonRepo) CountByEnrollee ¶
func (r *LessonRepo) CountByEnrollee( ctx context.Context, userID string, filters *data.LessonFilterOptions, ) (int32, error)
func (*LessonRepo) CountByLabel ¶
func (r *LessonRepo) CountByLabel( ctx context.Context, labelID string, filters *data.LessonFilterOptions, ) (int32, error)
func (*LessonRepo) CountBySearch ¶
func (r *LessonRepo) CountBySearch( ctx context.Context, filters *data.LessonFilterOptions, ) (int32, error)
func (*LessonRepo) CountByStudy ¶
func (r *LessonRepo) CountByStudy( ctx context.Context, studyID string, filters *data.LessonFilterOptions, ) (int32, error)
func (*LessonRepo) CountByUser ¶
func (r *LessonRepo) CountByUser( ctx context.Context, userID string, filters *data.LessonFilterOptions, ) (int32, error)
func (*LessonRepo) Create ¶
func (r *LessonRepo) Create( ctx context.Context, l *data.Lesson, ) (*LessonPermit, error)
func (*LessonRepo) ExistsByNumber ¶
func (*LessonRepo) ExistsByOwnerStudyAndNumber ¶
func (*LessonRepo) Get ¶
func (r *LessonRepo) Get( ctx context.Context, id string, ) (*LessonPermit, error)
func (*LessonRepo) GetByCourse ¶
func (r *LessonRepo) GetByCourse( ctx context.Context, courseID string, po *data.PageOptions, filters *data.LessonFilterOptions, ) ([]*LessonPermit, error)
func (*LessonRepo) GetByCourseNumber ¶
func (r *LessonRepo) GetByCourseNumber( ctx context.Context, courseID string, courseNumber int32, ) (*LessonPermit, error)
func (*LessonRepo) GetByEnrollee ¶
func (r *LessonRepo) GetByEnrollee( ctx context.Context, userID string, po *data.PageOptions, filters *data.LessonFilterOptions, ) ([]*LessonPermit, error)
func (*LessonRepo) GetByLabel ¶
func (r *LessonRepo) GetByLabel( ctx context.Context, labelID string, po *data.PageOptions, filters *data.LessonFilterOptions, ) ([]*LessonPermit, error)
func (*LessonRepo) GetByNumber ¶
func (r *LessonRepo) GetByNumber( ctx context.Context, studyID string, number int32, ) (*LessonPermit, error)
func (*LessonRepo) GetByOwnerStudyAndNumber ¶
func (r *LessonRepo) GetByOwnerStudyAndNumber( ctx context.Context, owner, study string, number int32, ) (*LessonPermit, error)
func (*LessonRepo) GetByStudy ¶
func (r *LessonRepo) GetByStudy( ctx context.Context, studyID string, po *data.PageOptions, filters *data.LessonFilterOptions, ) ([]*LessonPermit, error)
func (*LessonRepo) GetByUser ¶
func (r *LessonRepo) GetByUser( ctx context.Context, userID string, po *data.PageOptions, filters *data.LessonFilterOptions, ) ([]*LessonPermit, error)
func (*LessonRepo) Open ¶
func (r *LessonRepo) Open(p *Permitter) error
func (*LessonRepo) Pull ¶
func (r *LessonRepo) Pull( ctx context.Context, id string, ) (*LessonPermit, error)
Same as Get(), but doesn't use the dataloader
func (*LessonRepo) Search ¶
func (r *LessonRepo) Search( ctx context.Context, po *data.PageOptions, filters *data.LessonFilterOptions, ) ([]*LessonPermit, error)
func (*LessonRepo) Update ¶
func (r *LessonRepo) Update( ctx context.Context, l *data.Lesson, ) (*LessonPermit, error)
func (*LessonRepo) ViewerCanDelete ¶
func (*LessonRepo) ViewerCanUpdate ¶
type NodePermit ¶
type NotificationPermit ¶
type NotificationPermit struct {
// contains filtered or unexported fields
}
func (*NotificationPermit) Get ¶
func (r *NotificationPermit) Get() *data.Notification
func (*NotificationPermit) LastReadAt ¶
func (r *NotificationPermit) LastReadAt() (time.Time, error)
func (*NotificationPermit) Reason ¶
func (r *NotificationPermit) Reason() (string, error)
func (*NotificationPermit) Subject ¶
func (r *NotificationPermit) Subject() (string, error)
func (*NotificationPermit) SubjectID ¶
func (r *NotificationPermit) SubjectID() (*mytype.OID, error)
func (*NotificationPermit) Unread ¶
func (r *NotificationPermit) Unread() (bool, error)
type NotificationRepo ¶
type NotificationRepo struct {
// contains filtered or unexported fields
}
func NewNotificationRepo ¶
func NewNotificationRepo(conf *myconf.Config) *NotificationRepo
func (*NotificationRepo) CheckConnection ¶
func (r *NotificationRepo) CheckConnection() error
func (*NotificationRepo) Close ¶
func (r *NotificationRepo) Close()
func (*NotificationRepo) CountByStudy ¶
func (*NotificationRepo) CountByUser ¶
func (*NotificationRepo) Create ¶
func (r *NotificationRepo) Create( ctx context.Context, notification *data.Notification, ) (*NotificationPermit, error)
func (*NotificationRepo) Delete ¶
func (r *NotificationRepo) Delete( ctx context.Context, n *data.Notification, ) error
func (*NotificationRepo) DeleteByStudy ¶
func (r *NotificationRepo) DeleteByStudy( ctx context.Context, n *data.Notification, ) error
func (*NotificationRepo) DeleteByUser ¶
func (r *NotificationRepo) DeleteByUser( ctx context.Context, n *data.Notification, ) error
func (*NotificationRepo) Get ¶
func (r *NotificationRepo) Get( ctx context.Context, id string, ) (*NotificationPermit, error)
func (*NotificationRepo) GetByStudy ¶
func (r *NotificationRepo) GetByStudy( ctx context.Context, studyID string, po *data.PageOptions, ) ([]*NotificationPermit, error)
func (*NotificationRepo) GetByUser ¶
func (r *NotificationRepo) GetByUser( ctx context.Context, userID string, po *data.PageOptions, ) ([]*NotificationPermit, error)
func (*NotificationRepo) Open ¶
func (r *NotificationRepo) Open(p *Permitter) error
type PRTRepo ¶
type PRTRepo struct {
// contains filtered or unexported fields
}
func NewPRTRepo ¶
func (*PRTRepo) CheckConnection ¶
type Permitter ¶
type Permitter struct {
// contains filtered or unexported fields
}
func (*Permitter) Check ¶
func (r *Permitter) Check( ctx context.Context, a mytype.AccessLevel, node interface{}, ) (FieldPermissionFunc, error)
func (*Permitter) CheckConnection ¶
func (*Permitter) ClearCache ¶
func (r *Permitter) ClearCache()
func (*Permitter) ClearCacheOperation ¶
func (*Permitter) ViewerCanAdmin ¶
Can the viewer admin the node, i.e. is the viewer the owner of the object?
func (*Permitter) ViewerCanCreateWithOwnership ¶
func (r *Permitter) ViewerCanCreateWithOwnership( ctx context.Context, node interface{}, ) (bool, error)
Can the viewer create the passed node with the Owner role? Mainly used for objects that have parent objects, and the viewer must be the owner of the parent object to create a child object.
type Repos ¶
type Repos struct {
// contains filtered or unexported fields
}
func (*Repos) Activity ¶
func (r *Repos) Activity() *ActivityRepo
func (*Repos) ActivityAsset ¶
func (r *Repos) ActivityAsset() *ActivityAssetRepo
func (*Repos) Appled ¶
func (r *Repos) Appled() *AppledRepo
func (*Repos) Comment ¶
func (r *Repos) Comment() *CommentRepo
func (*Repos) CommentDraftBackup ¶
func (r *Repos) CommentDraftBackup() *CommentDraftBackupRepo
func (*Repos) Course ¶
func (r *Repos) Course() *CourseRepo
func (*Repos) CourseLesson ¶
func (r *Repos) CourseLesson() *CourseLessonRepo
func (*Repos) Enrolled ¶
func (r *Repos) Enrolled() *EnrolledRepo
func (*Repos) GetAppleable ¶
func (*Repos) GetCommentable ¶
func (*Repos) GetCreateable ¶
func (*Repos) GetEnrollable ¶
func (*Repos) GetLabelable ¶
func (*Repos) GetNotificationSubject ¶
func (*Repos) GetPublishable ¶
func (*Repos) GetReferenceable ¶
func (*Repos) GetRenameable ¶
func (*Repos) GetTopicable ¶
func (*Repos) Labeled ¶
func (r *Repos) Labeled() *LabeledRepo
func (*Repos) Lesson ¶
func (r *Repos) Lesson() *LessonRepo
func (*Repos) LessonDraftBackup ¶
func (r *Repos) LessonDraftBackup() *LessonDraftBackupRepo
func (*Repos) Notification ¶
func (r *Repos) Notification() *NotificationRepo
func (*Repos) ParseLessonBodyForEvents ¶
func (*Repos) ParseUserAssetBodyForEvents ¶
func (*Repos) ReplaceMarkdownLinksWithRefs ¶
func (*Repos) ReplaceMarkdownRefsWithLinks ¶
func (*Repos) Topiced ¶
func (r *Repos) Topiced() *TopicedRepo
func (*Repos) UserAsset ¶
func (r *Repos) UserAsset() *UserAssetRepo
type StudyNodePermit ¶
type StudyPermit ¶
type StudyPermit struct {
// contains filtered or unexported fields
}
func (*StudyPermit) AdvancedAt ¶
func (r *StudyPermit) AdvancedAt() (*time.Time, error)
func (*StudyPermit) AppledAt ¶
func (r *StudyPermit) AppledAt() time.Time
func (*StudyPermit) Description ¶
func (r *StudyPermit) Description() (string, error)
func (*StudyPermit) EnrolledAt ¶
func (r *StudyPermit) EnrolledAt() time.Time
func (*StudyPermit) Get ¶
func (r *StudyPermit) Get() *data.Study
func (*StudyPermit) Name ¶
func (r *StudyPermit) Name() (string, error)
func (*StudyPermit) Private ¶
func (r *StudyPermit) Private() (bool, error)
func (*StudyPermit) TopicedAt ¶
func (r *StudyPermit) TopicedAt() time.Time
type StudyRepo ¶
type StudyRepo struct {
// contains filtered or unexported fields
}
func NewStudyRepo ¶
func (*StudyRepo) CheckConnection ¶
func (*StudyRepo) CountByApplee ¶
func (*StudyRepo) CountByEnrollee ¶
func (*StudyRepo) CountBySearch ¶
func (*StudyRepo) CountByTopic ¶
func (*StudyRepo) CountByUser ¶
func (*StudyRepo) GetByApplee ¶
func (r *StudyRepo) GetByApplee( ctx context.Context, appleeID string, po *data.PageOptions, filters *data.StudyFilterOptions, ) ([]*StudyPermit, error)
func (*StudyRepo) GetByEnrollee ¶
func (r *StudyRepo) GetByEnrollee( ctx context.Context, enrolleeID string, po *data.PageOptions, filters *data.StudyFilterOptions, ) ([]*StudyPermit, error)
func (*StudyRepo) GetByTopic ¶
func (r *StudyRepo) GetByTopic( ctx context.Context, topicID string, po *data.PageOptions, filters *data.StudyFilterOptions, ) ([]*StudyPermit, error)
func (*StudyRepo) GetByUser ¶
func (r *StudyRepo) GetByUser( ctx context.Context, userID string, po *data.PageOptions, filters *data.StudyFilterOptions, ) ([]*StudyPermit, error)
func (*StudyRepo) GetByUserAndName ¶
func (*StudyRepo) Search ¶
func (r *StudyRepo) Search( ctx context.Context, po *data.PageOptions, filters *data.StudyFilterOptions, ) ([]*StudyPermit, error)
type TopicPermit ¶
type TopicPermit struct {
// contains filtered or unexported fields
}
func (*TopicPermit) Description ¶
func (r *TopicPermit) Description() (string, error)
func (*TopicPermit) Get ¶
func (r *TopicPermit) Get() *data.Topic
func (*TopicPermit) Name ¶
func (r *TopicPermit) Name() (string, error)
type TopicRepo ¶
type TopicRepo struct {
// contains filtered or unexported fields
}
func NewTopicRepo ¶
func (*TopicRepo) CheckConnection ¶
func (*TopicRepo) CountBySearch ¶
func (*TopicRepo) CountByTopicable ¶
func (*TopicRepo) GetByTopicable ¶
func (r *TopicRepo) GetByTopicable( ctx context.Context, topicableID string, po *data.PageOptions, filters *data.TopicFilterOptions, ) ([]*TopicPermit, error)
func (*TopicRepo) Search ¶
func (r *TopicRepo) Search( ctx context.Context, po *data.PageOptions, filters *data.TopicFilterOptions, ) ([]*TopicPermit, error)
type TopicablePermit ¶
type TopicedPermit ¶
type TopicedPermit struct {
// contains filtered or unexported fields
}
func (*TopicedPermit) Get ¶
func (r *TopicedPermit) Get() *data.Topiced
func (*TopicedPermit) ID ¶
func (r *TopicedPermit) ID() (int32, error)
func (*TopicedPermit) TopicableID ¶
func (r *TopicedPermit) TopicableID() (*mytype.OID, error)
type TopicedRepo ¶
type TopicedRepo struct {
// contains filtered or unexported fields
}
func NewTopicedRepo ¶
func NewTopicedRepo(conf *myconf.Config) *TopicedRepo
func (*TopicedRepo) CheckConnection ¶
func (r *TopicedRepo) CheckConnection() error
func (*TopicedRepo) Close ¶
func (r *TopicedRepo) Close()
func (*TopicedRepo) Connect ¶
func (r *TopicedRepo) Connect( ctx context.Context, topiced *data.Topiced, ) (*TopicedPermit, error)
func (*TopicedRepo) CountByTopic ¶
func (*TopicedRepo) CountByTopicable ¶
func (*TopicedRepo) Disconnect ¶
func (*TopicedRepo) Get ¶
func (r *TopicedRepo) Get( ctx context.Context, t *data.Topiced, ) (*TopicedPermit, error)
func (*TopicedRepo) GetByTopic ¶
func (r *TopicedRepo) GetByTopic( ctx context.Context, topicID string, po *data.PageOptions, ) ([]*TopicedPermit, error)
func (*TopicedRepo) GetByTopicable ¶
func (r *TopicedRepo) GetByTopicable( ctx context.Context, topicableID string, po *data.PageOptions, ) ([]*TopicedPermit, error)
func (*TopicedRepo) Open ¶
func (r *TopicedRepo) Open(p *Permitter) error
type UserAssetPermit ¶
type UserAssetPermit struct {
// contains filtered or unexported fields
}
func (*UserAssetPermit) ActivityID ¶
func (r *UserAssetPermit) ActivityID() (*mytype.OID, error)
func (*UserAssetPermit) ActivityNumber ¶
func (r *UserAssetPermit) ActivityNumber() (*int32, error)
func (*UserAssetPermit) Description ¶
func (r *UserAssetPermit) Description() (string, error)
func (*UserAssetPermit) Get ¶
func (r *UserAssetPermit) Get() *data.UserAsset
func (*UserAssetPermit) Key ¶
func (r *UserAssetPermit) Key() (string, error)
func (*UserAssetPermit) Name ¶
func (r *UserAssetPermit) Name() (string, error)
func (*UserAssetPermit) OriginalName ¶
func (r *UserAssetPermit) OriginalName() (string, error)
func (*UserAssetPermit) Size ¶
func (r *UserAssetPermit) Size() (int64, error)
func (*UserAssetPermit) Subtype ¶
func (r *UserAssetPermit) Subtype() (string, error)
func (*UserAssetPermit) Type ¶
func (r *UserAssetPermit) Type() (string, error)
type UserAssetRepo ¶
type UserAssetRepo struct {
// contains filtered or unexported fields
}
func NewUserAssetRepo ¶
func NewUserAssetRepo(conf *myconf.Config) *UserAssetRepo
func (*UserAssetRepo) BatchGetByName ¶
func (r *UserAssetRepo) BatchGetByName( ctx context.Context, studyID string, names []string, ) ([]*UserAssetPermit, error)
func (*UserAssetRepo) CheckConnection ¶
func (r *UserAssetRepo) CheckConnection() error
func (*UserAssetRepo) Close ¶
func (r *UserAssetRepo) Close()
func (*UserAssetRepo) CountByActivity ¶
func (r *UserAssetRepo) CountByActivity( ctx context.Context, activityID string, filters *data.UserAssetFilterOptions, ) (int32, error)
func (*UserAssetRepo) CountByLabel ¶
func (r *UserAssetRepo) CountByLabel( ctx context.Context, labelID string, filters *data.UserAssetFilterOptions, ) (int32, error)
func (*UserAssetRepo) CountBySearch ¶
func (r *UserAssetRepo) CountBySearch( ctx context.Context, filters *data.UserAssetFilterOptions, ) (int32, error)
func (*UserAssetRepo) CountByStudy ¶
func (r *UserAssetRepo) CountByStudy( ctx context.Context, studyID string, filters *data.UserAssetFilterOptions, ) (int32, error)
func (*UserAssetRepo) CountByUser ¶
func (r *UserAssetRepo) CountByUser( ctx context.Context, userID string, filters *data.UserAssetFilterOptions, ) (int32, error)
func (*UserAssetRepo) Create ¶
func (r *UserAssetRepo) Create( ctx context.Context, a *data.UserAsset, ) (*UserAssetPermit, error)
func (*UserAssetRepo) Get ¶
func (r *UserAssetRepo) Get( ctx context.Context, id string, ) (*UserAssetPermit, error)
func (*UserAssetRepo) GetByActivity ¶
func (r *UserAssetRepo) GetByActivity( ctx context.Context, activityID string, po *data.PageOptions, filters *data.UserAssetFilterOptions, ) ([]*UserAssetPermit, error)
func (*UserAssetRepo) GetByActivityNumber ¶
func (r *UserAssetRepo) GetByActivityNumber( ctx context.Context, activityID string, activityNumber int32, ) (*UserAssetPermit, error)
func (*UserAssetRepo) GetByLabel ¶
func (r *UserAssetRepo) GetByLabel( ctx context.Context, labelID string, po *data.PageOptions, filters *data.UserAssetFilterOptions, ) ([]*UserAssetPermit, error)
func (*UserAssetRepo) GetByName ¶
func (r *UserAssetRepo) GetByName( ctx context.Context, studyID, name string, ) (*UserAssetPermit, error)
func (*UserAssetRepo) GetByStudy ¶
func (r *UserAssetRepo) GetByStudy( ctx context.Context, studyID string, po *data.PageOptions, filters *data.UserAssetFilterOptions, ) ([]*UserAssetPermit, error)
func (*UserAssetRepo) GetByUser ¶
func (r *UserAssetRepo) GetByUser( ctx context.Context, userID string, po *data.PageOptions, filters *data.UserAssetFilterOptions, ) ([]*UserAssetPermit, error)
func (*UserAssetRepo) GetByUserStudyAndName ¶
func (r *UserAssetRepo) GetByUserStudyAndName( ctx context.Context, userLogin, studyName, name string, ) (*UserAssetPermit, error)
func (*UserAssetRepo) Open ¶
func (r *UserAssetRepo) Open(p *Permitter) error
func (*UserAssetRepo) Search ¶
func (r *UserAssetRepo) Search( ctx context.Context, po *data.PageOptions, filters *data.UserAssetFilterOptions, ) ([]*UserAssetPermit, error)
func (*UserAssetRepo) Update ¶
func (r *UserAssetRepo) Update( ctx context.Context, a *data.UserAsset, ) (*UserAssetPermit, error)
func (*UserAssetRepo) ViewerCanDelete ¶
func (*UserAssetRepo) ViewerCanUpdate ¶
type UserPermit ¶
type UserPermit struct {
// contains filtered or unexported fields
}
func (*UserPermit) AccountUpdatedAt ¶
func (r *UserPermit) AccountUpdatedAt() (time.Time, error)
func (*UserPermit) AppledAt ¶
func (r *UserPermit) AppledAt() time.Time
func (*UserPermit) Bio ¶
func (r *UserPermit) Bio() (string, error)
func (*UserPermit) EnrolledAt ¶
func (r *UserPermit) EnrolledAt() time.Time
func (*UserPermit) Get ¶
func (r *UserPermit) Get() *data.User
func (*UserPermit) Login ¶
func (r *UserPermit) Login() (string, error)
func (*UserPermit) Name ¶
func (r *UserPermit) Name() (string, error)
func (*UserPermit) ProfileEmailID ¶
func (r *UserPermit) ProfileEmailID() (*mytype.OID, error)
func (*UserPermit) ProfileUpdatedAt ¶
func (r *UserPermit) ProfileUpdatedAt() (time.Time, error)
func (*UserPermit) Roles ¶
func (r *UserPermit) Roles() []string
func (*UserPermit) Verified ¶
func (r *UserPermit) Verified() (bool, error)
type UserRepo ¶
type UserRepo struct {
// contains filtered or unexported fields
}
func NewUserRepo ¶
func (*UserRepo) BatchGetByLogin ¶
func (*UserRepo) CheckConnection ¶
func (*UserRepo) CountByAppleable ¶
func (*UserRepo) CountByEnrollable ¶
func (*UserRepo) CountByEnrollee ¶
func (*UserRepo) CountBySearch ¶
func (*UserRepo) ExistsByLogin ¶
func (*UserRepo) GetByAppleable ¶
func (r *UserRepo) GetByAppleable( ctx context.Context, appleableID string, po *data.PageOptions, filters *data.UserFilterOptions, ) ([]*UserPermit, error)
func (*UserRepo) GetByEnrollable ¶
func (r *UserRepo) GetByEnrollable( ctx context.Context, enrollableID string, po *data.PageOptions, filters *data.UserFilterOptions, ) ([]*UserPermit, error)
func (*UserRepo) GetByEnrollee ¶
func (r *UserRepo) GetByEnrollee( ctx context.Context, enrolleeID string, po *data.PageOptions, filters *data.UserFilterOptions, ) ([]*UserPermit, error)
func (*UserRepo) GetByLogin ¶
func (*UserRepo) Search ¶
func (r *UserRepo) Search( ctx context.Context, po *data.PageOptions, filters *data.UserFilterOptions, ) ([]*UserPermit, error)
func (*UserRepo) UpdateAccount ¶
func (*UserRepo) UpdateProfile ¶
Source Files
¶
- activity.go
- activity_asset.go
- appled.go
- asset.go
- comment.go
- comment_draft_backup.go
- course.go
- course_lesson.go
- email.go
- email_verification_token.go
- enrolled.go
- event.go
- label.go
- labeled.go
- lesson.go
- lesson_draft_backup.go
- notification.go
- password_reset_token.go
- permit.go
- permitter.go
- repo.go
- study.go
- topic.go
- topiced.go
- user.go
- user_asset.go
Click to show internal directories.
Click to hide internal directories.