Documentation ¶
Index ¶
- Constants
- type CommentRepository
- func (r CommentRepository) Create(ctx context.Context, entity *comment.Comment) error
- func (r CommentRepository) Delete(ctx context.Context, id uint) error
- func (r CommentRepository) First(ctx context.Context, entity *comment.Comment) (*comment.Comment, error)
- func (r CommentRepository) Get(ctx context.Context, id uint) (*comment.Comment, error)
- func (r CommentRepository) Query(ctx context.Context, offset, limit uint) ([]comment.Comment, error)
- func (r *CommentRepository) SetDefaultConditions(conditions map[string]interface{})
- type IRepository
- type PostRepository
- func (r PostRepository) Create(ctx context.Context, entity *post.Post) error
- func (r PostRepository) Delete(ctx context.Context, id uint) error
- func (r PostRepository) First(ctx context.Context, entity *post.Post) (*post.Post, error)
- func (r PostRepository) Get(ctx context.Context, id uint) (*post.Post, error)
- func (r PostRepository) Query(ctx context.Context, offset, limit uint) ([]post.Post, error)
- func (r *PostRepository) SetDefaultConditions(conditions map[string]interface{})
- func (r PostRepository) Update(ctx context.Context, entity *post.Post) error
- type SessionRepository
- func (r SessionRepository) Create(ctx context.Context, entity *session.Session) error
- func (r SessionRepository) Delete(ctx context.Context, id uint) error
- func (r SessionRepository) Get(ctx context.Context, id uint) (*session.Session, error)
- func (r SessionRepository) GetByUserID(ctx context.Context, userId uint) (*session.Session, error)
- func (r SessionRepository) GetVar(session *session.Session, name string) (interface{}, bool)
- func (r SessionRepository) NewEntity(ctx context.Context, userId uint) (*session.Session, error)
- func (r *SessionRepository) SaveSession(session *session.Session) error
- func (r *SessionRepository) SetDefaultConditions(conditions map[string]interface{})
- func (r *SessionRepository) SetVar(session *session.Session, name string, val interface{}) error
- func (r SessionRepository) Update(ctx context.Context, entity *session.Session) error
- type UserRepository
- func (r UserRepository) Create(ctx context.Context, entity *user.User) error
- func (r UserRepository) First(ctx context.Context, entity *user.User) (*user.User, error)
- func (r UserRepository) Get(ctx context.Context, id uint) (*user.User, error)
- func (r UserRepository) Query(ctx context.Context, offset, limit uint) ([]user.User, error)
- func (r *UserRepository) SetDefaultConditions(conditions map[string]interface{})
- type VoteRepository
- func (r VoteRepository) Create(ctx context.Context, entity *vote.Vote) error
- func (r VoteRepository) Delete(ctx context.Context, entity *vote.Vote) error
- func (r VoteRepository) First(ctx context.Context, entity *vote.Vote) (*vote.Vote, error)
- func (r VoteRepository) Get(ctx context.Context, id uint) (*vote.Vote, error)
- func (r VoteRepository) Query(ctx context.Context, offset, limit uint) ([]vote.Vote, error)
- func (r *VoteRepository) SetDefaultConditions(conditions map[string]interface{})
- func (r VoteRepository) Update(ctx context.Context, entity *vote.Vote) error
Constants ¶
const Limit = 100
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommentRepository ¶
type CommentRepository struct {
// contains filtered or unexported fields
}
CommentRepository is a repository for the user entity
func NewCommentRepository ¶
func NewCommentRepository(repository *repository) (*CommentRepository, error)
New creates a new CommentRepository
func (CommentRepository) Create ¶
Create saves a new album record in the database. It returns the ID of the newly inserted album record.
func (CommentRepository) Delete ¶
func (r CommentRepository) Delete(ctx context.Context, id uint) error
Delete deletes an entity with the specified ID from the database.
func (CommentRepository) Query ¶
func (r CommentRepository) Query(ctx context.Context, offset, limit uint) ([]comment.Comment, error)
Query retrieves the album records with the specified offset and limit from the database.
func (*CommentRepository) SetDefaultConditions ¶
func (r *CommentRepository) SetDefaultConditions(conditions map[string]interface{})
type IRepository ¶
type IRepository interface{}
IRepository is an interface of repository
func GetRepository ¶
GetRepository return a repository
type PostRepository ¶
type PostRepository struct {
// contains filtered or unexported fields
}
PostRepository is a repository for the user entity
func NewPostRepository ¶
func NewPostRepository(repository *repository) (*PostRepository, error)
New creates a new PostRepository
func (PostRepository) Create ¶
Create saves a new album record in the database. It returns the ID of the newly inserted album record.
func (PostRepository) Delete ¶
func (r PostRepository) Delete(ctx context.Context, id uint) error
Delete deletes an entity with the specified ID from the database.
func (PostRepository) Query ¶
Query retrieves the album records with the specified offset and limit from the database.
func (*PostRepository) SetDefaultConditions ¶
func (r *PostRepository) SetDefaultConditions(conditions map[string]interface{})
type SessionRepository ¶
type SessionRepository struct { UserRepo user.IRepository // contains filtered or unexported fields }
PostRepository is a repository for the user entity
func NewSessionRepository ¶
func NewSessionRepository(dbase db.IDB, logger log.ILogger, userRepo user.IRepository) (*SessionRepository, error)
New creates a new PostRepository
func (SessionRepository) Delete ¶
func (r SessionRepository) Delete(ctx context.Context, id uint) error
Delete removes the entity with given ID from the storage.
func (SessionRepository) GetByUserID ¶
Get returns the Session with the specified user ID.
func (SessionRepository) GetVar ¶
func (r SessionRepository) GetVar(session *session.Session, name string) (interface{}, bool)
func (*SessionRepository) SaveSession ¶
func (r *SessionRepository) SaveSession(session *session.Session) error
func (*SessionRepository) SetDefaultConditions ¶
func (r *SessionRepository) SetDefaultConditions(conditions map[string]interface{})
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
UserRepository is a repository for the user entity
func NewUserRepository ¶
func NewUserRepository(repository *repository) (*UserRepository, error)
New creates a new UserRepository
func (UserRepository) Create ¶
Create saves a new album record in the database. It returns the ID of the newly inserted album record.
func (UserRepository) Query ¶
Query retrieves the album records with the specified offset and limit from the database.
func (*UserRepository) SetDefaultConditions ¶
func (r *UserRepository) SetDefaultConditions(conditions map[string]interface{})
type VoteRepository ¶
type VoteRepository struct {
// contains filtered or unexported fields
}
VoteRepository is a repository for the user entity
func NewVoteRepository ¶
func NewVoteRepository(repository *repository) (*VoteRepository, error)
New creates a new VoteRepository
func (VoteRepository) Create ¶
Create saves a new album record in the database. It returns the ID of the newly inserted album record.
func (VoteRepository) Query ¶
Query retrieves the album records with the specified offset and limit from the database.
func (*VoteRepository) SetDefaultConditions ¶
func (r *VoteRepository) SetDefaultConditions(conditions map[string]interface{})