application

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemoryPostRepository

type InMemoryPostRepository interface {
	UpdateFollowerPosts(
		ctx context.Context,
		followerID uuid.UUID,
		posts []domain.Post,
	) (err error)
}

type PostRepository

type PostRepository interface {
	CreatePost(
		context.Context,
		domain.Post,
	) error

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

type Publisher

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

type Service

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

func NewService

func NewService(
	postRepository PostRepository,
	inmemoryPostsRepository InMemoryPostRepository,
	profileRepository profile.Repository,
	publisher Publisher,
) *Service

func (Service) CreatePost

func (s Service) CreatePost(ctx context.Context, post domain.Post) (domain.Post, error)

func (Service) GetPosts

func (s Service) GetPosts(
	ctx context.Context,
	authorID, followerID uuid.UUID,
	offset, limit int,
) ([]domain.Post, error)

func (Service) UpdateNewsLines

func (s Service) UpdateNewsLines(ctx context.Context, followers []uuid.UUID) error

func (Service) UpdateNewsLinesByPost

func (s Service) UpdateNewsLinesByPost(ctx context.Context, post domain.Post) error

Jump to

Keyboard shortcuts

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