renderer

package
v3.0.0-pre-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewErrIncorrectType

func NewErrIncorrectType(want, got any) error

func NewErrMissingHandler

func NewErrMissingHandler(t any) error

Types

type Debug

type Debug struct{}

func (*Debug) Render

func (d *Debug) Render(ctx context.Context, m *slack.Message) (v template.HTML)

func (*Debug) RenderText

func (d *Debug) RenderText(ctx context.Context, s string) (v template.HTML)

type ErrIncorrectBlockType

type ErrIncorrectBlockType struct {
	Caller string
	Want   any
	Got    any
}

func (*ErrIncorrectBlockType) Error

func (e *ErrIncorrectBlockType) Error() string

type ErrMissingHandler

type ErrMissingHandler struct {
	Caller string
	Type   any
}

func (*ErrMissingHandler) Error

func (e *ErrMissingHandler) Error() string

type Goldmark

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

func NewGoldmark

func NewGoldmark() *Goldmark

func (*Goldmark) Render

func (g *Goldmark) Render(s string) (v template.HTML)

type Renderer

type Renderer interface {
	RenderText(ctx context.Context, s string) (v template.HTML)
	Render(ctx context.Context, m *slack.Message) (v template.HTML)
}

type Slack

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

func NewSlack

func NewSlack(tmpl *template.Template, opts ...SlackOption) *Slack

func (*Slack) Render

func (s *Slack) Render(ctx context.Context, m *slack.Message) (v template.HTML)

func (*Slack) RenderText

func (*Slack) RenderText(ctx context.Context, s string) (v template.HTML)

type SlackOption

type SlackOption func(*Slack)

func WithChannels

func WithChannels(cc map[string]slack.Channel) SlackOption

func WithUsers

func WithUsers(uu map[string]slack.User) SlackOption

Directories

Path Synopsis
Package functions provides shared template functions.
Package functions provides shared template functions.

Jump to

Keyboard shortcuts

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