archiver

package
v0.0.0-...-214edc1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IndexEntry

type IndexEntry struct {
	URL          string `json:"url"`
	Offset       int    `json:"offset"`
	Status       string `json:"status"`
	Length       int    `json:"length"`
	Mime         string `json:"mime"`
	Filename     string `json:"filename"`
	Digest       string `json:"digest"`
	RecordDigest string `json:"recordDigest"`
	// contains filtered or unexported fields
}

type PageEntry

type PageEntry struct {
	URL string `json:"url"`
	TS  string `json:"ts"`
}

type Reader

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

func NewReader

func NewReader(waczPath string) *Reader

func (*Reader) ReadArchive

func (s *Reader) ReadArchive(urlStr string) (content string)

ReadArchive reads the archive and returns the contents of the warc record for the specified URL as a string.

type Writer

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

func NewArchiver

func NewArchiver(waczPath string) (*Writer, error)

Returns a new Writer. It creates a new wacz file for the given url string.

func (*Writer) AddRecord

func (s *Writer) AddRecord(response *http.Response)

AddRecord adds a new response record to the warc file and keeps track of the added records to create the index once the Writer is closed.

func (*Writer) Close

func (s *Writer) Close()

Close closes the archive and creates the remaining files.

Jump to

Keyboard shortcuts

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