opengraph

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileInfo

type FileInfo struct {
	ID        string
	Type      string
	Size      uint64
	UpdatedAt time.Time
}

FileInfo contains the metadata displayed on an OG image.

type Fonts

type Fonts struct {
	Regular     []byte
	Display     []byte
	DisplayLine []byte
}

Fonts holds the raw TTF data needed for image generation.

type Renderer

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

Renderer holds parsed fonts and a pre-loaded logo for generating OG images.

func NewRenderer

func NewRenderer(fonts *Fonts, logo image.Image) (*Renderer, error)

NewRenderer parses fonts and prepares a reusable renderer.

func (*Renderer) WriteImage added in v0.13.0

func (r *Renderer) WriteImage(w io.Writer, info *FileInfo) error

WriteImage writes a 1200x630 PNG open graph image to w.

Jump to

Keyboard shortcuts

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