Help us shape the future of Go! Take the 2026 Go Developer Survey

mapsapi

package
v1.145.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package mapsapi is the admin REST surface for the maps settings (#2068): whether maps are on and where their archives are written, the regions kept, a refresh of one, and the size a region would be before it is saved.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(mux *http.ServeMux, wrap func(http.Handler) http.Handler, cfg Config)

Register mounts the maps routes, each behind wrap, the admin API's authentication.

Types

type Config

type Config struct {
	// Service is the maps surface. nil mounts nothing.
	Service Service
	// BucketOf names the bucket archives go to under a settings value.
	BucketOf maps.ResolvedBucket
	// Author resolves the acting admin.
	Author func(*http.Request) string
}

Config carries the service and the parent-owned helpers.

type Service

type Service interface {
	View(ctx context.Context, bucketOf maps.ResolvedBucket) (maps.View, error)
	SaveSettings(ctx context.Context, in maps.SettingsInput, author string) error
	AddRegion(ctx context.Context, in maps.RegionInput, author string) (*maps.Region, error)
	RefreshRegion(ctx context.Context, id string) (*maps.Region, error)
	DeleteRegion(ctx context.Context, id string) error
	Estimate(ctx context.Context, in maps.EstimateInput) (maps.Estimate, error)
}

Service is what the routes act through. *maps.Service satisfies it.

Jump to

Keyboard shortcuts

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