Documentation ¶
Index ¶
- Variables
- type BookRepo
- type BookRepoImpl
- func (r *BookRepoImpl) Count(ctx context.Context, opts ...sqkit.SelectOption) (int64, error)
- func (r *BookRepoImpl) Create(ctx context.Context, ent *entity.Book) (int64, error)
- func (r *BookRepoImpl) Delete(ctx context.Context, opt sqkit.DeleteOption) (int64, error)
- func (r *BookRepoImpl) Find(ctx context.Context, opts ...sqkit.SelectOption) (list []*entity.Book, err error)
- func (r *BookRepoImpl) Patch(ctx context.Context, ent *entity.Book, opt sqkit.UpdateOption) (int64, error)
- func (r *BookRepoImpl) Update(ctx context.Context, ent *entity.Book, opt sqkit.UpdateOption) (int64, error)
- type SongRepo
- type SongRepoImpl
- func (r *SongRepoImpl) Count(ctx context.Context, opts ...sqkit.SelectOption) (int64, error)
- func (r *SongRepoImpl) Create(ctx context.Context, ent *entity.Song) (int64, error)
- func (r *SongRepoImpl) Delete(ctx context.Context, opt sqkit.DeleteOption) (int64, error)
- func (r *SongRepoImpl) Find(ctx context.Context, opts ...sqkit.SelectOption) (list []*entity.Song, err error)
- func (r *SongRepoImpl) Patch(ctx context.Context, ent *entity.Song, opt sqkit.UpdateOption) (int64, error)
- func (r *SongRepoImpl) Update(ctx context.Context, ent *entity.Song, opt sqkit.UpdateOption) (int64, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // BookTableName is table name for books entity BookTableName = "books" // BookTable is columns for books entity BookTable = struct { ID string Title string Author string UpdatedAt string CreatedAt string }{ ID: "id", Title: "title", Author: "author", UpdatedAt: "updated_at", CreatedAt: "created_at", } )
View Source
var ( // SongTableName is table name for songs entity SongTableName = "songs" // SongTable is columns for songs entity SongTable = struct { ID string Title string Artist string UpdatedAt string CreatedAt string }{ ID: "id", Title: "title", Artist: "artist", UpdatedAt: "updated_at", CreatedAt: "created_at", } )
Functions ¶
This section is empty.
Types ¶
type BookRepo ¶
type BookRepo interface { Count(context.Context, ...sqkit.SelectOption) (int64, error) Find(context.Context, ...sqkit.SelectOption) ([]*entity.Book, error) Create(context.Context, *entity.Book) (int64, error) Delete(context.Context, sqkit.DeleteOption) (int64, error) Update(context.Context, *entity.Book, sqkit.UpdateOption) (int64, error) Patch(context.Context, *entity.Book, sqkit.UpdateOption) (int64, error) }
BookRepo to get books data from database
func NewBookRepo ¶
func NewBookRepo(impl BookRepoImpl) BookRepo
NewBookRepo return new instance of BookRepo
type BookRepoImpl ¶
BookRepoImpl is implementation books repository
func (*BookRepoImpl) Count ¶
func (r *BookRepoImpl) Count(ctx context.Context, opts ...sqkit.SelectOption) (int64, error)
Count books
func (*BookRepoImpl) Delete ¶
func (r *BookRepoImpl) Delete(ctx context.Context, opt sqkit.DeleteOption) (int64, error)
Delete books
func (*BookRepoImpl) Find ¶
func (r *BookRepoImpl) Find(ctx context.Context, opts ...sqkit.SelectOption) (list []*entity.Book, err error)
Find books
type SongRepo ¶
type SongRepo interface { Count(context.Context, ...sqkit.SelectOption) (int64, error) Find(context.Context, ...sqkit.SelectOption) ([]*entity.Song, error) Create(context.Context, *entity.Song) (int64, error) Delete(context.Context, sqkit.DeleteOption) (int64, error) Update(context.Context, *entity.Song, sqkit.UpdateOption) (int64, error) Patch(context.Context, *entity.Song, sqkit.UpdateOption) (int64, error) }
SongRepo to get songs data from database
func NewSongRepo ¶
func NewSongRepo(impl SongRepoImpl) SongRepo
NewSongRepo return new instance of SongRepo
type SongRepoImpl ¶
SongRepoImpl is implementation songs repository
func (*SongRepoImpl) Count ¶
func (r *SongRepoImpl) Count(ctx context.Context, opts ...sqkit.SelectOption) (int64, error)
Count songs
func (*SongRepoImpl) Delete ¶
func (r *SongRepoImpl) Delete(ctx context.Context, opt sqkit.DeleteOption) (int64, error)
Delete songs
func (*SongRepoImpl) Find ¶
func (r *SongRepoImpl) Find(ctx context.Context, opts ...sqkit.SelectOption) (list []*entity.Song, err error)
Find songs
Click to show internal directories.
Click to hide internal directories.