normalisers

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitHubIssueNormaliser

type GitHubIssueNormaliser struct{}

GitHubIssueNormaliser handles GitHub issue content. It preserves Markdown formatting while cleaning up issue-specific artifacts.

func (*GitHubIssueNormaliser) Normalise

func (n *GitHubIssueNormaliser) Normalise(content string, mimeType string) string

func (*GitHubIssueNormaliser) Priority

func (n *GitHubIssueNormaliser) Priority() int

func (*GitHubIssueNormaliser) SupportedTypes

func (n *GitHubIssueNormaliser) SupportedTypes() []string

type GitHubPRNormaliser

type GitHubPRNormaliser struct{}

GitHubPRNormaliser handles GitHub pull request content. It preserves Markdown formatting while cleaning up PR-specific artifacts.

func (*GitHubPRNormaliser) Normalise

func (n *GitHubPRNormaliser) Normalise(content string, mimeType string) string

func (*GitHubPRNormaliser) Priority

func (n *GitHubPRNormaliser) Priority() int

func (*GitHubPRNormaliser) SupportedTypes

func (n *GitHubPRNormaliser) SupportedTypes() []string

type HTMLNormaliser

type HTMLNormaliser struct{}

HTMLNormaliser handles HTML content.

func (*HTMLNormaliser) Normalise

func (n *HTMLNormaliser) Normalise(content string, mimeType string) string

func (*HTMLNormaliser) Priority

func (n *HTMLNormaliser) Priority() int

func (*HTMLNormaliser) SupportedTypes

func (n *HTMLNormaliser) SupportedTypes() []string

type MarkdownNormaliser

type MarkdownNormaliser struct{}

MarkdownNormaliser handles Markdown content.

func (*MarkdownNormaliser) Normalise

func (n *MarkdownNormaliser) Normalise(content string, mimeType string) string

func (*MarkdownNormaliser) Priority

func (n *MarkdownNormaliser) Priority() int

func (*MarkdownNormaliser) SupportedTypes

func (n *MarkdownNormaliser) SupportedTypes() []string

type PlaintextNormaliser

type PlaintextNormaliser struct{}

PlaintextNormaliser handles plain text content.

func (*PlaintextNormaliser) Normalise

func (n *PlaintextNormaliser) Normalise(content string, mimeType string) string

func (*PlaintextNormaliser) Priority

func (n *PlaintextNormaliser) Priority() int

func (*PlaintextNormaliser) SupportedTypes

func (n *PlaintextNormaliser) SupportedTypes() []string

type Registry

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

Registry implements NormaliserRegistry with priority-based selection. When multiple normalisers match a MIME type, the highest priority one is used.

func DefaultRegistry

func DefaultRegistry() *Registry

DefaultRegistry creates a registry with common normalisers pre-registered.

func NewRegistry

func NewRegistry() *Registry

NewRegistry creates a new normaliser registry.

func (*Registry) Get

func (r *Registry) Get(mimeType string) driven.Normaliser

Get retrieves the best-matching normaliser for a MIME type. Returns nil if no normaliser is registered for the type. When multiple match, the highest priority normaliser is returned.

func (*Registry) GetAll

func (r *Registry) GetAll(mimeType string) []driven.Normaliser

GetAll retrieves all normalisers that match a MIME type, sorted by priority (highest first).

func (*Registry) List

func (r *Registry) List() []string

List returns all registered MIME types.

func (*Registry) Register

func (r *Registry) Register(normaliser driven.Normaliser)

Register registers a normaliser. Normalisers are stored and later selected by priority.

Jump to

Keyboard shortcuts

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