host

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultBasePath = "/api/v1"
)

Variables

This section is empty.

Functions

func NewRouteRegistryRouter

func NewRouteRegistryRouter(base chi.Router, owner string) chi.Router

NewRouteRegistryRouter creates a chi router that tracks route ownership.

func RegisterAllChi

func RegisterAllChi(router chi.Router, opts CoreOptions) error

func RegisterSwaggerChi

func RegisterSwaggerChi(router chi.Router, opts *SwaggerOptions) error

Types

type CoreOptions

type CoreOptions struct {
	Logger             *zap.Logger
	Config             any
	PluginRegistrar    PluginRegistrar
	ModuleBootstrapper ModuleBootstrapper
	MigrationRunner    func(context.Context) error
	SkipMigrate        bool
	BasePath           string
}

type ErrMigration

type ErrMigration struct {
	Cause error
}

func (*ErrMigration) Error

func (e *ErrMigration) Error() string

func (*ErrMigration) Unwrap

func (e *ErrMigration) Unwrap() error

type ErrModuleBootstrap

type ErrModuleBootstrap struct {
	Cause error
}

func (*ErrModuleBootstrap) Error

func (e *ErrModuleBootstrap) Error() string

func (*ErrModuleBootstrap) Unwrap

func (e *ErrModuleBootstrap) Unwrap() error

type ErrPluginBootstrap

type ErrPluginBootstrap struct {
	Cause error
}

func (*ErrPluginBootstrap) Error

func (e *ErrPluginBootstrap) Error() string

func (*ErrPluginBootstrap) Unwrap

func (e *ErrPluginBootstrap) Unwrap() error

type ErrRouteConflict

type ErrRouteConflict struct {
	Method         string
	Path           string
	OwnerModule    string
	ConflictModule string
}

func (*ErrRouteConflict) Error

func (e *ErrRouteConflict) Error() string

type ModuleBootstrapper

type ModuleBootstrapper func(router chi.Router, cfg any, logger *zap.Logger) error

type PluginRegistrar

type PluginRegistrar func(rt RuntimeAdapter, cfg any, logger *zap.Logger) error

func NewManifestPluginRegistrar

func NewManifestPluginRegistrar(manifestPath string) PluginRegistrar

NewManifestPluginRegistrar loads plugin names from plugins.yaml.

func NewStaticPluginRegistrar

func NewStaticPluginRegistrar(names ...string) PluginRegistrar

NewStaticPluginRegistrar registers the provided plugin names in order.

type RuntimeAdapter

type RuntimeAdapter interface {
	RegisterPlugin(name string, p any) error
	Router() chi.Router
}

type SwaggerOptions

type SwaggerOptions struct {
	Title       string
	Description string
	Version     string
	Host        string
	BasePath    string
	Schemes     []string
}

Jump to

Keyboard shortcuts

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