endpoints

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

This section is empty.

Functions

func NewCreatePostEndpoint

func NewCreatePostEndpoint(s Service) endpoint.Endpoint

func NewGetPostsEndpoint

func NewGetPostsEndpoint(s Service) endpoint.Endpoint

func NewUpdateNewsLineEndpoint

func NewUpdateNewsLineEndpoint(s Service) endpoint.Endpoint

func NewUpdateNewsLinesByPostEndpoint

func NewUpdateNewsLinesByPostEndpoint(s Service) endpoint.Endpoint

Types

type CreatePostRequest

type CreatePostRequest struct {
	domain.Post
}

type CreatePostResponse

type CreatePostResponse struct {
	domain.Post
	Err error `json:"-"`
}

func (CreatePostResponse) Failed

func (p CreatePostResponse) Failed() error

Failed implements endpoint.Failer.

type GetPostsRequest

type GetPostsRequest struct {
	AuthorID   uuid.UUID
	FollowerID uuid.UUID
	Limit      int
	Offset     int
}

type GetPostsResponse

type GetPostsResponse struct {
	Posts []domain.Post `json:"data"`
	Err   error         `json:"-"`
}

func (GetPostsResponse) Failed

func (p GetPostsResponse) Failed() error

Failed implements endpoint.Failer.

type Service

type Service interface {
	CreatePost(
		ctx context.Context,
		msg domain.Post,
	) (domain.Post, error)

	GetPosts(
		ctx context.Context,
		profileID, recipientID uuid.UUID,
		offset, limit int,
	) ([]domain.Post, error)

	UpdateNewsLines(ctx context.Context, followers []uuid.UUID) error
	UpdateNewsLinesByPost(context.Context, domain.Post) error
}

type Set

type Set struct {
	CreatePostEndpoint            endpoint.Endpoint
	GetPostsEndpoint              endpoint.Endpoint
	UpdateNewsLinesEndpoint       endpoint.Endpoint
	UpdateNewsLinesByPostEndpoint endpoint.Endpoint
}

func New

func New(svc Service) Set

type UpdateNewsLinesByPostRequest

type UpdateNewsLinesByPostRequest struct {
	Post domain.Post
}

type UpdateNewsLinesRequest

type UpdateNewsLinesRequest struct {
	Followers []uuid.UUID
}

Jump to

Keyboard shortcuts

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