note

package
v0.0.0-...-f767cfc Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCreateNoteAlreadyExist = func() error { return domain.ErrNoteAlreadyExist }()
View Source
var ErrDeleteNoteNotFound = func() error { return domain.ErrNoteNotFound }()
View Source
var ErrGetNoteNotFound = func() error { return domain.ErrNoteNotFound }()
View Source
var ErrGetNotesAsyncNotFound = func() error { return domain.ErrNoteNotFound }()
View Source
var ErrGetNotesNotFound = func() error { return domain.ErrNoteNotFound }()
View Source
var ErrUpdateNoteNotFound = func() error { return domain.ErrNoteNotFound }()

Functions

This section is empty.

Types

type CreateNoteRequest

type CreateNoteRequest struct {
	Title   string
	Content string
	UserID  string

	Priority       *string
	CompletionTime *time.Time
}

type CreateNoteRequestHandler

type CreateNoteRequestHandler interface {
	Handle(ctx context.Context, request CreateNoteRequest) (CreateNoteResponse, error)
}

func NewCreateNoteRequestHandler

func NewCreateNoteRequestHandler(noteSaver NoteSaver) CreateNoteRequestHandler

type CreateNoteResponse

type CreateNoteResponse struct {
	ID     string
	UserID string
}

type DeleteNoteRequest

type DeleteNoteRequest struct {
	ID string
}

type DeleteNoteRequestHandler

type DeleteNoteRequestHandler interface {
	Handle(ctx context.Context, request DeleteNoteRequest) (DeleteNoteResponse, error)
}

func NewDeleteNoteRequestHandler

func NewDeleteNoteRequestHandler(noteDeleter NoteDeleter) DeleteNoteRequestHandler

type DeleteNoteResponse

type DeleteNoteResponse struct {
}

type GetNoteRequest

type GetNoteRequest struct {
	ID string
}

type GetNoteRequestHandler

type GetNoteRequestHandler interface {
	Handle(ctx context.Context, request GetNoteRequest) (GetNoteResponse, error)
}

func NewGetNoteRequestHandler

func NewGetNoteRequestHandler(noteFinder NoteFinder) GetNoteRequestHandler

type GetNoteResponse

type GetNoteResponse struct {
	Title          string
	Content        string
	UserID         string
	CreatedAt      time.Time
	Priority       *string
	CompletionTime *time.Time
}

type GetNotesAsyncRequest

type GetNotesAsyncRequest struct {
	UserID string
}

type GetNotesAsyncRequestHandler

type GetNotesAsyncRequestHandler interface {
	Handle(ctx context.Context, request GetNotesAsyncRequest) (GetNotesAsyncResponse, <-chan error)
}

func NewGetNotesAsyncRequestHandler

func NewGetNotesAsyncRequestHandler(noteFinder NoteFinder) GetNotesAsyncRequestHandler

type GetNotesAsyncResponse

type GetNotesAsyncResponse struct {
	Notes <-chan domain.Note
}

type GetNotesRequest

type GetNotesRequest struct {
	UserID string
}

type GetNotesRequestHandler

type GetNotesRequestHandler interface {
	Handle(ctx context.Context, request GetNotesRequest) (GetNotesResponse, error)
}

func NewGetNotesRequestHandler

func NewGetNotesRequestHandler(noteFinder NoteFinder) GetNotesRequestHandler

type GetNotesResponse

type GetNotesResponse struct {
	Notes []domain.Note
}

type NoteDeleter

type NoteDeleter interface {
	DeleteOne(ctx context.Context, noteID string) error
}

type NoteFinder

type NoteFinder interface {
	FindOne(ctx context.Context, noteID string) (domain.Note, error)
	FindMany(ctx context.Context, userID string) ([]domain.Note, error)
	FindManyAsync(ctx context.Context, userID string) (<-chan domain.Note, <-chan error)
}

type NoteSaver

type NoteSaver interface {
	SaveOne(ctx context.Context, note domain.Note) error
}

type NoteUpdater

type NoteUpdater interface {
	UpdateOne(ctx context.Context, note domain.Note) error
}

type UpdateNoteRequest

type UpdateNoteRequest struct {
	ID                string
	NewTitle          string
	NewContent        string
	NewPriority       *string
	NewCompletionTime *time.Time
}

type UpdateNoteRequestHandler

type UpdateNoteRequestHandler interface {
	Handle(ctx context.Context, request UpdateNoteRequest) (UpdateNoteResponse, error)
}

func NewUpdateNoteRequestHandler

func NewUpdateNoteRequestHandler(noteUpdater NoteUpdater) UpdateNoteRequestHandler

type UpdateNoteResponse

type UpdateNoteResponse struct {
}

Jump to

Keyboard shortcuts

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