Versions in this module Expand all Collapse all v0 v0.1.0 Jun 13, 2026 Changes in this version + const AdvancedSearch + const BaseURL + const DefaultDelay + const DefaultRetries + const DefaultTimeout + const DetailsURL + const DownloadURL + const MetadataURL + const S3URL + const ScrapeURL + const TasksURL + const UserAgent + const ViewsURL + const WaybackAvailURL + const WaybackCDXURL + const WaybackReplay + const WaybackSaveURL + const XAuthnURL + var DefaultFields = []string + var ErrNoCredentials = errors.New("no credentials configured; run 'archive configure'") + func CDX(ctx context.Context, h *HTTPClient, q CDXQuery, fn func(CDXRecord) error) (int, error) + func ConfigDir() string + func CredentialsPath() string + func DeleteFile(ctx context.Context, h *HTTPClient, identifier, remoteName string) error + func DetailsURLFor(identifier string) string + func DownloadURLFor(identifier, name string) string + func ExtractText(body []byte) string + func ExtractTitle(body []byte) string + func GetMetadataSub(ctx context.Context, h *HTTPClient, identifier, subpath string) ([]byte, error) + func GetViews(ctx context.Context, h *HTTPClient, cache *Cache, identifiers []string) (map[string]Views, error) + func QuoteQuery(s string) string + func ReplayURL(timestamp, target string, raw bool) string + func SaveAnonymous(ctx context.Context, h *HTTPClient, target string) (string, error) + func Scrape(ctx context.Context, h *HTTPClient, q SearchQuery, limit int, ...) (int, error) + func SearchEach(ctx context.Context, h *HTTPClient, cache *Cache, q SearchQuery, limit int, ...) (int, error) + func Upload(ctx context.Context, h *HTTPClient, identifier, localPath string, ...) (string, error) + func UploadHeaders(opts UploadOptions, size int64) map[string]string + func UploadURL(identifier, remoteName string) string + func ValidIdentifier(id string) bool + type APIError struct + Status int + URL string + func (e *APIError) Error() string + type AdvancedSearchResult struct + Docs []SearchDoc + NumFound int + Start int + func Search(ctx context.Context, h *HTTPClient, cache *Cache, q SearchQuery) (AdvancedSearchResult, error) + type CDXQuery struct + Collapse string + Filters []string + From string + Limit int + MatchType string + To string + URL string + type CDXRecord struct + Digest string + Length string + MimeType string + Original string + StatusCode string + Timestamp string + URLKey string + type Cache struct + func NewCache(dir string, enabled bool) *Cache + func (c *Cache) Clear() (int, error) + func (c *Cache) Dir() string + func (c *Cache) Get(key string, ttl time.Duration) ([]byte, bool) + func (c *Cache) Put(key string, data []byte) + type Config struct + CacheDir string + DataDir string + Delay time.Duration + Retries int + Timeout time.Duration + UserAgent string + Workers int + func DefaultConfig() Config + func (c Config) DownloadDir() string + type Credentials struct + Access string + Secret string + func LoadCredentials() (*Credentials, error) + func Login(ctx context.Context, h *HTTPClient, email, password string) (*Credentials, error) + func ResolveCredentials(access, secret string) *Credentials + func (c *Credentials) AuthHeader() string + func (c *Credentials) MaskedSecret() string + func (c *Credentials) Save() error + func (c *Credentials) Valid() bool + type DownloadResult struct + Bytes int64 + File FileInfo + Path string + Skipped bool + Verified bool + func DownloadFile(ctx context.Context, h *HTTPClient, m Metadata, f FileInfo, destDir string, ...) (DownloadResult, error) + type FileInfo struct + CRC32 string + Format string + MD5 string + MtimeS string + Name string + Raw json.RawMessage + SHA1 string + SizeS string + Source string + func (f *FileInfo) UnmarshalJSON(b []byte) error + func (f FileInfo) Fields() map[string]any + func (f FileInfo) Mtime() int64 + func (f FileInfo) Size() int64 + type HTTPClient struct + func NewHTTPClient(cfg Config) *HTTPClient + func (h *HTTPClient) Delete(ctx context.Context, url string, headers map[string]string) (*http.Response, error) + func (h *HTTPClient) FetchBytes(ctx context.Context, url string) ([]byte, error) + func (h *HTTPClient) Get(ctx context.Context, url string) (*http.Response, error) + func (h *HTTPClient) GetDownload(ctx context.Context, url string) (*http.Response, error) + func (h *HTTPClient) GetJSON(ctx context.Context, url string, v any) error + func (h *HTTPClient) GetRange(ctx context.Context, url string, offset, length int64) (*http.Response, error) + func (h *HTTPClient) PostForm(ctx context.Context, rawURL string, form url.Values) ([]byte, error) + func (h *HTTPClient) Put(ctx context.Context, url string, body io.Reader, size int64, ...) (*http.Response, error) + func (h *HTTPClient) WithCredentials(c *Credentials) *HTTPClient + type Link struct + Text string + URL string + func ExtractLinks(body []byte) []Link + type MetaDict map[string]json.RawMessage + func (d MetaDict) Get(key string) string + func (d MetaDict) Strings(key string) []string + type Metadata struct + AlternateLocations json.RawMessage + Created int64 + D1 string + D2 string + Dir string + Files []FileInfo + FilesCount int + Identifier string + IsDark bool + ItemLastUpdated int64 + ItemSize int64 + Meta MetaDict + Raw json.RawMessage + Server string + Uniq int64 + WorkableServers []string + func GetMetadata(ctx context.Context, h *HTTPClient, cache *Cache, identifier string) (Metadata, error) + func (m Metadata) Exists() bool + func (m Metadata) FilterFiles(glob, format string) []FileInfo + func (m Metadata) NodeURLFor(name string) string + func (m Metadata) Title() string + type NotFoundError struct + URL string + func (e *NotFoundError) Error() string + type SPNJob struct + JobID string + Message string + Status string + Timestamp string + URL string + func Save(ctx context.Context, h *HTTPClient, target string, outlinks, screenshot bool) (SPNJob, error) + func SaveStatus(ctx context.Context, h *HTTPClient, jobID string) (SPNJob, error) + type SearchDoc map[string]json.RawMessage + func (d SearchDoc) Identifier() string + func (d SearchDoc) String(key string) string + func (d SearchDoc) TemplateValue() any + type SearchQuery struct + Fields []string + Page int + Query string + Rows int + Sorts []string + type Snapshot struct + Available bool + Status string + Timestamp string + URL string + func Available(ctx context.Context, h *HTTPClient, cache *Cache, target, timestamp string) (Snapshot, bool, error) + type Task struct + Args any + Category string + Cmd string + DateSub string + Finished int64 + Notes string + Priority int + Raw json.RawMessage + Server string + Status string + Submitter string + TaskID int64 + func GetTasks(ctx context.Context, h *HTTPClient, identifier string) ([]Task, error) + func (t *Task) UnmarshalJSON(b []byte) error + func (t Task) Fields() map[string]any + type UploadOptions struct + ContentType string + MakeBucket bool + Metadata map[string]string + NoDerive bool + RemoteName string + type Views struct + AllTime int64 + HaveData bool + Last30 int64 + Last7 int64