geodata

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package geodata owns verified asset downloads and their single refresh schedule.

Index

Constants

View Source
const MaxAssetBytes = 128 << 20
View Source
const MaxGroupBytes = 256 << 20

Variables

This section is empty.

Functions

func Ensure

func Ensure(ctx context.Context, dir string, p Policy, hashes map[string]string, client *http.Client, refresh bool) error

func Next

func Next(p Policy, now time.Time) time.Time

func Resolve

func Resolve(dir string) string

Resolve returns one immutable generation so a runtime never sees a mixed GeoIP/GeoSite pair.

Types

type Asset

type Asset struct {
	URL  string `json:"url"`
	File string `json:"file"`
}

type Policy

type Policy struct {
	Cron     string  `json:"cron,omitempty"`
	Outbound string  `json:"outbound,omitempty"`
	Assets   []Asset `json:"assets"`
}

func FromNative

func FromNative(raw json.RawMessage) (Policy, error)

Jump to

Keyboard shortcuts

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