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 ¶
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).
Click to show internal directories.
Click to hide internal directories.