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, key 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, key 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, key string)

Remove an entity from a store

func Store

func Store(ctx context.Context, c *redis.Client, id, key 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, key string, entity interface{}) error

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

Types

type AuthorBuilder

type AuthorBuilder struct {
	Statement string
}

func (*AuthorBuilder) Active

func (b *AuthorBuilder) Active(state string) *AuthorBuilder

Active return a query to search by entity's state

func (*AuthorBuilder) And

func (b *AuthorBuilder) And() *AuthorBuilder

And returns a query with the AND statement

func (*AuthorBuilder) Country

func (b *AuthorBuilder) Country(countryCode string) *AuthorBuilder

func (*AuthorBuilder) DisplayName

func (b *AuthorBuilder) DisplayName(displayName string) *AuthorBuilder

DisplayName returns a query to search by display_name field

func (*AuthorBuilder) Filter

func (b *AuthorBuilder) Filter(key, op, id, state string) *AuthorBuilder

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 (*AuthorBuilder) Limit

func (b *AuthorBuilder) Limit(limit int) *AuthorBuilder

Limit returns a query with a limiter, useful for pagination

func (*AuthorBuilder) Or

func (b *AuthorBuilder) Or() *AuthorBuilder

Or returns a query with the OR statement

func (*AuthorBuilder) OrderBy

func (b *AuthorBuilder) OrderBy(key, def, param string) *AuthorBuilder

OrderBy returns a query for ordering

key = field, def = default order, param = sorting from params, will replace default value

func (*AuthorBuilder) Owner

func (b *AuthorBuilder) Owner(ownerID string) *AuthorBuilder

Owner returns a query to search by owner from owner_pool

func (*AuthorBuilder) Ownership

func (b *AuthorBuilder) Ownership(ownershipType string) *AuthorBuilder

Ownership returns a query to search by ownership_type field

func (*AuthorBuilder) Query

func (b *AuthorBuilder) Query(query string) *AuthorBuilder

Query returns a query from most important fields

func (*AuthorBuilder) Raw

func (b *AuthorBuilder) Raw(statement string) *AuthorBuilder

Raw returns a query with the raw SQL query

type AuthorKafkaEventBus

type AuthorKafkaEventBus struct {
	// contains filtered or unexported fields
}

func NewAuthorKafkaEventBus

func NewAuthorKafkaEventBus(cfg *config.Kernel) *AuthorKafkaEventBus

func (*AuthorKafkaEventBus) HardRemoved

func (b *AuthorKafkaEventBus) HardRemoved(ctx context.Context, id string) error

func (*AuthorKafkaEventBus) Removed

func (b *AuthorKafkaEventBus) Removed(ctx context.Context, id string) error

func (*AuthorKafkaEventBus) Restored

func (b *AuthorKafkaEventBus) Restored(ctx context.Context, id string) error

func (*AuthorKafkaEventBus) StartCreate

func (b *AuthorKafkaEventBus) StartCreate(ctx context.Context, author domain.Author) error

func (*AuthorKafkaEventBus) StartUpdate

func (b *AuthorKafkaEventBus) StartUpdate(ctx context.Context, author domain.Author, snapshot domain.Author) error

func (*AuthorKafkaEventBus) Updated

func (b *AuthorKafkaEventBus) Updated(ctx context.Context, author domain.Author) error

type AuthorPQRepository

type AuthorPQRepository struct {
	// contains filtered or unexported fields
}

AuthorPQRepository DBMS Author repository

func NewAuthorPQRepository

func NewAuthorPQRepository(dbPool *sql.DB, memPool *redis.Client, logger log.Logger) *AuthorPQRepository

NewAuthorPQRepository Create an author repository

func (*AuthorPQRepository) ChangeState

func (r *AuthorPQRepository) ChangeState(ctx context.Context, id, state string) error

func (*AuthorPQRepository) Fetch

func (r *AuthorPQRepository) Fetch(ctx context.Context, params core.PaginationParams, filterParams core.FilterParams) ([]*domain.Author, error)

func (*AuthorPQRepository) FetchByID

func (r *AuthorPQRepository) FetchByID(ctx context.Context, id string, showDisabled bool) (*domain.Author, error)

func (*AuthorPQRepository) HardRemove

func (r *AuthorPQRepository) HardRemove(ctx context.Context, id string) error

func (*AuthorPQRepository) Remove

func (r *AuthorPQRepository) Remove(ctx context.Context, id string) error

func (*AuthorPQRepository) Replace

func (r *AuthorPQRepository) Replace(ctx context.Context, author domain.Author) error

func (*AuthorPQRepository) Restore

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

func (*AuthorPQRepository) Save

func (r *AuthorPQRepository) Save(ctx context.Context, author domain.Author) error

func (*AuthorPQRepository) SaveRaw

func (r *AuthorPQRepository) SaveRaw(ctx context.Context, author domain.Author) error

type AuthorSAGAKafkaEventBus

type AuthorSAGAKafkaEventBus struct {
	// contains filtered or unexported fields
}

func NewAuthorSAGAKafkaEventBus

func NewAuthorSAGAKafkaEventBus(cfg *config.Kernel) *AuthorSAGAKafkaEventBus

func (*AuthorSAGAKafkaEventBus) BlobFailed

func (e *AuthorSAGAKafkaEventBus) BlobFailed(ctx context.Context, msg string) error

func (*AuthorSAGAKafkaEventBus) Created

func (e *AuthorSAGAKafkaEventBus) Created(ctx context.Context, author domain.Author) error

func (*AuthorSAGAKafkaEventBus) Failed

func (e *AuthorSAGAKafkaEventBus) Failed(ctx context.Context, service, msg string) error

func (*AuthorSAGAKafkaEventBus) Verified

func (e *AuthorSAGAKafkaEventBus) Verified(ctx context.Context, service string) error

Jump to

Keyboard shortcuts

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