admin

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

Package admin serves the admin API under /admin: sign-in with local accounts, cookie sessions with CSRF tokens, and the GraphQL endpoint.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Store      revision.Store
	Accounts   accounts.Store
	Introspect graph.Introspection
	// Status reports the serving process to the console; optional.
	Status func() graph.RuntimeState
	// Capabilities reports what the serving connections may do; optional.
	Capabilities func() bootstrap.EntityCapabilities
	// SecureCookie marks the session cookie Secure; set it when serving TLS.
	SecureCookie bool
	// Playground mounts GraphiQL at /admin/playground and enables GraphQL
	// schema introspection. It is a development aid.
	Playground bool
	Now        func() time.Time
}

Config wires the admin API.

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler serves /admin/*.

func New

func New(cfg Config) *Handler

New builds the admin handler.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Directories

Path Synopsis
Package accounts holds the business rules for administrator accounts.
Package accounts holds the business rules for administrator accounts.
Package auth holds what the admin HTTP layer and the GraphQL resolvers share: argon2id password hashing, admin permissions and the signed-in principal on a request context.
Package auth holds what the admin HTTP layer and the GraphQL resolvers share: argon2id password hashing, admin permissions and the signed-in principal on a request context.
Package graph implements the admin GraphQL API.
Package graph implements the admin GraphQL API.
Package ui embeds the built admin console (web/admin).
Package ui embeds the built admin console (web/admin).

Jump to

Keyboard shortcuts

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