adminhttp

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package adminhttp exposes a mountable, auth-agnostic JSON CRUD handler for managing flagpole feature definitions. Wrap it with your own auth middleware.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(store Store) http.Handler

NewHandler returns an http.Handler serving:

GET    /flags          -> {key: Feature}
PUT    /flags/{key}     -> upsert (body = Feature JSON)
DELETE /flags/{key}     -> archive

Types

type Store

type Store interface {
	List(ctx context.Context) (map[string]flagpole.Feature, error)
	Upsert(ctx context.Context, key string, f flagpole.Feature) error
	Archive(ctx context.Context, key string) error
}

Store is the persistence the admin handler operates on. A Postgres-backed implementation typically lives next to your sourcepg setup.

Archive should be idempotent: implementations should return nil even when the key does not exist (the handler responds 200 either way).

Jump to

Keyboard shortcuts

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