server

package
v0.0.0-...-77320a0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequestID

func RequestID(ctx context.Context) string

RequestID is preserved as a thin wrapper for callers that imported it from this package before reqid was extracted.

Types

type Config

type Config struct {
	Addr     string
	Logger   *slog.Logger
	Registry cluster.Registry

	// Auth bundles the API middleware + optional /auth/* handlers
	// (login/callback/logout for OIDC). Required — server.New panics on nil.
	Auth *auth.AuthSet

	// Policy is consulted by handlers to filter results per identity.
	// The zero value denies everything; main.go uses
	// auth.DefaultAllowAllPolicy when --rbac-file is not provided.
	Policy auth.Policy

	// Audit receives one Record per privileged action. nil → no-op
	// (but main.go always provides one writing to stdout).
	Audit *audit.Logger

	// Hub is the watch event bus consumed by /api/v1/stream. nil
	// is allowed (the stream still emits heartbeats).
	Hub *watch.Hub
}

type Server

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

func New

func New(cfg Config) *Server

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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