modulekit

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package modulekit provides module-safe accessors for runtime dependencies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runtime

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

Runtime gives modules a single injected surface for optional infrastructure dependencies used during route registration and handler/service wiring.

func New

func New(deps *app.Dependencies) Runtime

New creates a module runtime wrapper around app dependencies.

func (Runtime) AuthEngine

func (r Runtime) AuthEngine() *goauth.Engine

AuthEngine returns configured goAuth engine when auth is enabled.

func (Runtime) AuthMode

func (r Runtime) AuthMode(overrides ...auth.Mode) auth.Mode

AuthMode returns resolved auth mode, optionally overridden per route.

func (Runtime) CacheConfig

func (r Runtime) CacheConfig() config.CacheConfig

CacheConfig returns resolved cache configuration snapshot.

func (Runtime) CacheManager

func (r Runtime) CacheManager() *cache.Manager

CacheManager returns configured cache manager when caching is enabled.

func (Runtime) Dependencies

func (r Runtime) Dependencies() *app.Dependencies

Dependencies returns raw dependency bag for advanced module wiring.

func (Runtime) Limiter

func (r Runtime) Limiter() ratelimit.Limiter

Limiter returns configured route limiter when rate limiting is enabled.

func (Runtime) Postgres

func (r Runtime) Postgres() *pgxpool.Pool

Postgres returns configured pgx pool when Postgres is enabled.

func (Runtime) RateLimitConfig

func (r Runtime) RateLimitConfig() config.RateLimitConfig

RateLimitConfig returns resolved rate-limit configuration snapshot.

func (Runtime) Redis

func (r Runtime) Redis() *redis.Client

Redis returns configured redis client when Redis is enabled.

Jump to

Keyboard shortcuts

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