v2

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: AGPL-3.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package v2 defines version 2 of the on-disk named IP-origin cache.

Index

Constants

View Source
const Version = 2

Version is the cache format this package defines.

Variables

View Source
var Storage = apispec.Storage{
	Format: apispec.JSON,
	Types:  []reflect.Type{reflect.TypeFor[Cache]()},
}

Storage is the schema specification of the IP-origin cache file.

Immutable

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// Version identifies the format; a reader discards a cache whose Version
	// differs and rebuilds it, with no migration.
	Version int `json:"version"`
	// Origins holds the entry of each named IP origin.
	Origins map[string]Entry `json:"origins"`
}

Cache is the cache file.

type Entry

type Entry struct {
	Updated  apidto.Time `json:"updated"`
	Prefixes []string    `json:"prefixes"`
}

Entry contains the origin CIDRs and their refresh timestamp.

Jump to

Keyboard shortcuts

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