format

package
v0.0.0-...-89d9964 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownType = errors.New("unknown content type")

Functions

func Parse

func Parse(reader io.Reader, mime string, charset string) (urlpreview.Preview, error)

Types

type FilePreview

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

func NewFilePreview

func NewFilePreview(name string, mime string, size uint64) FilePreview

func (*FilePreview) ContentType

func (p *FilePreview) ContentType() string

func (*FilePreview) Description

func (p *FilePreview) Description() string

func (*FilePreview) FileName

func (p *FilePreview) FileName() string

func (*FilePreview) Size

func (p *FilePreview) Size() uint64

func (*FilePreview) String

func (p *FilePreview) String() string

func (*FilePreview) Title

func (p *FilePreview) Title() string

type GeminiPreview

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

func ParseGemini

func ParseGemini(reader io.Reader, charset string) (*GeminiPreview, error)

func (*GeminiPreview) String

func (p *GeminiPreview) String() string

func (*GeminiPreview) Title

func (p *GeminiPreview) Title() string

type HTMLPreview

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

func ParseHTML

func ParseHTML(reader io.Reader, charset string) (*HTMLPreview, error)

func (*HTMLPreview) ContentType

func (p *HTMLPreview) ContentType() string

func (*HTMLPreview) Description

func (p *HTMLPreview) Description() string

func (*HTMLPreview) String

func (p *HTMLPreview) String() string

func (*HTMLPreview) Title

func (p *HTMLPreview) Title() string

type XHTMLPreview

type XHTMLPreview struct {
	HTMLPreview
}

func ParseXHTML

func ParseXHTML(reader io.Reader, charset string) (*XHTMLPreview, error)

func (*XHTMLPreview) ContentType

func (p *XHTMLPreview) ContentType() string

type XMLNode

type XMLNode struct {
	XMLName xml.Name
	Attr    []xml.Attr `xml:",any,attr"`
	Text    string     `xml:",chardata"`
	Nodes   []*XMLNode `xml:",any"`
}

Jump to

Keyboard shortcuts

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