core

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Core

type Core struct {
	Config          *config.AppConfig
	ConfigContainer *goconfig.Container[*config.AppConfig]
	Logger          *slog.Logger
	StartedAt       time.Time

	Server router.Server[*fiber.App]
	Router router.Router[*fiber.App]
	Fiber  *fiber.App

	Admin              *admin.Admin
	Authenticator      *admin.GoAuthAuthenticator
	AuthCookieName     string
	FeatureGate        fggate.FeatureGate
	Auther             *auth.Auther
	RouteAuthenticator *auth.RouteAuthenticator
	DemoCredentials    []DemoCredential
	DemoIdentity       DemoIdentity
	DemoToken          string
}

Core is a lightweight dependency container for the admin shell.

func New

func New(ctx context.Context, cfg *config.AppConfig, container *goconfig.Container[*config.AppConfig]) (*Core, error)

New builds application dependencies and wires go-admin.

func (*Core) Features

func (c *Core) Features() []FeatureStatus

Features returns sorted feature flags for display.

func (*Core) Serve

func (c *Core) Serve() error

Serve starts the HTTP server.

func (*Core) Shutdown

func (c *Core) Shutdown(ctx context.Context) error

Shutdown stops the HTTP server gracefully.

type DemoCredential

type DemoCredential struct {
	ID       string
	Username string
	Email    string
	Password string
	Role     string
}

DemoCredential represents a seeded login identity for the app shell.

type DemoIdentity

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

DemoIdentity is the seeded identity used by the shell.

func (DemoIdentity) Email

func (i DemoIdentity) Email() string

func (DemoIdentity) ID

func (i DemoIdentity) ID() string

func (DemoIdentity) Role

func (i DemoIdentity) Role() string

func (DemoIdentity) Username

func (i DemoIdentity) Username() string

type FeatureStatus

type FeatureStatus struct {
	Name    string
	Enabled bool
}

FeatureStatus is a display-ready feature flag tuple.

Jump to

Keyboard shortcuts

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