Documentation
¶
Index ¶
Constants ¶
View Source
const ( // BaseURL is the ethpandaops devnet spec namespace on // notes.ethereum.org. The network id is appended to form the page URL. BaseURL = "https://notes.ethereum.org/@ethpandaops/" HTTPTimeout = 15 * time.Second // MaxBytes caps the markdown download size. MaxBytes = 2 << 20 // 2 MiB )
Variables ¶
View Source
var AllowedHosts = map[string]bool{ "notes.ethereum.org": true, "hackmd.io": true, }
AllowedHosts restricts spec fetches to the notes.ethereum.org / HackMD surfaces, both as an SSRF guard on caller-supplied urls and to keep the operation focused on devnet spec documents.
Functions ¶
func ResolveURL ¶
ResolveURL builds the spec page URL for a network, honoring an optional caller override. The host must be on the allowlist.
Types ¶
type Response ¶
type Response struct {
Network string `json:"network"`
URL string `json:"url"`
Title string `json:"title,omitempty"`
Notices []string `json:"notices,omitempty"`
EIPs []EIP `json:"eips,omitempty"`
SystemContracts []SystemContract `json:"system_contracts,omitempty"`
Releases []Release `json:"releases,omitempty"`
ParticipantImages []Image `json:"participant_images,omitempty"`
MetricsURL string `json:"metrics_url,omitempty"`
PreviousSpecURL string `json:"previous_spec_url,omitempty"`
}
Response is the compact, LLM-oriented spec digest embedded in networks://{id} resources.
func FetchAndParse ¶
func FetchAndParse(ctx context.Context, client *http.Client, id, override string) (*Response, int, error)
FetchAndParse downloads the conventional or overridden spec page and returns the compact digest. Missing pages are returned as HTTP 404 errors so callers can decide whether that is fatal for their surface.
Click to show internal directories.
Click to hide internal directories.