infrastructure

package
v0.0.0-...-833cb33 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2020 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(ctx context.Context, c *redis.Client, id, table string) interface{}

Get returns an entity from redis store using the write-through pattern, ignores errors (recommended for optional cache)

func GetSafe

func GetSafe(ctx context.Context, c *redis.Client, id, table string) (interface{}, error)

GetSafe returns an entity from redis store using the write-through pattern

func Remove

func Remove(ctx context.Context, c *redis.Client, id, table string)

Remove an entity from a store

func Store

func Store(ctx context.Context, c *redis.Client, id, table string, entity interface{})

Store a record inside redis database using the write-through pattern, ignore errors (recommended for optional cache)

func StoreSafe

func StoreSafe(ctx context.Context, c *redis.Client, id, table string, entity interface{}) error

StoreSafe a record inside redis database using the write-through pattern

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 (e *MediaKafkaEvent) StartCreate(ctx context.Context, media domain.Media) error

func (*MediaKafkaEvent) StartUpdate

func (e *MediaKafkaEvent) StartUpdate(ctx context.Context, media domain.Media, snapshot domain.Media) error

func (*MediaKafkaEvent) Updated

func (e *MediaKafkaEvent) Updated(ctx context.Context, media domain.Media) error

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 (*MediaPQRepository) FetchByID

func (r *MediaPQRepository) FetchByID(ctx context.Context, id string, showDisabled bool) (*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) Replace

func (r *MediaPQRepository) Replace(ctx context.Context, media domain.Media) error

func (*MediaPQRepository) Restore

func (r *MediaPQRepository) Restore(ctx context.Context, id string) error

func (*MediaPQRepository) Save

func (r *MediaPQRepository) Save(ctx context.Context, media domain.Media) error

func (*MediaPQRepository) SaveRaw

func (r *MediaPQRepository) SaveRaw(ctx context.Context, media domain.Media) 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) Created

func (e *MediaSAGAKafkaEvent) Created(ctx context.Context, media domain.Media) error

func (*MediaSAGAKafkaEvent) VerifyAuthor

func (e *MediaSAGAKafkaEvent) VerifyAuthor(ctx context.Context, authorPool []string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL