Documentation ¶
Index ¶
- func Get(ctx context.Context, c *redis.Client, id, table string) interface{}
- func GetSafe(ctx context.Context, c *redis.Client, id, table string) (interface{}, error)
- func Remove(ctx context.Context, c *redis.Client, id, table string)
- func Store(ctx context.Context, c *redis.Client, id, table string, entity interface{})
- func StoreSafe(ctx context.Context, c *redis.Client, id, table string, entity interface{}) error
- type MediaKafkaEvent
- func (e *MediaKafkaEvent) HardRemoved(ctx context.Context, id string) error
- func (e *MediaKafkaEvent) Removed(ctx context.Context, id string) error
- func (e *MediaKafkaEvent) Restored(ctx context.Context, id string) error
- func (e *MediaKafkaEvent) StartCreate(ctx context.Context, media domain.Media) error
- func (e *MediaKafkaEvent) StartUpdate(ctx context.Context, media domain.Media, snapshot domain.Media) error
- func (e *MediaKafkaEvent) Updated(ctx context.Context, media domain.Media) error
- type MediaPQRepository
- func (r *MediaPQRepository) ChangeState(ctx context.Context, id, state string) error
- func (r *MediaPQRepository) Fetch(ctx context.Context, params core.PaginationParams, filter core.FilterParams) ([]*domain.Media, error)
- func (r *MediaPQRepository) FetchByID(ctx context.Context, id string, showDisabled bool) (*domain.Media, error)
- func (r *MediaPQRepository) HardRemove(ctx context.Context, id string) error
- func (r *MediaPQRepository) Remove(ctx context.Context, id string) error
- func (r *MediaPQRepository) Replace(ctx context.Context, media domain.Media) error
- func (r *MediaPQRepository) Restore(ctx context.Context, id string) error
- func (r *MediaPQRepository) Save(ctx context.Context, media domain.Media) error
- func (r *MediaPQRepository) SaveRaw(ctx context.Context, media domain.Media) error
- type MediaQuery
- func (b *MediaQuery) Active(state string) *MediaQuery
- func (b *MediaQuery) And() *MediaQuery
- func (b *MediaQuery) Author(id string) *MediaQuery
- func (b *MediaQuery) Filter(key, op, id, state string) *MediaQuery
- func (b *MediaQuery) Language(lang string) *MediaQuery
- func (b *MediaQuery) Like(query string) *MediaQuery
- func (b *MediaQuery) Limit(limit int) *MediaQuery
- func (b *MediaQuery) MediaType(media string) *MediaQuery
- func (b *MediaQuery) Or() *MediaQuery
- func (b *MediaQuery) OrderBy(key, def, param string) *MediaQuery
- func (b *MediaQuery) Publisher(id string) *MediaQuery
- func (b *MediaQuery) Raw(statement string) *MediaQuery
- type MediaSAGAKafkaEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
Get returns an entity from redis store using the write-through pattern, ignores errors (recommended for optional cache)
Types ¶
type MediaKafkaEvent ¶
type MediaKafkaEvent struct {
// contains filtered or unexported fields
}
func NewMediaKafakaEvent ¶
func NewMediaKafakaEvent(cfg *config.Kernel) *MediaKafkaEvent
func (*MediaKafkaEvent) HardRemoved ¶
func (e *MediaKafkaEvent) HardRemoved(ctx context.Context, id string) error
func (*MediaKafkaEvent) Removed ¶
func (e *MediaKafkaEvent) Removed(ctx context.Context, id string) error
func (*MediaKafkaEvent) Restored ¶
func (e *MediaKafkaEvent) Restored(ctx context.Context, id string) error
func (*MediaKafkaEvent) StartCreate ¶
func (*MediaKafkaEvent) StartUpdate ¶
type MediaPQRepository ¶
type MediaPQRepository struct {
// contains filtered or unexported fields
}
func NewMediaPQRepository ¶
func NewMediaPQRepository(db *sql.DB, mem *redis.Client, logger log.Logger) *MediaPQRepository
func (*MediaPQRepository) ChangeState ¶
func (r *MediaPQRepository) ChangeState(ctx context.Context, id, state string) error
func (*MediaPQRepository) Fetch ¶
func (r *MediaPQRepository) Fetch(ctx context.Context, params core.PaginationParams, filter core.FilterParams) ([]*domain.Media, error)
func (*MediaPQRepository) HardRemove ¶
func (r *MediaPQRepository) HardRemove(ctx context.Context, id string) error
func (*MediaPQRepository) Remove ¶
func (r *MediaPQRepository) Remove(ctx context.Context, id string) error
func (*MediaPQRepository) Restore ¶
func (r *MediaPQRepository) Restore(ctx context.Context, id string) error
type MediaQuery ¶
type MediaQuery struct {
Statement string
}
PQ Query builder
func (*MediaQuery) Active ¶
func (b *MediaQuery) Active(state string) *MediaQuery
Active return a query to search by entity's state
func (*MediaQuery) And ¶
func (b *MediaQuery) And() *MediaQuery
And returns a query with the AND statement
func (*MediaQuery) Author ¶
func (b *MediaQuery) Author(id string) *MediaQuery
func (*MediaQuery) Filter ¶
func (b *MediaQuery) Filter(key, op, id, state string) *MediaQuery
Filter Returns a query to filter useful fields like timestamp, id, or total_views
key = field, op = operator, id = entity external_id, state = is entity active
func (*MediaQuery) Language ¶
func (b *MediaQuery) Language(lang string) *MediaQuery
func (*MediaQuery) Like ¶
func (b *MediaQuery) Like(query string) *MediaQuery
func (*MediaQuery) Limit ¶
func (b *MediaQuery) Limit(limit int) *MediaQuery
Limit returns a query with a limiter, useful for pagination
func (*MediaQuery) MediaType ¶
func (b *MediaQuery) MediaType(media string) *MediaQuery
func (*MediaQuery) Or ¶
func (b *MediaQuery) Or() *MediaQuery
Or returns a query with the OR statement
func (*MediaQuery) OrderBy ¶
func (b *MediaQuery) OrderBy(key, def, param string) *MediaQuery
OrderBy returns a query for ordering
key = field, def = default order, param = sorting from params, will replace default value
func (*MediaQuery) Publisher ¶
func (b *MediaQuery) Publisher(id string) *MediaQuery
func (*MediaQuery) Raw ¶
func (b *MediaQuery) Raw(statement string) *MediaQuery
Raw returns a query with the raw SQL query
type MediaSAGAKafkaEvent ¶
type MediaSAGAKafkaEvent struct {
// contains filtered or unexported fields
}
func NewMediaSAGAKafkaEvent ¶
func NewMediaSAGAKafkaEvent(cfg *config.Kernel) *MediaSAGAKafkaEvent
func (*MediaSAGAKafkaEvent) BlobFailed ¶
func (e *MediaSAGAKafkaEvent) BlobFailed(ctx context.Context, msg string) error
func (*MediaSAGAKafkaEvent) VerifyAuthor ¶
func (e *MediaSAGAKafkaEvent) VerifyAuthor(ctx context.Context, authorPool []string) error