Skip to content

v2: Implement ParseOptions and Update Parser API #244

@mmcdole

Description

@mmcdole

Overview

Implement the new ParseOptions structure and update all parser APIs to accept it as part of gofeed v2.

Tasks

  • Create ParseOptions struct with the following fields:

    • KeepOriginalFeed bool - Retain reference to original format-specific feed
    • StrictnessOptions - Sub-struct for parsing strictness controls
    • RequestOptions - HTTP request configuration for ParseURL
      • UserAgent string
      • Timeout time.Duration
      • IfNoneMatch string (ETag support)
      • IfModifiedSince time.Time (conditional requests)
      • Client *http.Client (custom HTTP client support)
    • Other parsing toggles (e.g., ParseDates bool)
  • Update universal parser (gofeed.Parser) methods:

    • Parse(io.Reader, *ParseOptions) (*Feed, error)
    • ParseURL(string, *ParseOptions) (*Feed, error)
    • ParseString(string, *ParseOptions) (*Feed, error)
  • Implement DefaultParseOptions() function for common use cases

Related Issues

Parent Issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    v2Version 2 related issues

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions