Documentation ¶
Index ¶
- Constants
- Variables
- func BatchCreateNotification(db Queryer, src *Notification, enrolleds []*Enrolled) error
- func CommitTransaction(db Queryer) error
- func ConnectRolePermissions(db Queryer, o *mytype.Operation, fields, roles []string) error
- func CountActivityAssetByActivity(db Queryer, activityID string) (int32, error)
- func CountActivityByLesson(db Queryer, lessonID string, filters *ActivityFilterOptions) (int32, error)
- func CountActivityBySearch(db Queryer, filters *ActivityFilterOptions) (int32, error)
- func CountActivityByStudy(db Queryer, studyID string, filters *ActivityFilterOptions) (int32, error)
- func CountActivityByUser(db Queryer, userID string, filters *ActivityFilterOptions) (int32, error)
- func CountAppledByAppleable(db Queryer, appleableID string) (int32, error)
- func CountAppledByUser(db Queryer, userID string) (int32, error)
- func CountCommentByCommentable(db Queryer, commentableID string, filters *CommentFilterOptions) (int32, error)
- func CountCommentByLabel(db Queryer, labelID string, filters *CommentFilterOptions) (int32, error)
- func CountCommentByStudy(db Queryer, studyID string, filters *CommentFilterOptions) (int32, error)
- func CountCommentByUser(db Queryer, userID string, filters *CommentFilterOptions) (int32, error)
- func CountCourseByApplee(db Queryer, appleeID string, filters *CourseFilterOptions) (int32, error)
- func CountCourseBySearch(db Queryer, filters *CourseFilterOptions) (int32, error)
- func CountCourseByStudy(db Queryer, studyID string, filters *CourseFilterOptions) (int32, error)
- func CountCourseByTopic(db Queryer, topicID string, filters *CourseFilterOptions) (int32, error)
- func CountCourseByUser(db Queryer, userID string, filters *CourseFilterOptions) (int32, error)
- func CountCourseLessonByCourse(db Queryer, courseID string) (int32, error)
- func CountEmailByUser(db Queryer, userID string, filters *EmailFilterOptions) (int32, error)
- func CountEnrolledByEnrollable(db Queryer, enrollableID string, filters *EnrolledFilterOptions) (int32, error)
- func CountEnrolledByUser(db Queryer, userID string, filters *EnrolledFilterOptions) (int32, error)
- func CountEventByLesson(db Queryer, lessonID string, filters *EventFilterOptions) (int32, error)
- func CountEventByStudy(db Queryer, studyID string, filters *EventFilterOptions) (int32, error)
- func CountEventByUser(db Queryer, userID string, filters *EventFilterOptions) (int32, error)
- func CountEventByUserAsset(db Queryer, assetID string, filters *EventFilterOptions) (int32, error)
- func CountLabelByLabelable(db Queryer, labelableID string, filters *LabelFilterOptions) (int32, error)
- func CountLabelBySearch(db Queryer, filters *LabelFilterOptions) (int32, error)
- func CountLabelByStudy(db Queryer, studyID string, filters *LabelFilterOptions) (int32, error)
- func CountLabeledByLabel(db Queryer, labelID string) (int32, error)
- func CountLabeledByLabelable(db Queryer, labelableID string) (int32, error)
- func CountLessonByCourse(db Queryer, courseID string, filters *LessonFilterOptions) (int32, error)
- func CountLessonByEnrollee(db Queryer, enrolleeID string, filters *LessonFilterOptions) (int32, error)
- func CountLessonByLabel(db Queryer, labelID string, filters *LessonFilterOptions) (int32, error)
- func CountLessonBySearch(db Queryer, filters *LessonFilterOptions) (int32, error)
- func CountLessonByStudy(db Queryer, studyID string, filters *LessonFilterOptions) (int32, error)
- func CountLessonByUser(db Queryer, userID string, filters *LessonFilterOptions) (int32, error)
- func CountNotificationByStudy(db Queryer, studyID string) (int32, error)
- func CountNotificationByUser(db Queryer, userID string) (int32, error)
- func CountPermissionByType(db Queryer, nodeType interface{}) (int32, error)
- func CountReceivedEventByUser(db Queryer, userID string, filters *EventFilterOptions) (int32, error)
- func CountSQL(from string, where WhereFrom, filters FilterOptions, args *pgx.QueryArgs) string
- func CountStudyByApplee(db Queryer, appleeID string, filters *StudyFilterOptions) (int32, error)
- func CountStudyByEnrollee(db Queryer, enrolleeID string, filters *StudyFilterOptions) (int32, error)
- func CountStudyBySearch(db Queryer, filters *StudyFilterOptions) (int32, error)
- func CountStudyByTopic(db Queryer, topicID string, filters *StudyFilterOptions) (int32, error)
- func CountStudyByUser(db Queryer, userID string, filters *StudyFilterOptions) (int32, error)
- func CountTopicBySearch(db Queryer, filters *TopicFilterOptions) (int32, error)
- func CountTopicByTopicable(db Queryer, topicableID string, filters *TopicFilterOptions) (int32, error)
- func CountTopicedByTopic(db Queryer, topicID string) (int32, error)
- func CountTopicedByTopicable(db Queryer, topicableID string) (int32, error)
- func CountUserAssetByActivity(db Queryer, activityID string, filters *UserAssetFilterOptions) (int32, error)
- func CountUserAssetByLabel(db Queryer, labelID string, filters *UserAssetFilterOptions) (int32, error)
- func CountUserAssetBySearch(db Queryer, filters *UserAssetFilterOptions) (int32, error)
- func CountUserAssetByStudy(db Queryer, studyID string, filters *UserAssetFilterOptions) (int32, error)
- func CountUserAssetByUser(db Queryer, userID string, filters *UserAssetFilterOptions) (int32, error)
- func CountUserByAppleable(db Queryer, appleableID string, filters *UserFilterOptions) (int32, error)
- func CountUserByEnrollable(db Queryer, enrollableID string, filters *UserFilterOptions) (int32, error)
- func CountUserByEnrollee(db Queryer, enrolleeID string, filters *UserFilterOptions) (int32, error)
- func CountUserBySearch(db Queryer, filters *UserFilterOptions) (int32, error)
- func CreateNotificationsFromEvent(db Queryer, event *Event) error
- func CreatePermissionSuite(db Queryer, model interface{}) error
- func DecodeCursor(cursor string) (string, error)
- func DeleteActivity(db Queryer, id string) error
- func DeleteActivityAsset(db Queryer, assetID string) error
- func DeleteAppled(db Queryer, id int32) error
- func DeleteAppledByAppleableAndUser(db Queryer, appleableID, userID string) error
- func DeleteAsset(db Queryer, id int64) error
- func DeleteComment(db Queryer, id string) error
- func DeleteCourse(db Queryer, id string) error
- func DeleteCourseLesson(db Queryer, lessonID string) error
- func DeleteEVT(db Queryer, emailID, token string) error
- func DeleteEmail(db Queryer, id string) error
- func DeleteEnrolled(db Queryer, id int32) error
- func DeleteEnrolledByEnrollableAndUser(db Queryer, enrollableID, userID string) error
- func DeleteEvent(db Queryer, id string) error
- func DeleteLabel(db Queryer, id string) error
- func DeleteLabeled(db Queryer, id int32) error
- func DeleteLabeledByLabelableAndLabel(db Queryer, labelableID, labelID string) error
- func DeleteLesson(db Queryer, id string) error
- func DeleteNotification(db Queryer, id string) error
- func DeleteNotificationByStudy(db Queryer, userID, studyID string) error
- func DeleteNotificationByUser(db Queryer, userID string) error
- func DeletePRT(db Queryer, userID, token string) error
- func DeletePermissionSuite(db Queryer, model interface{}) error
- func DeleteStudy(db Queryer, id string) error
- func DeleteTopiced(db Queryer, id int32) error
- func DeleteTopicedByTopicableAndTopic(db Queryer, topicableID, topicID string) error
- func DeleteUser(db Queryer, id string) error
- func DeleteUserAsset(db Queryer, id string) error
- func EncodeCursor(value interface{}) (string, error)
- func ExistsLesson(db Queryer, id string) (bool, error)
- func ExistsLessonByNumber(db Queryer, studyID string, number int32) (bool, error)
- func ExistsLessonByOwnerStudyAndNumber(db Queryer, ownerLogin, studyName string, number int32) (bool, error)
- func ExistsUser(db Queryer, id string) (bool, error)
- func ExistsUserByLogin(db Queryer, login string) (bool, error)
- func GetNamesByTopicable(db Queryer, topicableID string) ([]string, error)
- func GrantUserRoles(db Queryer, userID string, roles ...string) error
- func Initialize(db Queryer) error
- func IsCoursePublishable(db Queryer, id string) (bool, error)
- func ParseConstraintName(constraintName string) (field string)
- func ReorderQuery(po *PageOptions, query string) string
- func RestoreCommentDraftFromBackup(db Queryer, commentID string, backupID int32) error
- func RestoreLessonDraftFromBackup(db Queryer, lessonID string, backupID int32) error
- func RollbackTransaction(db Queryer) error
- func SQL3(selects []string, from string, where WhereFrom, filters FilterOptions, ...) string
- func SearchSQL2(selects []string, from string, query string, args *pgx.QueryArgs, ...) string
- func ToLikeAnyPatternQuery(query string) *pgtype.TextArray
- func ToPrefixTsQuery(query string) string
- func ToSubQuery(query string) string
- func ToTsQuery(query string) string
- func UpdatePermission(db Queryer, id string, a mytype.Audience) error
- func UpdatePermissionAudience(db Queryer, o *mytype.Operation, a mytype.Audience, fields []string) error
- type Activity
- func CreateActivity(db Queryer, row *Activity) (*Activity, error)
- func GetActivity(db Queryer, id string) (*Activity, error)
- func GetActivityByLesson(db Queryer, lessonID string, po *PageOptions, filters *ActivityFilterOptions) ([]*Activity, error)
- func GetActivityByName(db Queryer, studyID, name string) (*Activity, error)
- func GetActivityByNumber(db Queryer, studyID string, number int32) (*Activity, error)
- func GetActivityByStudy(db Queryer, studyID string, po *PageOptions, filters *ActivityFilterOptions) ([]*Activity, error)
- func GetActivityByStudyAndName(db Queryer, study, name string) (*Activity, error)
- func GetActivityByUser(db Queryer, userID string, po *PageOptions, filters *ActivityFilterOptions) ([]*Activity, error)
- func SearchActivity(db Queryer, po *PageOptions, filters *ActivityFilterOptions) ([]*Activity, error)
- func UpdateActivity(db Queryer, row *Activity) (*Activity, error)
- type ActivityAsset
- func CreateActivityAsset(db Queryer, row ActivityAsset) (*ActivityAsset, error)
- func GetActivityAsset(db Queryer, assetID string) (*ActivityAsset, error)
- func GetActivityAssetByActivity(db Queryer, activityID string, po *PageOptions) ([]*ActivityAsset, error)
- func GetActivityAssetByActivityAndNumber(db Queryer, activityID string, number int32) (*ActivityAsset, error)
- func MoveActivityAsset(db Queryer, activityID, assetID, afterAssetID string) (*ActivityAsset, error)
- type ActivityEventPayload
- type ActivityFilterOptions
- type Appled
- func CreateAppled(db Queryer, row Appled) (*Appled, error)
- func GetAppled(db Queryer, id int32) (*Appled, error)
- func GetAppledByAppleable(db Queryer, appleableID string, po *PageOptions) ([]*Appled, error)
- func GetAppledByAppleableAndUser(db Queryer, appleableID, userID string) (*Appled, error)
- func GetAppledByUser(db Queryer, userID string, po *PageOptions) ([]*Appled, error)
- type Asset
- type Comment
- func BatchGetComment(db Queryer, ids []string) ([]*Comment, error)
- func CreateComment(db Queryer, row *Comment) (*Comment, error)
- func GetComment(db Queryer, id string) (*Comment, error)
- func GetCommentByCommentable(db Queryer, commentableID string, po *PageOptions, ...) ([]*Comment, error)
- func GetCommentByLabel(db Queryer, labelID string, po *PageOptions, filters *CommentFilterOptions) ([]*Comment, error)
- func GetCommentByStudy(db Queryer, studyID string, po *PageOptions, filters *CommentFilterOptions) ([]*Comment, error)
- func GetCommentByUser(db Queryer, userID string, po *PageOptions, filters *CommentFilterOptions) ([]*Comment, error)
- func GetUserNewComment(db Queryer, userID, commentableID string) (*Comment, error)
- func UpdateComment(db Queryer, row *Comment) (*Comment, error)
- type CommentDraftBackup
- type CommentFilterOptions
- type Course
- func CreateCourse(db Queryer, row *Course) (*Course, error)
- func GetCourse(db Queryer, id string) (*Course, error)
- func GetCourseByApplee(db Queryer, appleeID string, po *PageOptions, filters *CourseFilterOptions) ([]*Course, error)
- func GetCourseByName(db Queryer, studyID, name string) (*Course, error)
- func GetCourseByNumber(db Queryer, studyID string, number int32) (*Course, error)
- func GetCourseByStudy(db Queryer, studyID string, po *PageOptions, filters *CourseFilterOptions) ([]*Course, error)
- func GetCourseByStudyAndName(db Queryer, study, name string) (*Course, error)
- func GetCourseByTopic(db Queryer, topicID string, po *PageOptions, filters *CourseFilterOptions) ([]*Course, error)
- func GetCourseByUser(db Queryer, userID string, po *PageOptions, filters *CourseFilterOptions) ([]*Course, error)
- func SearchCourse(db Queryer, po *PageOptions, filters *CourseFilterOptions) ([]*Course, error)
- func UpdateCourse(db Queryer, row *Course) (*Course, error)
- type CourseEventPayload
- func NewCourseAppledPayload(courseID *mytype.OID) (*CourseEventPayload, error)
- func NewCourseCreatedPayload(courseID *mytype.OID) (*CourseEventPayload, error)
- func NewCoursePublishedPayload(courseID *mytype.OID) (*CourseEventPayload, error)
- func NewCourseUnappledPayload(courseID *mytype.OID) (*CourseEventPayload, error)
- type CourseFilterOptions
- type CourseLesson
- func CreateCourseLesson(db Queryer, row CourseLesson) (*CourseLesson, error)
- func GetCourseLesson(db Queryer, lessonID string) (*CourseLesson, error)
- func GetCourseLessonByCourse(db Queryer, courseID string, po *PageOptions) ([]*CourseLesson, error)
- func GetCourseLessonByCourseAndNumber(db Queryer, courseID string, number int32) (*CourseLesson, error)
- func MoveCourseLesson(db Queryer, courseID, lessonID, afterLessonID string) (*CourseLesson, error)
- type Cursor
- type DataEndUserError
- type DataFieldError
- type DataFieldErrorCode
- type EVT
- type Email
- func CreateEmail(db Queryer, row *Email) (*Email, error)
- func GetEmail(db Queryer, id string) (*Email, error)
- func GetEmailByUser(db Queryer, userID string, po *PageOptions, filters *EmailFilterOptions) ([]*Email, error)
- func GetEmailByValue(db Queryer, value string) (*Email, error)
- func UpdateEmail(db Queryer, row *Email) (*Email, error)
- type EmailFilterOptions
- type Enrolled
- func CreateEnrolled(db Queryer, row Enrolled) (*Enrolled, error)
- func GetEnrolled(db Queryer, id int32) (*Enrolled, error)
- func GetEnrolledByEnrollable(db Queryer, enrollableID string, po *PageOptions, ...) ([]*Enrolled, error)
- func GetEnrolledByEnrollableAndUser(db Queryer, enrollableID, userID string) (*Enrolled, error)
- func GetEnrolledByUser(db Queryer, userID string, po *PageOptions, filters *EnrolledFilterOptions) ([]*Enrolled, error)
- func UpdateEnrolled(db Queryer, row *Enrolled) (*Enrolled, error)
- type EnrolledFilterOptions
- type Event
- func CreateEvent(db Queryer, row *Event) (*Event, error)
- func GetEvent(db Queryer, id string) (*Event, error)
- func GetEventByLesson(db Queryer, lessonID string, po *PageOptions, filters *EventFilterOptions) ([]*Event, error)
- func GetEventByStudy(db Queryer, studyID string, po *PageOptions, filters *EventFilterOptions) ([]*Event, error)
- func GetEventByUser(db Queryer, userID string, po *PageOptions, filters *EventFilterOptions) ([]*Event, error)
- func GetEventByUserAsset(db Queryer, assetID string, po *PageOptions, filters *EventFilterOptions) ([]*Event, error)
- func GetReceivedEventByUser(db Queryer, userID string, po *PageOptions, filters *EventFilterOptions) ([]*Event, error)
- func NewActivityEvent(payload *ActivityEventPayload, studyID, userID *mytype.OID, public bool) (*Event, error)
- func NewCourseEvent(payload *CourseEventPayload, studyID, userID *mytype.OID, public bool) (*Event, error)
- func NewLessonEvent(payload *LessonEventPayload, studyID, userID *mytype.OID, public bool) (*Event, error)
- func NewStudyEvent(payload *StudyEventPayload, studyID, userID *mytype.OID, public bool) (*Event, error)
- func NewUserAssetEvent(payload *UserAssetEventPayload, studyID, userID *mytype.OID, public bool) (*Event, error)
- type EventFilterOptions
- type EventTypeFilter
- type FilterOptions
- type Label
- func CreateLabel(db Queryer, row *Label) (*Label, error)
- func GetLabel(db Queryer, id string) (*Label, error)
- func GetLabelByLabelable(db Queryer, labelableID string, po *PageOptions, filters *LabelFilterOptions) ([]*Label, error)
- func GetLabelByName(db Queryer, studyID, name string) (*Label, error)
- func GetLabelByStudy(db Queryer, studyID string, po *PageOptions, filters *LabelFilterOptions) ([]*Label, error)
- func SearchLabel(db Queryer, po *PageOptions, filters *LabelFilterOptions) ([]*Label, error)
- func UpdateLabel(db Queryer, row *Label) (*Label, error)
- type LabelFilterOptions
- type Labeled
- func CreateLabeled(db Queryer, row Labeled) (*Labeled, error)
- func GetLabeled(db Queryer, id int32) (*Labeled, error)
- func GetLabeledByLabel(db Queryer, labelID string, po *PageOptions) ([]*Labeled, error)
- func GetLabeledByLabelable(db Queryer, labelableID string, po *PageOptions) ([]*Labeled, error)
- func GetLabeledByLabelableAndLabel(db Queryer, labelableID, labelID string) (*Labeled, error)
- type Lesson
- func BatchGetLessonByNumber(db Queryer, studyID string, numbers []int32) ([]*Lesson, error)
- func CreateLesson(db Queryer, row *Lesson) (*Lesson, error)
- func GetLesson(db Queryer, id string) (*Lesson, error)
- func GetLessonByCourse(db Queryer, courseID string, po *PageOptions, filters *LessonFilterOptions) ([]*Lesson, error)
- func GetLessonByCourseNumber(db Queryer, courseID string, courseNumber int32) (*Lesson, error)
- func GetLessonByEnrollee(db Queryer, enrolleeID string, po *PageOptions, filters *LessonFilterOptions) ([]*Lesson, error)
- func GetLessonByLabel(db Queryer, labelID string, po *PageOptions, filters *LessonFilterOptions) ([]*Lesson, error)
- func GetLessonByNumber(db Queryer, studyID string, number int32) (*Lesson, error)
- func GetLessonByOwnerStudyAndNumber(db Queryer, ownerLogin, studyName string, number int32) (*Lesson, error)
- func GetLessonByStudy(db Queryer, studyID string, po *PageOptions, filters *LessonFilterOptions) ([]*Lesson, error)
- func GetLessonByUser(db Queryer, userID string, po *PageOptions, filters *LessonFilterOptions) ([]*Lesson, error)
- func SearchLesson(db Queryer, po *PageOptions, filters *LessonFilterOptions) ([]*Lesson, error)
- func UpdateLesson(db Queryer, row *Lesson) (*Lesson, error)
- type LessonDraftBackup
- type LessonEventPayload
- func NewLessonAddedToCoursePayload(lessonID, courseID *mytype.OID) (*LessonEventPayload, error)
- func NewLessonCommentedPayload(lessonID, commentID *mytype.OID) (*LessonEventPayload, error)
- func NewLessonCreatedPayload(lessonID *mytype.OID) (*LessonEventPayload, error)
- func NewLessonLabeledPayload(lessonID, labelID *mytype.OID) (*LessonEventPayload, error)
- func NewLessonMentionedPayload(lessonID *mytype.OID) (*LessonEventPayload, error)
- func NewLessonPublishedPayload(lessonID *mytype.OID) (*LessonEventPayload, error)
- func NewLessonReferencedPayload(lessonID, sourceID *mytype.OID) (*LessonEventPayload, error)
- func NewLessonRemovedFromCoursePayload(lessonID, courseID *mytype.OID) (*LessonEventPayload, error)
- func NewLessonRenamedPayload(lessonID *mytype.OID, from, to string) (*LessonEventPayload, error)
- func NewLessonUnlabeledPayload(lessonID, labelID *mytype.OID) (*LessonEventPayload, error)
- type LessonFilterOptions
- type Notification
- func CreateNotification(db Queryer, row *Notification) (*Notification, error)
- func GetNotification(db Queryer, id string) (*Notification, error)
- func GetNotificationByStudy(db Queryer, studyID string, po *PageOptions) ([]*Notification, error)
- func GetNotificationByUser(db Queryer, userID string, po *PageOptions) ([]*Notification, error)
- type Order
- type OrderDirection
- type PRT
- type PSQLError
- type PageOptions
- type PermissableField
- type PermissableFields
- type Permission
- type QueryPermission
- type Queryer
- type RenamePayload
- type Role
- type SQLParts
- type Study
- func CreateStudy(db Queryer, row *Study) (*Study, error)
- func GetStudy(db Queryer, id string) (*Study, error)
- func GetStudyByApplee(db Queryer, appleeID string, po *PageOptions, filters *StudyFilterOptions) ([]*Study, error)
- func GetStudyByEnrollee(db Queryer, enrolleeID string, po *PageOptions, filters *StudyFilterOptions) ([]*Study, error)
- func GetStudyByName(db Queryer, userID, name string) (*Study, error)
- func GetStudyByTopic(db Queryer, topicID string, po *PageOptions, filters *StudyFilterOptions) ([]*Study, error)
- func GetStudyByUser(db Queryer, userID string, po *PageOptions, filters *StudyFilterOptions) ([]*Study, error)
- func GetStudyByUserAndName(db Queryer, owner, name string) (*Study, error)
- func SearchStudy(db Queryer, po *PageOptions, filters *StudyFilterOptions) ([]*Study, error)
- func UpdateStudy(db Queryer, row *Study) (*Study, error)
- type StudyEventPayload
- type StudyFilterOptions
- type Topic
- func CreateTopic(db Queryer, row *Topic) (*Topic, error)
- func GetTopic(db Queryer, id string) (*Topic, error)
- func GetTopicByName(db Queryer, name string) (*Topic, error)
- func GetTopicByTopicable(db Queryer, topicableID string, po *PageOptions, filters *TopicFilterOptions) ([]*Topic, error)
- func SearchTopic(db Queryer, po *PageOptions, filters *TopicFilterOptions) ([]*Topic, error)
- func UpdateTopic(db Queryer, row *Topic) (*Topic, error)
- type TopicFilterOptions
- type Topiced
- func CreateTopiced(db Queryer, row Topiced) (*Topiced, error)
- func GetTopiced(db Queryer, id int32) (*Topiced, error)
- func GetTopicedByTopic(db Queryer, topicID string, po *PageOptions) ([]*Topiced, error)
- func GetTopicedByTopicable(db Queryer, topicableID string, po *PageOptions) ([]*Topiced, error)
- func GetTopicedByTopicableAndTopic(db Queryer, topicableID, topicID string) (*Topiced, error)
- type User
- func BatchGetUser(db Queryer, ids []string) ([]*User, error)
- func BatchGetUserByLogin(db Queryer, logins []string) ([]*User, error)
- func CreateUser(db Queryer, row *User) (*User, error)
- func GetUser(db Queryer, id string) (*User, error)
- func GetUserByAppleable(db Queryer, appleableID string, po *PageOptions, filters *UserFilterOptions) ([]*User, error)
- func GetUserByEnrollable(db Queryer, enrollableID string, po *PageOptions, filters *UserFilterOptions) ([]*User, error)
- func GetUserByEnrollee(db Queryer, enrolleeID string, po *PageOptions, filters *UserFilterOptions) ([]*User, error)
- func GetUserByLogin(db Queryer, login string) (*User, error)
- func GetUserCredentials(db Queryer, id string) (*User, error)
- func GetUserCredentialsByEmail(db Queryer, email string) (*User, error)
- func GetUserCredentialsByLogin(db Queryer, login string) (*User, error)
- func SearchUser(db Queryer, po *PageOptions, filters *UserFilterOptions) ([]*User, error)
- func UpdateUserAccount(db Queryer, row *User) (*User, error)
- func UpdateUserProfile(db Queryer, row *User) (*User, error)
- type UserAsset
- func BatchGetUserAsset(db Queryer, ids []string) ([]*UserAsset, error)
- func BatchGetUserAssetByName(db Queryer, studyID string, names []string) ([]*UserAsset, error)
- func CreateUserAsset(db Queryer, row *UserAsset) (*UserAsset, error)
- func GetUserAsset(db Queryer, id string) (*UserAsset, error)
- func GetUserAssetByActivity(db Queryer, activityID string, po *PageOptions, ...) ([]*UserAsset, error)
- func GetUserAssetByActivityNumber(db Queryer, activityID string, activityNumber int32) (*UserAsset, error)
- func GetUserAssetByLabel(db Queryer, labelID string, po *PageOptions, filters *UserAssetFilterOptions) ([]*UserAsset, error)
- func GetUserAssetByName(db Queryer, studyID, name string) (*UserAsset, error)
- func GetUserAssetByStudy(db Queryer, studyID string, po *PageOptions, filters *UserAssetFilterOptions) ([]*UserAsset, error)
- func GetUserAssetByUser(db Queryer, userID string, po *PageOptions, filters *UserAssetFilterOptions) ([]*UserAsset, error)
- func GetUserAssetByUserStudyAndName(db Queryer, owner, study, name string) (*UserAsset, error)
- func NewUserAsset(userID, studyID *mytype.OID, assetID int64, name string) (*UserAsset, error)
- func SearchUserAsset(db Queryer, po *PageOptions, filters *UserAssetFilterOptions) ([]*UserAsset, error)
- func UpdateUserAsset(db Queryer, row *UserAsset) (*UserAsset, error)
- type UserAssetEventPayload
- func NewUserAssetAddedToActivityPayload(assetID, activityID *mytype.OID) (*UserAssetEventPayload, error)
- func NewUserAssetCommentedPayload(assetID, commentID *mytype.OID) (*UserAssetEventPayload, error)
- func NewUserAssetCreatedPayload(assetID *mytype.OID) (*UserAssetEventPayload, error)
- func NewUserAssetLabeledPayload(assetID, labelID *mytype.OID) (*UserAssetEventPayload, error)
- func NewUserAssetMentionedPayload(assetID *mytype.OID) (*UserAssetEventPayload, error)
- func NewUserAssetReferencedPayload(assetID, sourceID *mytype.OID) (*UserAssetEventPayload, error)
- func NewUserAssetRemovedFromActivityPayload(assetID, activityID *mytype.OID) (*UserAssetEventPayload, error)
- func NewUserAssetRenamedPayload(assetID *mytype.OID, from, to string) (*UserAssetEventPayload, error)
- func NewUserAssetUnlabeledPayload(assetID, labelID *mytype.OID) (*UserAssetEventPayload, error)
- type UserAssetFilterOptions
- type UserFilterOptions
- type WhereFrom
Constants ¶
const ( ActivityEvent = "ActivityEvent" CourseEvent = "CourseEvent" LessonEvent = "LessonEvent" PublicEvent = "PublicEvent" UserAssetEvent = "UserAssetEvent" StudyEvent = "StudyEvent" )
const ( ActivityCreated = "created" CourseCreated = "created" CourseAppled = "appled" CourseUnappled = "unappled" CoursePublished = "published" LessonAddedToCourse = "added_to_course" LessonCreated = "created" LessonCommented = "commented" LessonLabeled = "labeled" LessonMentioned = "mentioned" LessonPublished = "published" LessonReferenced = "referenced" LessonRemovedFromCourse = "removed_from_course" LessonRenamed = "renamed" LessonUnlabeled = "unlabeled" StudyCreated = "created" StudyAppled = "appled" StudyUnappled = "unappled" UserAssetAddedToActivity = "added_to_activity" UserAssetCommented = "commented" UserAssetCreated = "created" UserAssetLabeled = "labeled" UserAssetMentioned = "mentioned" UserAssetReferenced = "referenced" UserAssetRemovedFromActivity = "removed_from_activity" UserAssetRenamed = "renamed" UserAssetUnlabeled = "unlabeled" )
const ( AuthorReason = "author" CommentReason = "comment" ManualReason = "manual" MentionReason = "mention" )
const ( AdminRole = "ADMIN" MemberRole = "MEMBER" OwnerRole = "OWNER" UserRole = "USER" )
Variables ¶
var ErrEmptyPageOptions = errors.New("`po` (*PageOptions) must not be nil")
var ErrNotFound = errors.New("not found")
Functions ¶
func BatchCreateNotification ¶
func BatchCreateNotification( db Queryer, src *Notification, enrolleds []*Enrolled, ) error
func CommitTransaction ¶
func ConnectRolePermissions ¶
func CountActivityByLesson ¶
func CountActivityByLesson( db Queryer, lessonID string, filters *ActivityFilterOptions, ) (int32, error)
func CountActivityBySearch ¶
func CountActivityBySearch( db Queryer, filters *ActivityFilterOptions, ) (int32, error)
func CountActivityByStudy ¶
func CountActivityByStudy( db Queryer, studyID string, filters *ActivityFilterOptions, ) (int32, error)
func CountActivityByUser ¶
func CountActivityByUser( db Queryer, userID string, filters *ActivityFilterOptions, ) (int32, error)
func CountAppledByAppleable ¶
func CountCommentByCommentable ¶
func CountCommentByCommentable( db Queryer, commentableID string, filters *CommentFilterOptions, ) (int32, error)
CountCommentByCommentable - count comments by commentable id
func CountCommentByLabel ¶
func CountCommentByLabel( db Queryer, labelID string, filters *CommentFilterOptions, ) (int32, error)
func CountCommentByStudy ¶
func CountCommentByStudy( db Queryer, studyID string, filters *CommentFilterOptions, ) (int32, error)
CountCommentByStudy - count comments by study id
func CountCommentByUser ¶
func CountCommentByUser( db Queryer, userID string, filters *CommentFilterOptions, ) (int32, error)
CountCommentByUser - count comments by user id
func CountCourseByApplee ¶
func CountCourseByApplee( db Queryer, appleeID string, filters *CourseFilterOptions, ) (int32, error)
func CountCourseBySearch ¶
func CountCourseBySearch( db Queryer, filters *CourseFilterOptions, ) (int32, error)
func CountCourseByStudy ¶
func CountCourseByStudy( db Queryer, studyID string, filters *CourseFilterOptions, ) (int32, error)
func CountCourseByTopic ¶
func CountCourseByTopic( db Queryer, topicID string, filters *CourseFilterOptions, ) (int32, error)
func CountCourseByUser ¶
func CountCourseByUser( db Queryer, userID string, filters *CourseFilterOptions, ) (int32, error)
func CountEmailByUser ¶
func CountEmailByUser( db Queryer, userID string, filters *EmailFilterOptions, ) (int32, error)
func CountEnrolledByEnrollable ¶
func CountEnrolledByEnrollable( db Queryer, enrollableID string, filters *EnrolledFilterOptions, ) (int32, error)
func CountEnrolledByUser ¶
func CountEnrolledByUser( db Queryer, userID string, filters *EnrolledFilterOptions, ) (int32, error)
func CountEventByLesson ¶
func CountEventByLesson( db Queryer, lessonID string, filters *EventFilterOptions, ) (int32, error)
func CountEventByStudy ¶
func CountEventByStudy( db Queryer, studyID string, filters *EventFilterOptions, ) (int32, error)
func CountEventByUser ¶
func CountEventByUser( db Queryer, userID string, filters *EventFilterOptions, ) (int32, error)
func CountEventByUserAsset ¶
func CountEventByUserAsset( db Queryer, assetID string, filters *EventFilterOptions, ) (int32, error)
func CountLabelByLabelable ¶
func CountLabelByLabelable( db Queryer, labelableID string, filters *LabelFilterOptions, ) (int32, error)
func CountLabelBySearch ¶
func CountLabelBySearch( db Queryer, filters *LabelFilterOptions, ) (int32, error)
func CountLabelByStudy ¶
func CountLabelByStudy( db Queryer, studyID string, filters *LabelFilterOptions, ) (int32, error)
func CountLabeledByLabelable ¶
func CountLessonByCourse ¶
func CountLessonByCourse( db Queryer, courseID string, filters *LessonFilterOptions, ) (int32, error)
func CountLessonByEnrollee ¶
func CountLessonByEnrollee( db Queryer, enrolleeID string, filters *LessonFilterOptions, ) (int32, error)
func CountLessonByLabel ¶
func CountLessonByLabel( db Queryer, labelID string, filters *LessonFilterOptions, ) (int32, error)
func CountLessonBySearch ¶
func CountLessonBySearch( db Queryer, filters *LessonFilterOptions, ) (int32, error)
func CountLessonByStudy ¶
func CountLessonByStudy( db Queryer, studyID string, filters *LessonFilterOptions, ) (int32, error)
func CountLessonByUser ¶
func CountLessonByUser( db Queryer, userID string, filters *LessonFilterOptions, ) (int32, error)
func CountNotificationByUser ¶
func CountPermissionByType ¶
func CountReceivedEventByUser ¶
func CountReceivedEventByUser( db Queryer, userID string, filters *EventFilterOptions, ) (int32, error)
func CountStudyByApplee ¶
func CountStudyByApplee( db Queryer, appleeID string, filters *StudyFilterOptions, ) (int32, error)
func CountStudyByEnrollee ¶
func CountStudyByEnrollee( db Queryer, enrolleeID string, filters *StudyFilterOptions, ) (int32, error)
func CountStudyBySearch ¶
func CountStudyBySearch( db Queryer, filters *StudyFilterOptions, ) (int32, error)
func CountStudyByTopic ¶
func CountStudyByTopic( db Queryer, topicID string, filters *StudyFilterOptions, ) (int32, error)
func CountStudyByUser ¶
func CountStudyByUser( db Queryer, userID string, filters *StudyFilterOptions, ) (int32, error)
func CountTopicBySearch ¶
func CountTopicBySearch( db Queryer, filters *TopicFilterOptions, ) (int32, error)
func CountTopicByTopicable ¶
func CountTopicByTopicable( db Queryer, topicableID string, filters *TopicFilterOptions, ) (int32, error)
func CountTopicedByTopicable ¶
func CountUserAssetByActivity ¶
func CountUserAssetByActivity( db Queryer, activityID string, filters *UserAssetFilterOptions, ) (int32, error)
func CountUserAssetByLabel ¶
func CountUserAssetByLabel( db Queryer, labelID string, filters *UserAssetFilterOptions, ) (int32, error)
func CountUserAssetBySearch ¶
func CountUserAssetBySearch( db Queryer, filters *UserAssetFilterOptions, ) (int32, error)
func CountUserAssetByStudy ¶
func CountUserAssetByStudy( db Queryer, studyID string, filters *UserAssetFilterOptions, ) (int32, error)
func CountUserAssetByUser ¶
func CountUserAssetByUser( db Queryer, userID string, filters *UserAssetFilterOptions, ) (int32, error)
func CountUserByAppleable ¶
func CountUserByAppleable( db Queryer, appleableID string, filters *UserFilterOptions, ) (int32, error)
func CountUserByEnrollable ¶
func CountUserByEnrollable( db Queryer, enrollableID string, filters *UserFilterOptions, ) (int32, error)
func CountUserByEnrollee ¶
func CountUserByEnrollee( db Queryer, enrolleeID string, filters *UserFilterOptions, ) (int32, error)
func CountUserBySearch ¶
func CountUserBySearch( db Queryer, filters *UserFilterOptions, ) (int32, error)
func CreatePermissionSuite ¶
Creates a suite of permissions for the passed model.
- permissions for Create/Read/Update access for each field in model.
- permissions for Connect/Disconnect/Delete.
Defaults audience to "AUTHENTICATED"
func DecodeCursor ¶
func DeleteActivity ¶
func DeleteActivityAsset ¶
func DeleteAppled ¶
func DeleteAsset ¶
func DeleteComment ¶
DeleteComment - delete comment with passed id
func DeleteCourse ¶
func DeleteCourseLesson ¶
func DeleteEmail ¶
func DeleteEnrolled ¶
func DeleteEvent ¶
func DeleteLabel ¶
func DeleteLabeled ¶
func DeleteLesson ¶
func DeleteNotification ¶
func DeletePermissionSuite ¶
func DeleteStudy ¶
func DeleteTopiced ¶
func DeleteUser ¶
func DeleteUserAsset ¶
func EncodeCursor ¶
func ExistsLessonByNumber ¶
func GetNamesByTopicable ¶
func Initialize ¶
func ParseConstraintName ¶
func ReorderQuery ¶
func ReorderQuery(po *PageOptions, query string) string
Then, we can reorder the items to the originally requested direction.
func RollbackTransaction ¶
func SQL3 ¶
func SQL3( selects []string, from string, where WhereFrom, filters FilterOptions, args *pgx.QueryArgs, po *PageOptions, ) string
func SearchSQL2 ¶
func ToLikeAnyPatternQuery ¶
func ToPrefixTsQuery ¶
func ToSubQuery ¶
Types ¶
type Activity ¶
type Activity struct { AdvancedAt pgtype.Timestamptz `db:"advanced_at" permit:"read"` CreatedAt pgtype.Timestamptz `db:"created_at" permit:"read"` Description pgtype.Text `db:"description" permit:"create/read/update"` ID mytype.OID `db:"id" permit:"read"` LessonID mytype.OID `db:"lesson_id" permit:"create/read/update"` Name pgtype.Text `db:"name" permit:"create/read"` Number pgtype.Int4 `db:"number" permit:"read/update"` StudyID mytype.OID `db:"study_id" permit:"create/read"` UpdatedAt pgtype.Timestamptz `db:"updated_at" permit:"read"` UserID mytype.OID `db:"user_id" permit:"create/read"` }
func GetActivityByLesson ¶
func GetActivityByLesson( db Queryer, lessonID string, po *PageOptions, filters *ActivityFilterOptions, ) ([]*Activity, error)
func GetActivityByName ¶
func GetActivityByNumber ¶
func GetActivityByStudy ¶
func GetActivityByStudy( db Queryer, studyID string, po *PageOptions, filters *ActivityFilterOptions, ) ([]*Activity, error)
func GetActivityByUser ¶
func GetActivityByUser( db Queryer, userID string, po *PageOptions, filters *ActivityFilterOptions, ) ([]*Activity, error)
func SearchActivity ¶
func SearchActivity( db Queryer, po *PageOptions, filters *ActivityFilterOptions, ) ([]*Activity, error)
type ActivityAsset ¶
type ActivityAsset struct { ActivityID mytype.OID `db:"activity_id" permit:"read"` AssetID mytype.OID `db:"asset_id" permit:"read"` CreatedAt pgtype.Timestamptz `db:"created_at" permit:"read"` Number pgtype.Int4 `db:"number" permit:"read/update"` }
func CreateActivityAsset ¶
func CreateActivityAsset( db Queryer, row ActivityAsset, ) (*ActivityAsset, error)
func GetActivityAsset ¶
func GetActivityAsset( db Queryer, assetID string, ) (*ActivityAsset, error)
func GetActivityAssetByActivity ¶
func GetActivityAssetByActivity( db Queryer, activityID string, po *PageOptions, ) ([]*ActivityAsset, error)
func GetActivityAssetByActivityAndNumber ¶
func GetActivityAssetByActivityAndNumber( db Queryer, activityID string, number int32, ) (*ActivityAsset, error)
func MoveActivityAsset ¶
func MoveActivityAsset( db Queryer, activityID, assetID, afterAssetID string, ) (*ActivityAsset, error)
type ActivityEventPayload ¶
type ActivityEventPayload struct { Action string `json:"action,omitempty"` ActivityID mytype.OID `json:"activity_id,omitempty"` }
func NewActivityCreatedPayload ¶
func NewActivityCreatedPayload(activityID *mytype.OID) (*ActivityEventPayload, error)
type ActivityFilterOptions ¶
type ActivityFilterOptions struct {
Search *string
}
type Appled ¶
type Appled struct { AppleableID mytype.OID `db:"appleable_id" permit:"read"` CreatedAt pgtype.Timestamptz `db:"created_at" permit:"read"` ID pgtype.Int4 `db:"id" permit:"read"` Type pgtype.Text `db:"type" permit:"read"` UserID mytype.OID `db:"user_id" permit:"read"` }
func GetAppledByAppleable ¶
func GetAppledByAppleable( db Queryer, appleableID string, po *PageOptions, ) ([]*Appled, error)
func GetAppledByUser ¶
func GetAppledByUser( db Queryer, userID string, po *PageOptions, ) ([]*Appled, error)
type Asset ¶
type Asset struct { CreatedAt pgtype.Timestamptz `db:"created_at" permit:"read"` ID pgtype.Int8 `db:"id" permit:"read"` Key pgtype.Text `db:"key" permit:"read"` Name pgtype.Text `db:"name" permit:"create/read/update"` Size pgtype.Int8 `db:"size" permit:"create/read"` Subtype pgtype.Text `db:"subtype" permit:"create/read"` Type pgtype.Text `db:"type" permit:"create/read"` UserID mytype.OID `db:"user_id" permit:"create/read"` }
type Comment ¶
type Comment struct { Body mytype.Markdown `db:"body" permit:"create/read/update"` CommentableID mytype.OID `db:"commentable_id" permit:"create/read"` CreatedAt pgtype.Timestamptz `db:"created_at" permit:"read"` Draft pgtype.Text `db:"draft" permit:"read/update"` ID mytype.OID `db:"id" permit:"read"` LabeledAt pgtype.Timestamptz `db:"labeled_at" permit:"read"` LastEditedAt pgtype.Timestamptz `db:"last_edited_at" permit:"read"` PublishedAt pgtype.Timestamptz `db:"published_at" permit:"read/update"` StudyID mytype.OID `db:"study_id" permit:"create/read"` Type pgtype.Text `db:"type" permit:"create/read"` UpdatedAt pgtype.Timestamptz `db:"updated_at" permit:"read"` UserID mytype.OID `db:"user_id" permit:"create/read"` }
Comment - data type comment
func BatchGetComment ¶
BatchGetComment - get all comments ids included in the ids param
func CreateComment ¶
CreateComment - create a comment
func GetComment ¶
GetComment - get comment by id
func GetCommentByCommentable ¶
func GetCommentByCommentable( db Queryer, commentableID string, po *PageOptions, filters *CommentFilterOptions, ) ([]*Comment, error)
GetCommentByCommentable - get comments by commentable id
func GetCommentByLabel ¶
func GetCommentByLabel( db Queryer, labelID string, po *PageOptions, filters *CommentFilterOptions, ) ([]*Comment, error)
func GetCommentByStudy ¶
func GetCommentByStudy( db Queryer, studyID string, po *PageOptions, filters *CommentFilterOptions, ) ([]*Comment, error)
GetCommentByStudy - get comments by study id
func GetCommentByUser ¶
func GetCommentByUser( db Queryer, userID string, po *PageOptions, filters *CommentFilterOptions, ) ([]*Comment, error)
GetCommentByUser - get comments by user id
func GetUserNewComment ¶
GetUserNewComment - get user's current comment draft
type CommentDraftBackup ¶
type CommentDraftBackup struct { CommentID mytype.OID `db:"comment_id" permit:"read"` CreatedAt pgtype.Timestamptz `db:"created_at" permit:"read"` Draft pgtype.Text `db:"draft" permit:"read"` ID pgtype.Int4 `db:"id" permit:"read"` UpdatedAt pgtype.Timestamptz `db:"updated_at" permit:"read"` }
func GetCommentDraftBackup ¶
func GetCommentDraftBackup( db Queryer, commentID string, id int32, ) (*CommentDraftBackup, error)
func GetCommentDraftBackupByComment ¶
func GetCommentDraftBackupByComment( db Queryer, commentID string, ) ([]*CommentDraftBackup, error)
type CommentFilterOptions ¶
type Course ¶
type Course struct { AdvancedAt pgtype.Timestamptz `db:"advanced_at" permit:"read"` CompletedAt pgtype.Timestamptz `db:"completed_at" permit:"read"` AppledAt pgtype.Timestamptz `db:"appled_at"` CreatedAt pgtype.Timestamptz `db:"created_at" permit:"read"` Description pgtype.Text `db:"description" permit:"create/read/update"` ID mytype.OID `db:"id" permit:"read"` Name pgtype.Text `db:"name" permit:"create/read"` Number pgtype.Int4 `db:"number" permit:"read/update"` PublishedAt pgtype.Timestamptz `db:"published_at" permit:"read/update"` Status mytype.CourseStatus `db:"status" permit:"read/update"` StudyID mytype.OID `db:"study_id" permit:"create/read"` TopicedAt pgtype.Timestamptz `db:"topiced_at"` UpdatedAt pgtype.Timestamptz `db:"updated_at" permit:"read"` UserID mytype.OID `db:"user_id" permit:"create/read"` }
func GetCourseByApplee ¶
func GetCourseByApplee( db Queryer, appleeID string, po *PageOptions, filters *CourseFilterOptions, ) ([]*Course, error)
func GetCourseByNumber ¶
func GetCourseByStudy ¶
func GetCourseByStudy( db Queryer, studyID string, po *PageOptions, filters *CourseFilterOptions, ) ([]*Course, error)
func GetCourseByStudyAndName ¶
func GetCourseByTopic ¶
func GetCourseByTopic( db Queryer, topicID string, po *PageOptions, filters *CourseFilterOptions, ) ([]*Course, error)
func GetCourseByUser ¶
func GetCourseByUser( db Queryer, userID string, po *PageOptions, filters *CourseFilterOptions, ) ([]*Course, error)
func SearchCourse ¶
func SearchCourse( db Queryer, po *PageOptions, filters *CourseFilterOptions, ) ([]*Course, error)
type CourseEventPayload ¶
type CourseEventPayload struct { Action string `json:"action,omitempty"` CourseID mytype.OID `json:"course_id,omitempty"` }
func NewCourseAppledPayload ¶
func NewCourseAppledPayload(courseID *mytype.OID) (*CourseEventPayload, error)
func NewCourseCreatedPayload ¶
func NewCourseCreatedPayload(courseID *mytype.OID) (*CourseEventPayload, error)
func NewCoursePublishedPayload ¶
func NewCoursePublishedPayload(courseID *mytype.OID) (*CourseEventPayload, error)
func NewCourseUnappledPayload ¶
func NewCourseUnappledPayload(courseID *mytype.OID) (*CourseEventPayload, error)
type CourseFilterOptions ¶
type CourseLesson ¶
type CourseLesson struct { CreatedAt pgtype.Timestamptz `db:"created_at" permit:"read"` CourseID mytype.OID `db:"course_id" permit:"read"` LessonID mytype.OID `db:"lesson_id" permit:"read"` Number pgtype.Int4 `db:"number" permit:"read/update"` }
func CreateCourseLesson ¶
func CreateCourseLesson( db Queryer, row CourseLesson, ) (*CourseLesson, error)
func GetCourseLesson ¶
func GetCourseLesson( db Queryer, lessonID string, ) (*CourseLesson, error)
func GetCourseLessonByCourse ¶
func GetCourseLessonByCourse( db Queryer, courseID string, po *PageOptions, ) ([]*CourseLesson, error)
func GetCourseLessonByCourseAndNumber ¶
func GetCourseLessonByCourseAndNumber( db Queryer, courseID string, number int32, ) (*CourseLesson, error)
func MoveCourseLesson ¶
func MoveCourseLesson( db Queryer, courseID, lessonID, afterLessonID string, ) (*CourseLesson, error)
type DataEndUserError ¶
Errors of this type may be seen by the end user.
func (DataEndUserError) Error ¶
func (e DataEndUserError) Error() string
type DataFieldError ¶
type DataFieldError struct { Code DataFieldErrorCode Field string }
func DuplicateFieldError ¶
func DuplicateFieldError(field string) DataFieldError
func RequiredFieldError ¶
func RequiredFieldError(field string) DataFieldError
func (DataFieldError) Error ¶
func (e DataFieldError) Error() string
type DataFieldErrorCode ¶
type DataFieldErrorCode int
const ( UnknownDataFieldErrorCode DataFieldErrorCode = iota DuplicateField RequiredField )
func (DataFieldErrorCode) String ¶
func (c DataFieldErrorCode) String() string
type EVT ¶
type EVT struct { EmailID mytype.OID `db:"email_id" permit:"create/read"` ExpiresAt pgtype.Timestamptz `db:"expires_at" permit:"read"` IssuedAt pgtype.Timestamptz `db:"issued_at" permit:"read"` Token pgtype.Varchar `db:"token" permit:"read"` UserID mytype.OID `db:"user_id" permit:"create/read"` VerifiedAt pgtype.Timestamptz `db:"verified_at" permit:"read/update"` }
type Email ¶
type Email struct { CreatedAt pgtype.Timestamptz `db:"created_at" permit:"read"` ID mytype.OID `db:"id" permit:"read"` Public pgtype.Bool `db:"public" permit:"read"` Type mytype.EmailType `db:"type" permit:"create/read/update"` UserID mytype.OID `db:"user_id" permit:"create/read"` UpdatedAt pgtype.Timestamptz `db:"updated_at" permit:"read"` Value pgtype.Varchar `db:"value" permit:"create/read"` VerifiedAt pgtype.Timestamptz `db:"verified_at" permit:"read/update"` }
func GetEmailByUser ¶
func GetEmailByUser( db Queryer, userID string, po *PageOptions, filters *EmailFilterOptions, ) ([]*Email, error)
type EmailFilterOptions ¶
type Enrolled ¶
type Enrolled struct { CreatedAt pgtype.Timestamptz `db:"created_at" permit:"read"` ID pgtype.Int4 `db:"id" permit:"read"` EnrollableID mytype.OID `db:"enrollable_id" permit:"read"` ReasonName pgtype.Varchar `db:"reason_name" permit:"read"` Status mytype.EnrollmentStatus `db:"status" permit:"read/update"` Type pgtype.Text `db:"type" permit:"read"` UserID mytype.OID `db:"user_id" permit:"read"` }
func GetEnrolledByEnrollable ¶
func GetEnrolledByEnrollable( db Queryer, enrollableID string, po *PageOptions, filters *EnrolledFilterOptions, ) ([]*Enrolled, error)
func GetEnrolledByUser ¶
func GetEnrolledByUser( db Queryer, userID string, po *PageOptions, filters *EnrolledFilterOptions, ) ([]*Enrolled, error)
type EnrolledFilterOptions ¶
type Event ¶
type Event struct { Action mytype.EventAction `db:"action" permit"read"` CreatedAt pgtype.Timestamptz `db:"created_at" permit:"read"` ID mytype.OID `db:"id" permit:"read"` Payload pgtype.JSONB `db:"payload" permit:"create/read"` Public pgtype.Bool `db:"public" permit:"create/read"` StudyID mytype.OID `db:"study_id" permit:"create/read"` Type pgtype.Text `db:"type" permit:"create/read"` UserID mytype.OID `db:"user_id" permit:"create/read"` }
func GetEventByLesson ¶
func GetEventByLesson( db Queryer, lessonID string, po *PageOptions, filters *EventFilterOptions, ) ([]*Event, error)
func GetEventByStudy ¶
func GetEventByStudy( db Queryer, studyID string, po *PageOptions, filters *EventFilterOptions, ) ([]*Event, error)
func GetEventByUser ¶
func GetEventByUser( db Queryer, userID string, po *PageOptions, filters *EventFilterOptions, ) ([]*Event, error)
func GetEventByUserAsset ¶
func GetEventByUserAsset( db Queryer, assetID string, po *PageOptions, filters *EventFilterOptions, ) ([]*Event, error)
func GetReceivedEventByUser ¶
func GetReceivedEventByUser( db Queryer, userID string, po *PageOptions, filters *EventFilterOptions, ) ([]*Event, error)
func NewActivityEvent ¶
func NewCourseEvent ¶
func NewLessonEvent ¶
func NewStudyEvent ¶
func NewUserAssetEvent ¶
type EventFilterOptions ¶
type EventFilterOptions struct { IsPublic *bool Types *[]EventTypeFilter }
type EventTypeFilter ¶
type FilterOptions ¶
type Label ¶
type Label struct { Color mytype.Color `db:"color" permit:"create/read/update"` CreatedAt pgtype.Timestamptz `db:"created_at" permit:"read"` Description pgtype.Text `db:"description" permit:"create/read/update"` ID mytype.OID `db:"id" permit:"read"` IsDefault pgtype.Bool `db:"is_default" permit:"read"` LabelableID mytype.OID `db:"labelable_id"` LabeledAt pgtype.Timestamptz `db:"labeled_at"` Name mytype.WordsName `db:"name" permit:"create/read"` StudyID mytype.OID `db:"study_id" permit:"create/read"` UpdatedAt pgtype.Timestamptz `db:"updated_at" permit:"read"` }
func GetLabelByLabelable ¶
func GetLabelByLabelable( db Queryer, labelableID string, po *PageOptions, filters *LabelFilterOptions, ) ([]*Label, error)
func GetLabelByStudy ¶
func GetLabelByStudy( db Queryer, studyID string, po *PageOptions, filters *LabelFilterOptions, ) ([]*Label, error)
func SearchLabel ¶
func SearchLabel( db Queryer, po *PageOptions, filters *LabelFilterOptions, ) ([]*Label, error)
type LabelFilterOptions ¶
type Labeled ¶
type Labeled struct { CreatedAt pgtype.Timestamptz `db:"created_at" permit:"read"` ID pgtype.Int4 `db:"id" permit:"read"` LabelID mytype.OID `db:"label_id" permit:"read"` LabelableID mytype.OID `db:"labelable_id" permit:"read"` Type pgtype.Text `db:"type" permit:"read"` }
func GetLabeledByLabel ¶
func GetLabeledByLabel( db Queryer, labelID string, po *PageOptions, ) ([]*Labeled, error)
func GetLabeledByLabelable ¶
func GetLabeledByLabelable( db Queryer, labelableID string, po *PageOptions, ) ([]*Labeled, error)
type Lesson ¶
type Lesson struct { Body mytype.Markdown `db:"body" permit:"create/read/update"` CourseID mytype.OID `db:"course_id" permit:"read"` CourseNumber pgtype.Int4 `db:"course_number" permit:"read"` CreatedAt pgtype.Timestamptz `db:"created_at" permit:"read"` Draft pgtype.Text `db:"draft" permit:"read/update"` EnrolledAt pgtype.Timestamptz `db:"enrolled_at"` ID mytype.OID `db:"id" permit:"read"` LabeledAt pgtype.Timestamptz `db:"labeled_at"` LastEditedAt pgtype.Timestamptz `db:"last_edited_at" permit:"read"` Number pgtype.Int4 `db:"number" permit:"read"` PublishedAt pgtype.Timestamptz `db:"published_at" permit:"read/update"` StudyID mytype.OID `db:"study_id" permit:"create/read"` Title pgtype.Text `db:"title" permit:"create/read/update"` UpdatedAt pgtype.Timestamptz `db:"updated_at" permit:"read"` UserID mytype.OID `db:"user_id" permit:"create/read"` }
func BatchGetLessonByNumber ¶
func GetLessonByCourse ¶
func GetLessonByCourse( db Queryer, courseID string, po *PageOptions, filters *LessonFilterOptions, ) ([]*Lesson, error)
func GetLessonByCourseNumber ¶
func GetLessonByEnrollee ¶
func GetLessonByEnrollee( db Queryer, enrolleeID string, po *PageOptions, filters *LessonFilterOptions, ) ([]*Lesson, error)
func GetLessonByLabel ¶
func GetLessonByLabel( db Queryer, labelID string, po *PageOptions, filters *LessonFilterOptions, ) ([]*Lesson, error)
func GetLessonByNumber ¶
func GetLessonByStudy ¶
func GetLessonByStudy( db Queryer, studyID string, po *PageOptions, filters *LessonFilterOptions, ) ([]*Lesson, error)
func GetLessonByUser ¶
func GetLessonByUser( db Queryer, userID string, po *PageOptions, filters *LessonFilterOptions, ) ([]*Lesson, error)
func SearchLesson ¶
func SearchLesson( db Queryer, po *PageOptions, filters *LessonFilterOptions, ) ([]*Lesson, error)
type LessonDraftBackup ¶
type LessonDraftBackup struct { CreatedAt pgtype.Timestamptz `db:"created_at" permit:"read"` Draft pgtype.Text `db:"draft" permit:"read"` ID pgtype.Int4 `db:"id" permit:"read"` LessonID mytype.OID `db:"lesson_id" permit:"read"` UpdatedAt pgtype.Timestamptz `db:"updated_at" permit:"read"` }
func GetLessonDraftBackup ¶
func GetLessonDraftBackup( db Queryer, lessonID string, id int32, ) (*LessonDraftBackup, error)
func GetLessonDraftBackupByLesson ¶
func GetLessonDraftBackupByLesson( db Queryer, lessonID string, ) ([]*LessonDraftBackup, error)
type LessonEventPayload ¶
type LessonEventPayload struct { Action string `json:"action,omitempty"` CommentID mytype.OID `json:"comment_id,omitempty"` CourseID mytype.OID `json:"course_id,omitempty"` LabelID mytype.OID `json:"label_id,omitempty"` LessonID mytype.OID `json:"lesson_id,omitempty"` Rename RenamePayload `json:"rename,omitempty"` SourceID mytype.OID `json:"source_id,omitempty"` }
func NewLessonAddedToCoursePayload ¶
func NewLessonAddedToCoursePayload(lessonID, courseID *mytype.OID) (*LessonEventPayload, error)
func NewLessonCommentedPayload ¶
func NewLessonCommentedPayload(lessonID, commentID *mytype.OID) (*LessonEventPayload, error)
func NewLessonCreatedPayload ¶
func NewLessonCreatedPayload(lessonID *mytype.OID) (*LessonEventPayload, error)
func NewLessonLabeledPayload ¶
func NewLessonLabeledPayload(lessonID, labelID *mytype.OID) (*LessonEventPayload, error)
func NewLessonMentionedPayload ¶
func NewLessonMentionedPayload(lessonID *mytype.OID) (*LessonEventPayload, error)
func NewLessonPublishedPayload ¶
func NewLessonPublishedPayload(lessonID *mytype.OID) (*LessonEventPayload, error)
func NewLessonReferencedPayload ¶
func NewLessonReferencedPayload(lessonID, sourceID *mytype.OID) (*LessonEventPayload, error)
func NewLessonRemovedFromCoursePayload ¶
func NewLessonRemovedFromCoursePayload(lessonID, courseID *mytype.OID) (*LessonEventPayload, error)
func NewLessonRenamedPayload ¶
func NewLessonRenamedPayload(lessonID *mytype.OID, from, to string) (*LessonEventPayload, error)
func NewLessonUnlabeledPayload ¶
func NewLessonUnlabeledPayload(lessonID, labelID *mytype.OID) (*LessonEventPayload, error)
type LessonFilterOptions ¶
type Notification ¶
type Notification struct { CreatedAt pgtype.Timestamptz `db:"created_at" permit:"read"` ID mytype.OID `db:"id" permit:"read"` LastReadAt pgtype.Timestamptz `db:"last_read_at" permit:"read"` Reason pgtype.Text `db:"reason" permit:"read"` ReasonName pgtype.Varchar `db:"reason_name"` Subject pgtype.Text `db:"subject" permit:"read"` SubjectID mytype.OID `db:"subject_id" permit:"read"` StudyID mytype.OID `db:"study_id" permit:"read"` Unread pgtype.Bool `db:"unread" permit:"read"` UpdatedAt pgtype.Timestamptz `db:"updated_at" permit:"read"` UserID mytype.OID `db:"user_id" permit:"read"` }
func CreateNotification ¶
func CreateNotification( db Queryer, row *Notification, ) (*Notification, error)
func GetNotification ¶
func GetNotification( db Queryer, id string, ) (*Notification, error)
func GetNotificationByStudy ¶
func GetNotificationByStudy( db Queryer, studyID string, po *PageOptions, ) ([]*Notification, error)
func GetNotificationByUser ¶
func GetNotificationByUser( db Queryer, userID string, po *PageOptions, ) ([]*Notification, error)
type Order ¶
type Order interface { Direction() OrderDirection Field() string }
type OrderDirection ¶
type OrderDirection bool
const ( ASC OrderDirection = false DESC OrderDirection = true )
func ParseOrderDirection ¶
func ParseOrderDirection(s string) (OrderDirection, error)
func (OrderDirection) String ¶
func (od OrderDirection) String() string
type PRT ¶
type PRT struct { EmailID mytype.OID `db:"email_id" permit:"create/read"` EndedAt pgtype.Timestamptz `db:"ended_at" permit:"read/update"` EndIP pgtype.Inet `db:"end_ip" permit:"read/update"` ExpiresAt pgtype.Timestamptz `db:"expires_at" permit:"create/read"` IssuedAt pgtype.Timestamptz `db:"issued_at" permit:"create/read"` RequestIP pgtype.Inet `db:"request_ip" permit:"create/read"` UserID mytype.OID `db:"user_id" permit:"create/read"` Token pgtype.Varchar `db:"token" permit:"create/read"` }
type PSQLError ¶
type PSQLError string
const ( UnknownPSQLError = "?????" // Class 00 — Successful Completion SuccessfulCompletion PSQLError = "00000" // Class 01 — Warning Warning PSQLError = "01000" DynamicResultSetsReturned PSQLError = "0100C" ImplicitZeroBitPadding PSQLError = "01008" NullValueEliminatedInSetFunction PSQLError = "01003" PrivilegeNotGranted PSQLError = "01007" PrivilegeNotRevoked PSQLError = "01006" WarningStringDataRightTruncation PSQLError = "01004" DeprecatedFeature PSQLError = "01P01" // Class 02 — No Data (this is also a warning class per the SQL standard) NoData PSQLError = "02000" NoAdditionalDynamicResultSetsReturned PSQLError = "02001" // Class 03 — SQL Statement Not Yet Complete SqlStatementNotYetComplete PSQLError = "03000" // Class 08 — Connection Exception ConnectionException PSQLError = "08000" ConnectionDoesNotExist PSQLError = "08003" ConnectionFailure PSQLError = "08006" SqlclientUnableToEstablishSqlconnection PSQLError = "08001" SqlserverRejectedEstablishmentOfSqlconnection PSQLError = "08004" TransactionResolutionUnknown PSQLError = "08007" ProtocolViolation PSQLError = "08P01" // Class 09 — Triggered Action Exception TriggeredActionException PSQLError = "09000" // Class 0A — Feature Not Supported FeatureNotSupported PSQLError = "0A000" // Class 0B — Invalid Transaction Initiation InvalidTransactionInitiation PSQLError = "0B000" // Class 0F — Locator Exception LocatorException PSQLError = "0F000" InvalidLocatorSpecification PSQLError = "0F001" // Class 0L — Invalid Grantor InvalidGrantor PSQLError = "0L000" InvalidGrantOperation PSQLError = "0LP01" // Class 0P — Invalid Role Specification InvalidRoleSpecification PSQLError = "0P000" // Class 0Z — Diagnostics Exception DiagnosticsException PSQLError = "0Z000" StackedDiagnosticsAccessedWithoutActiveHandler PSQLError = "0Z002" // Class 20 — Case Not Found CaseNotFound PSQLError = "20000" // Class 21 — Cardinality Violation CardinalityViolation PSQLError = "21000" // Class 22 — Data Exception DataException PSQLError = "22000" ArraySubscriptError PSQLError = "2202E" CharacterNotInRepertoire PSQLError = "22021" DatetimeFieldOverflow PSQLError = "22008" DivisionByZero PSQLError = "22012" ErrorInAssignment PSQLError = "22005" EscapeCharacterConflict PSQLError = "2200B" IndicatorOverflow PSQLError = "22022" IntervalFieldOverflow PSQLError = "22015" InvalidArgumentForLogarithm PSQLError = "2201E" InvalidArgumentForNtileFunction PSQLError = "22014" InvalidArgumentForNthValueFunction PSQLError = "22016" InvalidArgumentForPowerFunction PSQLError = "2201F" InvalidArgumentForWidthBucketFunction PSQLError = "2201G" InvalidCharacterValueForCast PSQLError = "22018" InvalidDatetimeFormat PSQLError = "22007" InvalidEscapeCharacter PSQLError = "22019" InvalidEscapeOctet PSQLError = "2200D" InvalidEscapeSequence PSQLError = "22025" NonstandardUseOfEscapeCharacter PSQLError = "22P06" InvalidIndicatorParameterValue PSQLError = "22010" InvalidParameterValue PSQLError = "22023" InvalidRegularExpression PSQLError = "2201B" InvalidRowCountInLimitClause PSQLError = "2201W" InvalidRowCountInResultOffsetClause PSQLError = "2201X" InvalidTimeZoneDisplacementValue PSQLError = "22009" InvalidUseOfEscapeCharacter PSQLError = "2200C" MostSpecificTypeMismatch PSQLError = "2200G" NullValueNotAllowed PSQLError = "22004" NullValueNoIndicatorParameter PSQLError = "22002" NumericValueOutOfRange PSQLError = "22003" StringDataLengthMismatch PSQLError = "22026" StringDataRightTruncation PSQLError = "22001" SubstringError PSQLError = "22011" TrimError PSQLError = "22027" UnterminatedCString PSQLError = "22024" ZeroLengthCharacterString PSQLError = "2200F" FloatingPointException PSQLError = "22P01" InvalidTextRepresentation PSQLError = "22P02" InvalidBinaryRepresentation PSQLError = "22P03" BadCopyFileFormat PSQLError = "22P04" UntranslatableCharacter PSQLError = "22P05" NotAnXmlDocument PSQLError = "2200L" InvalidXmlDocument PSQLError = "2200M" InvalidXmlContent PSQLError = "2200N" InvalidXmlComment PSQLError = "2200S" InvalidXmlProcessingInstruction PSQLError = "2200T" // Class 23 — Integrity Constraint Violation IntegrityConstraintViolation PSQLError = "23000" RestrictViolation PSQLError = "23001" NotNullViolation PSQLError = "23502" ForeignKeyViolation PSQLError = "23503" UniqueViolation PSQLError = "23505" CheckViolation PSQLError = "23514" ExclusionViolation PSQLError = "23P01" // Class 24 — Invalid Cursor State InvalidCursorState PSQLError = "24000" // Class 25 — Invalid Transaction State InvalidTransactionState PSQLError = "25000" ActiveSqlTransaction PSQLError = "25001" BranchTransactionAlreadyActive PSQLError = "25002" HeldCursorRequiresSameIsolationLevel PSQLError = "25008" InappropriateAccessModeForBranchTransaction PSQLError = "25003" InappropriateIsolationLevelForBranchTransaction PSQLError = "25004" NoActiveSqlTransactionForBranchTransaction PSQLError = "25005" ReadOnlySqlTransaction PSQLError = "25006" SchemaAndDataStatementMixingNotSupported PSQLError = "25007" NoActiveSqlTransaction PSQLError = "25P01" InFailedSqlTransaction PSQLError = "25P02" // Class 26 — Invalid SQL Statement Name InvalidSqlStatementName PSQLError = "26000" // Class 27 — Triggered Data Change Violation TriggeredDataChangeViolation PSQLError = "27000" // Class 28 — Invalid Authorization Specification InvalidAuthorizationSpecification PSQLError = "28000" InvalidPassword PSQLError = "28P01" // Class 2B — Dependent Privilege Descriptors Still Exist DependentPrivilegeDescriptorsStillExist PSQLError = "2B000" DependentObjectsStillExist PSQLError = "2BP01" // Class 2D — Invalid Transaction Termination InvalidTransactionTermination PSQLError = "2D000" // Class 2F — SQL Routine Exception SqlRoutineException PSQLError = "2F000" FunctionExecutedNoReturnStatement PSQLError = "2F005" ModifyingSqlDataNotPermitted PSQLError = "2F002" ProhibitedSqlStatementAttempted PSQLError = "2F003" ReadingSqlDataNotPermitted PSQLError = "2F004" // Class 34 — Invalid Cursor Name InvalidCursorName PSQLError = "34000" // Class 38 — External Routine Exception ExternalRoutineException PSQLError = "38000" ContainingSqlNotPermitted PSQLError = "38001" EreModifyingSqlDataNotPermitted PSQLError = "38002" EreProhibitedSqlStatementAttempted PSQLError = "38003" EreReadingSqlDataNotPermitted PSQLError = "38004" // Class 39 — External Routine Invocation Exception ExternalRoutineInvocationException PSQLError = "39000" InvalidSqlstateReturned PSQLError = "39001" ErieNullValueNotAllowed PSQLError = "39004" TriggerProtocolViolated PSQLError = "39P01" SrfProtocolViolated PSQLError = "39P02" // Class 3B — Savepoint Exception SavepointException PSQLError = "3B000" InvalidSavepointSpecification PSQLError = "3B001" // Class 3D — Invalid Catalog Name InvalidCatalogName PSQLError = "3D000" // Class 3F — Invalid Schema Name InvalidSchemaName PSQLError = "3F000" // Class 40 — Transaction Rollback TransactionRollback PSQLError = "40000" TransactionIntegrityConstraintViolation PSQLError = "40002" SerializationFailure PSQLError = "40001" StatementCompletionUnknown PSQLError = "40003" DeadlockDetected PSQLError = "40P01" // Class 42 — Syntax Error or Access Rule Violation SyntaxErrorOrAccessRuleViolation PSQLError = "42000" SyntaxError PSQLError = "42601" InsufficientPrivilege PSQLError = "42501" CannotCoerce PSQLError = "42846" GroupingError PSQLError = "42803" WindowingError PSQLError = "42P20" InvalidRecursion PSQLError = "42P19" InvalidForeignKey PSQLError = "42830" InvalidName PSQLError = "42602" NameTooLong PSQLError = "42622" ReservedName PSQLError = "42939" DatatypeMismatch PSQLError = "42804" IndeterminateDatatype PSQLError = "42P18" CollationMismatch PSQLError = "42P21" IndeterminateCollation PSQLError = "42P22" WrongObjectType PSQLError = "42809" UndefinedColumn PSQLError = "42703" UndefinedFunction PSQLError = "42883" UndefinedTable PSQLError = "42P01" UndefinedParameter PSQLError = "42P02" UndefinedObject PSQLError = "42704" DuplicateColumn PSQLError = "42701" DuplicateCursor PSQLError = "42P03" DuplicateDatabase PSQLError = "42P04" DuplicateFunction PSQLError = "42723" DuplicatePreparedStatement PSQLError = "42P05" DuplicateSchema PSQLError = "42P06" DuplicateTable PSQLError = "42P07" DuplicateAlias PSQLError = "42712" DuplicateObject PSQLError = "42710" AmbiguousColumn PSQLError = "42702" AmbiguousFunction PSQLError = "42725" AmbiguousParameter PSQLError = "42P08" AmbiguousAlias PSQLError = "42P09" InvalidColumnReference PSQLError = "42P10" InvalidColumnDefinition PSQLError = "42611" InvalidCursorDefinition PSQLError = "42P11" InvalidDatabaseDefinition PSQLError = "42P12" InvalidFunctionDefinition PSQLError = "42P13" InvalidPreparedStatementDefinition PSQLError = "42P14" InvalidSchemaDefinition PSQLError = "42P15" InvalidTableDefinition PSQLError = "42P16" InvalidObjectDefinition PSQLError = "42P17" // Class 44 — WITH CHECK OPTION Violation WithCheckOptionViolation PSQLError = "44000" // Class 53 — Insufficient Resources InsufficientResources PSQLError = "53000" DiskFull PSQLError = "53100" OutOfMemory PSQLError = "53200" TooManyConnections PSQLError = "53300" ConfigurationLimitExceeded PSQLError = "53400" // Class 54 — Program Limit Exceeded ProgramLimitExceeded PSQLError = "54000" StatementTooComplex PSQLError = "54001" TooManyColumns PSQLError = "54011" TooManyArguments PSQLError = "54023" // Class 55 — Object Not In Prerequisite State ObjectNotInPrerequisiteState PSQLError = "55000" ObjectInUse PSQLError = "55006" CantChangeRuntimeParam PSQLError = "55P02" LockNotAvailable PSQLError = "55P03" // Class 57 — Operator Intervention OperatorIntervention PSQLError = "57000" QueryCanceled PSQLError = "57014" AdminShutdown PSQLError = "57P01" CrashShutdown PSQLError = "57P02" CannotConnectNow PSQLError = "57P03" DatabaseDropped PSQLError = "57P04" // Class 58 — System Error (errors external to PostgreSQL itself) SystemError PSQLError = "58000" IoError PSQLError = "58030" UndefinedFile PSQLError = "58P01" DuplicateFile PSQLError = "58P02" // Class F0 — Configuration File Error ConfigFileError PSQLError = "F0000" LockFileExists PSQLError = "F0001" // Class HV — Foreign Data Wrapper Error (SQL/MED) FdwError PSQLError = "HV000" FdwColumnNameNotFound PSQLError = "HV005" FdwDynamicParameterValueNeeded PSQLError = "HV002" FdwFunctionSequenceError PSQLError = "HV010" FdwInconsistentDescriptorInformation PSQLError = "HV021" FdwInvalidAttributeValue PSQLError = "HV024" FdwInvalidColumnName PSQLError = "HV007" FdwInvalidColumnNumber PSQLError = "HV008" FdwInvalidDataType PSQLError = "HV004" FdwInvalidDataTypeDescriptors PSQLError = "HV006" FdwInvalidDescriptorFieldIdentifier PSQLError = "HV091" FdwInvalidHandle PSQLError = "HV00B" FdwInvalidOptionIndex PSQLError = "HV00C" FdwInvalidOptionName PSQLError = "HV00D" FdwInvalidStringLengthOrBufferLength PSQLError = "HV090" FdwInvalidStringFormat PSQLError = "HV00A" FdwInvalidUseOfNullPointer PSQLError = "HV009" FdwTooManyHandles PSQLError = "HV014" FdwOutOfMemory PSQLError = "HV001" FdwNoSchemas PSQLError = "HV00P" FdwOptionNameNotFound PSQLError = "HV00J" FdwReplyHandle PSQLError = "HV00K" FdwSchemaNotFound PSQLError = "HV00Q" FdwTableNotFound PSQLError = "HV00R" FdwUnableToCreateExecution PSQLError = "HV00L" FdwUnableToCreateReply PSQLError = "HV00M" FdwUnableToEstablishConnection PSQLError = "HV00N" // Class P0 — PL/pgSQL Error PlpgsqlError PSQLError = "P0000" RaiseException PSQLError = "P0001" NoDataFound PSQLError = "P0002" TooManyRows PSQLError = "P0003" // Class XX — Internal Error InternalError PSQLError = "XX000" DataCorrupted PSQLError = "XX001" IndexCorrupted PSQLError = "XX002" )
func (PSQLError) MarshalJSON ¶
func (*PSQLError) UnmarshalJSON ¶
type PageOptions ¶
func NewPageOptions ¶
func NewPageOptions(after, before *string, first, last *int32, o Order) (*PageOptions, error)
func (*PageOptions) Limit ¶
func (p *PageOptions) Limit() int32
func (*PageOptions) QueryDirection ¶
func (p *PageOptions) QueryDirection() string
If the query is asking for the last elements in a list, then we need two queries to get the items more efficiently and in the right order. First, we query the reverse direction of that requested, so that only the items needed are returned.
type PermissableField ¶
type PermissableField struct { Name string // contains filtered or unexported fields }
func NewPermissableField ¶
func NewPermissableField(f *structs.Field) (*PermissableField, error)
func (*PermissableField) Can ¶
func (fp *PermissableField) Can(al mytype.AccessLevel) bool
type PermissableFields ¶
type PermissableFields []*PermissableField
func GetPermissableFields ¶
func GetPermissableFields(model interface{}) (PermissableFields, error)
func (PermissableFields) Filter ¶
func (fs PermissableFields) Filter(al mytype.AccessLevel) PermissableFields
func (PermissableFields) Names ¶
func (fs PermissableFields) Names() []string
type Permission ¶
type Permission struct { AccessLevel pgtype.Text `db:"access_level"` Audience pgtype.Text `db:"audience"` CreatedAt pgtype.Timestamptz `db:"created_at"` GrantedAt pgtype.Timestamptz `db:"granted_at"` ID mytype.OID `db:"id"` Field pgtype.Text `db:"field"` Type pgtype.Text `db:"type"` UpdatedAt pgtype.Timestamptz `db:"updated_at"` }
type QueryPermission ¶
type QueryPermission struct { Operation mytype.Operation Audience mytype.Audience Fields pgtype.TextArray }
func GetQueryPermission ¶
type Queryer ¶
type RenamePayload ¶
type Role ¶
type Role struct { CreatedAt pgtype.Timestamptz `db:"created_at"` Description pgtype.Text `db:"description"` GrantedAt pgtype.Timestamptz `db:"granted_at"` Name pgtype.Varchar `db:"name"` UserID mytype.OID `db:"user_id"` }
func GetRoleByUser ¶
func GetRoleByUser( db Queryer, userID string, po *PageOptions, ) ([]*Role, error)
type Study ¶
type Study struct { AdvancedAt pgtype.Timestamptz `db:"advanced_at" permit:"read"` AppledAt pgtype.Timestamptz `db:"appled_at"` CreatedAt pgtype.Timestamptz `db:"created_at" permit:"read"` Description pgtype.Text `db:"description" permit:"create/read/update"` EnrolledAt pgtype.Timestamptz `db:"enrolled_at"` ID mytype.OID `db:"id" permit:"read"` Name mytype.WordsName `db:"name" permit:"create/read"` Private pgtype.Bool `db:"private" permit:"create/read/update"` TopicedAt pgtype.Timestamptz `db:"topiced_at"` UpdatedAt pgtype.Timestamptz `db:"updated_at" permit:"read"` UserID mytype.OID `db:"user_id" permit:"create/read"` }
func GetStudyByApplee ¶
func GetStudyByApplee( db Queryer, appleeID string, po *PageOptions, filters *StudyFilterOptions, ) ([]*Study, error)
func GetStudyByEnrollee ¶
func GetStudyByEnrollee( db Queryer, enrolleeID string, po *PageOptions, filters *StudyFilterOptions, ) ([]*Study, error)
func GetStudyByTopic ¶
func GetStudyByTopic( db Queryer, topicID string, po *PageOptions, filters *StudyFilterOptions, ) ([]*Study, error)
func GetStudyByUser ¶
func GetStudyByUser( db Queryer, userID string, po *PageOptions, filters *StudyFilterOptions, ) ([]*Study, error)
func GetStudyByUserAndName ¶
func SearchStudy ¶
func SearchStudy( db Queryer, po *PageOptions, filters *StudyFilterOptions, ) ([]*Study, error)
type StudyEventPayload ¶
type StudyEventPayload struct { Action string `json:"action,omitempty"` StudyID mytype.OID `json:"study_id,omitempty"` }
func NewStudyAppledPayload ¶
func NewStudyAppledPayload(studyID *mytype.OID) (*StudyEventPayload, error)
func NewStudyCreatedPayload ¶
func NewStudyCreatedPayload(studyID *mytype.OID) (*StudyEventPayload, error)
func NewStudyUnappledPayload ¶
func NewStudyUnappledPayload(studyID *mytype.OID) (*StudyEventPayload, error)
type StudyFilterOptions ¶
type Topic ¶
type Topic struct { CreatedAt pgtype.Timestamptz `db:"created_at" permit:"read"` Description pgtype.Text `db:"description" permit:"create/read/update"` ID mytype.OID `db:"id" permit:"read"` Name mytype.WordName `db:"name" permit:"create/read"` TopicableID mytype.OID `db:"topicable_id"` TopicedAt pgtype.Timestamptz `db:"topiced_at"` UpdatedAt pgtype.Timestamptz `db:"updated_at" permit:"read"` }
func GetTopicByTopicable ¶
func GetTopicByTopicable( db Queryer, topicableID string, po *PageOptions, filters *TopicFilterOptions, ) ([]*Topic, error)
func SearchTopic ¶
func SearchTopic( db Queryer, po *PageOptions, filters *TopicFilterOptions, ) ([]*Topic, error)
type TopicFilterOptions ¶
type TopicFilterOptions struct {
Search *string
}
type Topiced ¶
type Topiced struct { CreatedAt pgtype.Timestamptz `db:"created_at" permit:"read"` ID pgtype.Int4 `db:"id" permit:"read"` TopicID mytype.OID `db:"topic_id" permit:"read"` TopicableID mytype.OID `db:"topicable_id" permit:"read"` Type pgtype.Text `db:"type" permit:"read"` }
func GetTopicedByTopic ¶
func GetTopicedByTopic( db Queryer, topicID string, po *PageOptions, ) ([]*Topiced, error)
func GetTopicedByTopicable ¶
func GetTopicedByTopicable( db Queryer, topicableID string, po *PageOptions, ) ([]*Topiced, error)
type User ¶
type User struct { AccountUpdatedAt pgtype.Timestamptz `db:"account_updated_at" permit:"read"` AppledAt pgtype.Timestamptz `db:"appled_at"` Bio pgtype.Text `db:"bio" permit:"read/update"` CreatedAt pgtype.Timestamptz `db:"created_at" permit:"read"` EnrolledAt pgtype.Timestamptz `db:"enrolled_at"` ID mytype.OID `db:"id" permit:"read"` Login mytype.Username `db:"login" permit:"read/create/update"` Name pgtype.Text `db:"name" permit:"read/update"` Password mytype.Password `db:"password" permit:"create/update"` PrimaryEmail mytype.Email `db:"primary_email" permit:"create"` ProfileEmailID mytype.OID `db:"profile_email_id" permit:"read/update"` ProfileUpdatedAt pgtype.Timestamptz `db:"profile_updated_at" permit:"read"` Roles pgtype.TextArray `db:"roles"` Verified pgtype.Bool `db:"verified" permit:"read"` }
func BatchGetUserByLogin ¶
func GetUserByAppleable ¶
func GetUserByAppleable( db Queryer, appleableID string, po *PageOptions, filters *UserFilterOptions, ) ([]*User, error)
func GetUserByEnrollable ¶
func GetUserByEnrollable( db Queryer, enrollableID string, po *PageOptions, filters *UserFilterOptions, ) ([]*User, error)
func GetUserByEnrollee ¶
func GetUserByEnrollee( db Queryer, enrolleeID string, po *PageOptions, filters *UserFilterOptions, ) ([]*User, error)
func SearchUser ¶
func SearchUser( db Queryer, po *PageOptions, filters *UserFilterOptions, ) ([]*User, error)
type UserAsset ¶
type UserAsset struct { ActivityID mytype.OID `db:"activity_id" permit:"read"` ActivityNumber pgtype.Int4 `db:"activity_number" permit:"read"` AssetID pgtype.Int8 `db:"asset_id" permit:"create/read"` CreatedAt pgtype.Timestamptz `db:"created_at" permit:"read"` Description pgtype.Text `db:"description" permit:"create/read/update"` ID mytype.OID `db:"id" permit:"read"` Key pgtype.Text `db:"key" permit:"read"` LabeledAt pgtype.Timestamptz `db:"labeled_at"` Name mytype.Filename `db:"name" permit:"create/read/update"` OriginalName pgtype.Text `db:"original_name" permit:"read"` Size pgtype.Int8 `db:"size" permit:"read"` StudyID mytype.OID `db:"study_id" permit:"create/read"` Subtype pgtype.Text `db:"subtype" permit:"read"` Type pgtype.Text `db:"type" permit:"read"` UpdatedAt pgtype.Timestamptz `db:"updated_at" permit:"read"` UserID mytype.OID `db:"user_id" permit:"create/read"` }
func BatchGetUserAssetByName ¶
func GetUserAssetByActivity ¶
func GetUserAssetByActivity( db Queryer, activityID string, po *PageOptions, filters *UserAssetFilterOptions, ) ([]*UserAsset, error)
func GetUserAssetByLabel ¶
func GetUserAssetByLabel( db Queryer, labelID string, po *PageOptions, filters *UserAssetFilterOptions, ) ([]*UserAsset, error)
func GetUserAssetByName ¶
func GetUserAssetByStudy ¶
func GetUserAssetByStudy( db Queryer, studyID string, po *PageOptions, filters *UserAssetFilterOptions, ) ([]*UserAsset, error)
func GetUserAssetByUser ¶
func GetUserAssetByUser( db Queryer, userID string, po *PageOptions, filters *UserAssetFilterOptions, ) ([]*UserAsset, error)
func NewUserAsset ¶
func SearchUserAsset ¶
func SearchUserAsset( db Queryer, po *PageOptions, filters *UserAssetFilterOptions, ) ([]*UserAsset, error)
type UserAssetEventPayload ¶
type UserAssetEventPayload struct { Action string `json:"action,omitempty"` ActivityID mytype.OID `json:"activity_id,omitempty"` AssetID mytype.OID `json:"asset_id,omitempty"` CommentID mytype.OID `json:"comment_id,omitempty"` LabelID mytype.OID `json:"label_id,omitempty"` Rename RenamePayload `json:"rename,omitempty"` SourceID mytype.OID `json:"source_id,omitempty"` }
func NewUserAssetAddedToActivityPayload ¶
func NewUserAssetAddedToActivityPayload(assetID, activityID *mytype.OID) (*UserAssetEventPayload, error)
func NewUserAssetCommentedPayload ¶
func NewUserAssetCommentedPayload(assetID, commentID *mytype.OID) (*UserAssetEventPayload, error)
func NewUserAssetCreatedPayload ¶
func NewUserAssetCreatedPayload(assetID *mytype.OID) (*UserAssetEventPayload, error)
func NewUserAssetLabeledPayload ¶
func NewUserAssetLabeledPayload(assetID, labelID *mytype.OID) (*UserAssetEventPayload, error)
func NewUserAssetMentionedPayload ¶
func NewUserAssetMentionedPayload(assetID *mytype.OID) (*UserAssetEventPayload, error)
func NewUserAssetReferencedPayload ¶
func NewUserAssetReferencedPayload(assetID, sourceID *mytype.OID) (*UserAssetEventPayload, error)
func NewUserAssetRemovedFromActivityPayload ¶
func NewUserAssetRemovedFromActivityPayload(assetID, activityID *mytype.OID) (*UserAssetEventPayload, error)
func NewUserAssetRenamedPayload ¶
func NewUserAssetRenamedPayload(assetID *mytype.OID, from, to string) (*UserAssetEventPayload, error)
func NewUserAssetUnlabeledPayload ¶
func NewUserAssetUnlabeledPayload(assetID, labelID *mytype.OID) (*UserAssetEventPayload, error)
type UserAssetFilterOptions ¶
type UserFilterOptions ¶
type UserFilterOptions struct {
Search *string
}
Source Files ¶
- activity.go
- activity_asset.go
- appled.go
- asset.go
- comment.go
- comment_draft_backup.go
- course.go
- course_lesson.go
- cursor.go
- db.go
- email.go
- email_verification_token.go
- enrolled.go
- error.go
- event.go
- event_payloads.go
- label.go
- labeled.go
- lesson.go
- lesson_draft_backup.go
- notification.go
- password_reset_token.go
- permission.go
- psql_error.go
- query_permission.go
- reason.go
- role.go
- study.go
- topic.go
- topiced.go
- user.go
- user_asset.go
- util.go