Versions in this module Expand all Collapse all v0 v0.2.0 Dec 2, 2020 Changes in this version + const HTMLSplitTag + func MarkTotal(userID uint) (total int64) + type Comment struct + Content string + MarkID uint + User *User + UserID uint + func CommentCreate(userID uint, markID uint, content string) (comment *Comment, err error) + func CommentDestroy(userID uint, markID uint) (comment *Comment, err error) + func CommentFind(commentID uint) (comment *Comment, err error) + func CommentFindByMarkID(userID uint, markID uint) (comment *Comment, err error) + func CommentUpdate(userID uint, markID uint, content string) (comment *Comment, err error) + func FakeComment(userID uint, markID uint) *Comment + type CommentVO struct + Content string + type DeletedAt int64 + func (DeletedAt) DeleteClauses(f *schema.Field) []clause.Interface + func (DeletedAt) QueryClauses(f *schema.Field) []clause.Interface + func (n *DeletedAt) Scan(value interface{}) error + func (n *DeletedAt) UnmarshalJSON(b []byte) error + func (n DeletedAt) MarshalJSON() ([]byte, error) + func (n DeletedAt) Value() (driver.Value, error) type Mark + Comment *Comment + UserID uint + func FakeMark(userID uint) *Mark + func MarkCreate(userID uint, vo *MarkCreateVO) (mark *Mark, err error) + func MarkDestroy(userID uint, hashKey string) (mark *Mark, err error) + func MarkFind(markID uint) (mark *Mark, err error) + func MarkFindByHashKey(userID uint, hashKey string) (mark *Mark, err error) + func MarkList(userID uint, vo PaginationVO) []Mark + func MarkQuery(userID uint, safeBase64URL string) []*Mark + func MarkUpdate(userID uint, hashKey string, vo *MarkUpdateVO) (mark *Mark, err error) + func (m *Mark) SelectionText() string + type Selection struct + EndOffset int + StartOffset int + Texts []string + func FakeSelection() *Selection + func (s *Selection) Scan(value interface{}) error + func (s Selection) Value() (driver.Value, error) type Session + func SessionFindByToken(token string) (session *Session, err error) + type SoftDeleteDeleteClause struct + Field *schema.Field + func (sd SoftDeleteDeleteClause) Build(clause.Builder) + func (sd SoftDeleteDeleteClause) MergeClause(*clause.Clause) + func (sd SoftDeleteDeleteClause) ModifyStatement(stmt *gorm.Statement) + func (sd SoftDeleteDeleteClause) Name() string + type SoftDeleteQueryClause struct + Field *schema.Field + func (sd SoftDeleteQueryClause) Build(clause.Builder) + func (sd SoftDeleteQueryClause) MergeClause(*clause.Clause) + func (sd SoftDeleteQueryClause) ModifyStatement(stmt *gorm.Statement) + func (sd SoftDeleteQueryClause) Name() string type User + func UserCreate(email string, password string) (u *User, err error) + func UserFindByEmail(email string) (u *User, err error) v0.1.0 Nov 21, 2020 Changes in this version + var Pagination = PaginationVO + var UserStatuses = map[string]UserStatus + func DB() *gorm.DB + func PaginationScope(vo PaginationVO) func(db *gorm.DB) *gorm.DB + func Ping() error + func RegisterGormCallBack() (err error) + type BaseModel struct + CreatedAt time.Time + DeletedAt gorm.DeletedAt + ID uint + UpdatedAt time.Time + type Mark struct + HashKey string + Selection string + Tag string + URL string + UserId uint + type MarkCreateVO struct + HashKey string + Selection string + Tag string + URL string + type MarkUpdateVO struct + Selection string + Tag string + type PaginationVO struct + Page int + Size int + type Session struct + ExpiredAt time.Time + Token string + User User + UserID uint + func (s *Session) FindByToken() error + type SessionVO struct + Email string + Password string + func (s *SessionVO) CurrentUser() (u *User, ok bool) + func (s *SessionVO) Validate() error + type User struct + Avatar string + Email string + Password string + PasswordHash string + Status string + func FakeUser() *User + func FindUserByEmail(email string) (u *User, err error) + func (u *User) CalcPasswordHash() error + func (u *User) Create() error + func (u *User) CreateMark(vo MarkCreateVO) (mark *Mark, err error) + func (u *User) DestroyMark(hashKey string) error + func (u *User) GenerateSession() (*Session, error) + func (u *User) GetMark(hashKey string) (mark *Mark, err error) + func (u *User) MarkQuery(safeBase64URL string) []Mark + func (u *User) MarksAll(vo PaginationVO) []Mark + func (u *User) MarksTotal() (total int64) + func (u *User) UpdateMark(hashKey string, vo *MarkUpdateVO) (mark *Mark, err error) + func (u *User) ValidPassword() bool + func (u *User) Validate() error + type UserStatus string + const ActivatedStatus + const InactiveStatus + func (s UserStatus) String() string