blog

package
v0.0.0-...-7c5da1f Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPostNotFound = errors.New("post not found")

Functions

This section is empty.

Types

type ListPostsUseCase

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

func NewListPostsUseCase

func NewListPostsUseCase(
	postRepo PostRepo,
	renderer Renderer,
	cache shared.Cache,
) *ListPostsUseCase

func (*ListPostsUseCase) Run

func (u *ListPostsUseCase) Run() ([]RenderedPost, error)

type Post

type Post struct {
	Title       string
	Author      string
	Time        time.Time
	Path        string
	Description string
	ImagePath   string
	Markdown    string
}

type PostRepo

type PostRepo interface {
	GetPostByPath(path string) (Post, error)
	GetAllPosts() ([]Post, error)
}

type RenderedPost

type RenderedPost struct {
	Post Post
	HTML string
}

type Renderer

type Renderer interface {
	Render(content string) (string, error)
}

type ViewPostUseCase

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

func NewViewPostUseCase

func NewViewPostUseCase(
	postRepo PostRepo,
	renderer Renderer,
	cache shared.Cache,
) *ViewPostUseCase

func (*ViewPostUseCase) Run

func (u *ViewPostUseCase) Run(path string) (RenderedPost, error)

Jump to

Keyboard shortcuts

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