render

package
v0.0.0-...-4d5cdd4 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsContextWrite

func AsContextWrite(writer io.Writer, content any) error

func AsPresenter

func AsPresenter(writer io.Writer, content any) error

func GetRenderers

func GetRenderers() []string

func RegisterRenderer

func RegisterRenderer(renderer string, render RenderFunc)

The render function can be nil, in which case no rendering will occur.

func Render

func Render(writer io.Writer, content any, renderer string, js bool, jsContext *commonjs.Context) error

Special handling for string, []byte, and io.Reader.

func RenderToBytes

func RenderToBytes(content any, renderer string, js bool, jsContext *commonjs.Context) ([]byte, error)

Special handling for string, []byte, and io.Reader.

func RenderToString

func RenderToString(content any, renderer string, js bool, jsContext *commonjs.Context) (string, error)

Special handling for string, []byte, and io.Reader.

func ToBytes

func ToBytes(content any) ([]byte, error)

Special handling for io.Reader.

func ToReader

func ToReader(content any) io.Reader

func ToRuneReader

func ToRuneReader(content any) io.RuneReader

func ToString

func ToString(content any) (string, error)

Special handling for io.Reader.

func Write

func Write(writer io.Writer, content any) (int, error)

Special handling for nil, string, []byte, and io.Reader.

func WritePresentEnd

func WritePresentEnd(writer io.Writer) error

func WritePresentStart

func WritePresentStart(writer io.Writer) error

func WriteRune

func WriteRune(writer io.Writer, rune_ rune) (int, error)

func WriteString

func WriteString(writer io.Writer, content string) (int, error)

Types

type RenderFunc

type RenderFunc func(writer io.Writer, content any, js bool, jsContext *commonjs.Context) error

Special handling for string, []byte, and io.Reader.

func GetRenderer

func GetRenderer(renderer string) (RenderFunc, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳