runners

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RendererRunner

type RendererRunner struct {
	queue.BaseRunner
	// contains filtered or unexported fields
}

RendererRunner is a runner is registered with the queue agent that knows how to render markdown text to HTML.

func NewRendererRunner

func NewRendererRunner(server rsstorage.StorageServer) *RendererRunner

func (*RendererRunner) Run

type RendererWork

type RendererWork struct {
	Markdown string
	SHA      string
}

RendererWork is the work that gets serialized and "Pushed" into the queue when we need to render markdown to HTML.

func NewRendererWork

func NewRendererWork(markdown string) (RendererWork, error)

func (RendererWork) Address

func (w RendererWork) Address() string

Address is used to determine the file name for storing the rendered HTML. Since the address includes the SHA of the provided markdown, we can guarantee a unique address. Additionally, if rendering is requested for the same markdown again, the address will match an existing item in the cache.

func (RendererWork) Dir

func (w RendererWork) Dir() string

Dir specifies a subdirectory in which to store an item on the storage server. If blank, no subdirectory will be used.

func (RendererWork) Type

func (RendererWork) Type() uint64

Jump to

Keyboard shortcuts

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