Documentation
¶
Index ¶
- type Book
- type BookRepo
- type BookRepoImpl
- func (r *BookRepoImpl) Delete(ctx context.Context, id int64) (err error)
- func (r *BookRepoImpl) Find(ctx context.Context, id int64) (book *Book, err error)
- func (r *BookRepoImpl) Insert(ctx context.Context, book Book) (lastInsertID int64, err error)
- func (r *BookRepoImpl) List(ctx context.Context) (list []*Book, err error)
- func (r *BookRepoImpl) Update(ctx context.Context, book Book) (err error)
- type CachedBookRepoImpl
- type CachedDataSourceRepoImpl
- type CachedLocaleRepoImpl
- type CachedMusicRepoImpl
- type CachedTagRepoImpl
- type DataSource
- type DataSourceRepo
- type DataSourceRepoImpl
- func (r *DataSourceRepoImpl) Delete(ctx context.Context, id int64) (err error)
- func (r *DataSourceRepoImpl) Find(ctx context.Context, id int64) (e *DataSource, err error)
- func (r *DataSourceRepoImpl) Insert(ctx context.Context, e DataSource) (lastInsertID int64, err error)
- func (r *DataSourceRepoImpl) List(ctx context.Context) (list []*DataSource, err error)
- func (r *DataSourceRepoImpl) Update(ctx context.Context, e DataSource) (err error)
- type Locale
- type LocaleRepo
- type LocaleRepoImpl
- func (r *LocaleRepoImpl) Delete(ctx context.Context, id int64) (err error)
- func (r *LocaleRepoImpl) Find(ctx context.Context, id int64) (e *Locale, err error)
- func (r *LocaleRepoImpl) Insert(ctx context.Context, e Locale) (lastInsertID int64, err error)
- func (r *LocaleRepoImpl) List(ctx context.Context) (list []*Locale, err error)
- func (r *LocaleRepoImpl) Update(ctx context.Context, e Locale) (err error)
- type Music
- type MusicRepo
- type MusicRepoImpl
- func (r *MusicRepoImpl) Delete(ctx context.Context, id int64) (err error)
- func (r *MusicRepoImpl) Find(ctx context.Context, id int64) (e *Music, err error)
- func (r *MusicRepoImpl) Insert(ctx context.Context, e Music) (lastInsertID int64, err error)
- func (r *MusicRepoImpl) List(ctx context.Context) (list []*Music, err error)
- func (r *MusicRepoImpl) Update(ctx context.Context, e Music) (err error)
- type Tag
- type TagRepo
- type TagRepoImpl
- func (r *TagRepoImpl) Delete(ctx context.Context, id int64) (err error)
- func (r *TagRepoImpl) Find(ctx context.Context, id int64) (e *Tag, err error)
- func (r *TagRepoImpl) Insert(ctx context.Context, e Tag) (lastInsertID int64, err error)
- func (r *TagRepoImpl) List(ctx context.Context) (list []*Tag, err error)
- func (r *TagRepoImpl) Update(ctx context.Context, e Tag) (err error)
- type Transactional
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Book ¶
type Book struct {
ID int64 `json:"id"`
Title string `json:"title" validate:"required"`
Author string `json:"author" validate:"required"`
UpdatedAt time.Time `json:"-"`
CreatedAt time.Time `json:"-"`
}
Book represented database model
type BookRepo ¶ added in v0.8.0
type BookRepo interface {
Find(ctx context.Context, id int64) (*Book, error)
List(ctx context.Context) ([]*Book, error)
Insert(ctx context.Context, book Book) (lastInsertID int64, err error)
Delete(ctx context.Context, id int64) error
Update(ctx context.Context, book Book) error
}
BookRepo to get book data from databasesa
func NewBookRepo ¶ added in v0.8.0
func NewBookRepo(impl CachedBookRepoImpl) BookRepo
NewBookRepo return new instance of BookRepo
type BookRepoImpl ¶ added in v0.8.0
BookRepoImpl is implementation book repository
func (*BookRepoImpl) Delete ¶ added in v0.8.0
func (r *BookRepoImpl) Delete(ctx context.Context, id int64) (err error)
Delete book
type CachedBookRepoImpl ¶ added in v0.8.0
type CachedBookRepoImpl struct {
dig.In
BookRepoImpl
Redis *redis.Client
}
CachedBookRepoImpl is cached implementation of book repository
type CachedDataSourceRepoImpl ¶ added in v0.8.13
type CachedDataSourceRepoImpl struct {
dig.In
DataSourceRepoImpl
Redis *redis.Client
}
CachedDataSourceRepoImpl is cached implementation of data_source repository
func (*CachedDataSourceRepoImpl) Find ¶ added in v0.8.13
func (r *CachedDataSourceRepoImpl) Find(ctx context.Context, id int64) (e *DataSource, err error)
Find data_source entity
func (*CachedDataSourceRepoImpl) List ¶ added in v0.8.13
func (r *CachedDataSourceRepoImpl) List(ctx context.Context) (list []*DataSource, err error)
List of data_source entity
type CachedLocaleRepoImpl ¶ added in v0.8.13
type CachedLocaleRepoImpl struct {
dig.In
LocaleRepoImpl
Redis *redis.Client
}
CachedLocaleRepoImpl is cached implementation of locale repository
type CachedMusicRepoImpl ¶ added in v0.8.11
type CachedMusicRepoImpl struct {
dig.In
MusicRepoImpl
Redis *redis.Client
}
CachedMusicRepoImpl is cached implementation of music repository
type CachedTagRepoImpl ¶ added in v0.8.13
type CachedTagRepoImpl struct {
dig.In
TagRepoImpl
Redis *redis.Client
}
CachedTagRepoImpl is cached implementation of tag repository
type DataSource ¶ added in v0.8.13
type DataSource struct {
ID int64 `json:"id"`
Name string `json:"name"`
Url string `json:"url"`
UpdatedAt time.Time `json:"updated_at"`
CreatedAt time.Time `json:"created_at"`
}
DataSource represented data_source entity
type DataSourceRepo ¶ added in v0.8.13
type DataSourceRepo interface {
Find(context.Context, int64) (*DataSource, error)
List(context.Context) ([]*DataSource, error)
Insert(context.Context, DataSource) (lastInsertID int64, err error)
Delete(context.Context, int64) error
Update(context.Context, DataSource) error
}
DataSourceRepo to handle data_sources entity
func NewDataSourceRepo ¶ added in v0.8.13
func NewDataSourceRepo(impl CachedDataSourceRepoImpl) DataSourceRepo
NewDataSourceRepo return new instance of DataSourceRepo
type DataSourceRepoImpl ¶ added in v0.8.13
DataSourceRepoImpl is implementation data_source repository
func (*DataSourceRepoImpl) Delete ¶ added in v0.8.13
func (r *DataSourceRepoImpl) Delete(ctx context.Context, id int64) (err error)
Delete data_source
func (*DataSourceRepoImpl) Find ¶ added in v0.8.13
func (r *DataSourceRepoImpl) Find(ctx context.Context, id int64) (e *DataSource, err error)
Find data_source
func (*DataSourceRepoImpl) Insert ¶ added in v0.8.13
func (r *DataSourceRepoImpl) Insert(ctx context.Context, e DataSource) (lastInsertID int64, err error)
Insert data_source
func (*DataSourceRepoImpl) List ¶ added in v0.8.13
func (r *DataSourceRepoImpl) List(ctx context.Context) (list []*DataSource, err error)
List data_source
func (*DataSourceRepoImpl) Update ¶ added in v0.8.13
func (r *DataSourceRepoImpl) Update(ctx context.Context, e DataSource) (err error)
Update data_source
type Locale ¶ added in v0.8.13
type Locale struct {
ID int64 `json:"id"`
LangCode string `json:"lang_code"`
CountryCode string `json:"country_code"`
UpdatedAt time.Time `json:"updated_at"`
CreatedAt time.Time `json:"created_at"`
}
Locale represented locale entity
type LocaleRepo ¶ added in v0.8.13
type LocaleRepo interface {
Find(context.Context, int64) (*Locale, error)
List(context.Context) ([]*Locale, error)
Insert(context.Context, Locale) (lastInsertID int64, err error)
Delete(context.Context, int64) error
Update(context.Context, Locale) error
}
LocaleRepo to handle locales entity
func NewLocaleRepo ¶ added in v0.8.13
func NewLocaleRepo(impl CachedLocaleRepoImpl) LocaleRepo
NewLocaleRepo return new instance of LocaleRepo
type LocaleRepoImpl ¶ added in v0.8.13
LocaleRepoImpl is implementation locale repository
func (*LocaleRepoImpl) Delete ¶ added in v0.8.13
func (r *LocaleRepoImpl) Delete(ctx context.Context, id int64) (err error)
Delete locale
type Music ¶ added in v0.8.11
type Music struct {
ID int64 `json:"id"`
Artist string `json:"artist"`
UpdatedAt time.Time `json:"updated_at"`
CreatedAt time.Time `json:"created_at"`
}
Music represented music entity
type MusicRepo ¶ added in v0.8.11
type MusicRepo interface {
Find(context.Context, int64) (*Music, error)
List(context.Context) ([]*Music, error)
Insert(context.Context, Music) (lastInsertID int64, err error)
Delete(context.Context, int64) error
Update(context.Context, Music) error
}
MusicRepo to handle musics entity
func NewMusicRepo ¶ added in v0.8.11
func NewMusicRepo(impl CachedMusicRepoImpl) MusicRepo
NewMusicRepo return new instance of MusicRepo
type MusicRepoImpl ¶ added in v0.8.11
MusicRepoImpl is implementation music repository
func (*MusicRepoImpl) Delete ¶ added in v0.8.11
func (r *MusicRepoImpl) Delete(ctx context.Context, id int64) (err error)
Delete music
type Tag ¶ added in v0.8.13
type Tag struct {
ID int64 `json:"id"`
Type string `json:"type"`
Attributes dbkit.JSON `json:"attributes"`
Value string `json:"value"`
UpdatedAt time.Time `json:"updated_at"`
CreatedAt time.Time `json:"created_at"`
}
Tag represented tag entity
type TagRepo ¶ added in v0.8.13
type TagRepo interface {
Find(context.Context, int64) (*Tag, error)
List(context.Context) ([]*Tag, error)
Insert(context.Context, Tag) (lastInsertID int64, err error)
Delete(context.Context, int64) error
Update(context.Context, Tag) error
}
TagRepo to handle tags entity
func NewTagRepo ¶ added in v0.8.13
func NewTagRepo(impl CachedTagRepoImpl) TagRepo
NewTagRepo return new instance of TagRepo
type TagRepoImpl ¶ added in v0.8.13
TagRepoImpl is implementation tag repository
func (*TagRepoImpl) Delete ¶ added in v0.8.13
func (r *TagRepoImpl) Delete(ctx context.Context, id int64) (err error)
Delete tag
type Transactional ¶ added in v0.8.12
Transactional database
Source Files
¶
- book_repo.go
- book_repo_impl.go
- cached_book_repo_impl.go
- cached_data_source_repo_impl.go
- cached_locale_repo_impl.go
- cached_music_repo_impl.go
- cached_tag_repo_impl.go
- data_source_repo.go
- data_source_repo_impl.go
- locale_repo.go
- locale_repo_impl.go
- music_repo.go
- music_repo_impl.go
- tag_repo.go
- tag_repo_impl.go
- transactional.go