cache

package
v1.0.0-rc.5 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCacheIsNotSet = errors.New("cache is not set")
)

Functions

This section is empty.

Types

type InMemoryPostsLimit

type InMemoryPostsLimit int

type InmemoryPostRepository

type InmemoryPostRepository interface {
	GetPosts(
		ctx context.Context,
		followerID uuid.UUID,
		offset, limit int64,
	) (posts []domain.Post, err error)
	UpdateFollowerPosts(
		ctx context.Context,
		followerID uuid.UUID,
		posts []domain.Post,
	) (err error)
}

type PersistentPostRepository

type PersistentPostRepository interface {
	GetPosts(
		ctx context.Context,
		authorID uuid.UUID,
		followerID uuid.UUID,
		offset, limit int,
	) (posts []domain.Post, err error)
	CreatePost(
		ctx context.Context,
		msg domain.Post,
	) error
}

type PostRepository

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

func NewCacheablePostRepository

func NewCacheablePostRepository(
	inmemory InmemoryPostRepository,
	persistent PersistentPostRepository,
	publisher Publisher,
	inMemoryLimit InMemoryPostsLimit,
) *PostRepository

func (PostRepository) CreatePost

func (r PostRepository) CreatePost(
	ctx context.Context,
	post domain.Post,
) error

func (PostRepository) GetPosts

func (r PostRepository) GetPosts(
	ctx context.Context,
	authorID uuid.UUID,
	followerID uuid.UUID,
	offset, limit int,
) (posts []domain.Post, err error)

type Publisher

type Publisher interface {
	PublishUpdateNewsLinesCommand(ctx context.Context, followers []uuid.UUID) error
}

Jump to

Keyboard shortcuts

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