embedgen

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractURLs

func ExtractURLs(text string) []string

Types

type Config

type Config struct {
	HTTPClient            *http.Client
	Cache                 cache.Cache
	CacheTTL              time.Duration
	NegativeCacheTTL      time.Duration
	ExcludedURLPatterns   []string
	AllowPrivateHosts     bool
	FetchTimeout          time.Duration
	MaxBodyBytes          int64
	UserAgent             string
	YouTubeOEmbedEndpoint string
	YouTubeEmbedBaseURL   string
}

type Generator

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

func New

func New(cfg Config) (*Generator, error)

func (*Generator) Generate

func (g *Generator) Generate(ctx context.Context, text string, manualEmbeds []embed.Embed) ([]embed.Embed, error)

func (*Generator) GenerateURL

func (g *Generator) GenerateURL(ctx context.Context, rawURL string) (*embed.Embed, error)

Jump to

Keyboard shortcuts

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