converter

package
v0.0.0-...-241dfce Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheEntry

type CacheEntry struct {
	URL         string    `json:"url"`
	Markdown    string    `json:"markdown"`
	LastFetched time.Time `json:"last_fetched"`
}

CacheEntry represents a cached conversion result

type Config

type Config struct {
	CacheDuration time.Duration
	CachePath     string
	Timeout       time.Duration
	UserAgent     string
}

Config holds the configuration for the converter

type Converter

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

Converter handles webpage to markdown conversion with caching

func NewConverter

func NewConverter(config Config) (*Converter, error)

NewConverter creates a new converter instance

func (*Converter) Close

func (c *Converter) Close() error

Close cleans up resources

func (*Converter) Convert

func (c *Converter) Convert(ctx context.Context, url string) (string, error)

Convert fetches a webpage and converts it to markdown, using cache when available

Jump to

Keyboard shortcuts

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