opengraph

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 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) GenerateImage

func (r *Renderer) GenerateImage(info *FileInfo) ([]byte, error)

GenerateImage creates a 1200x630 PNG open graph image.

Jump to

Keyboard shortcuts

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