infrastructure

package
v0.1.41 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 29 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package infrastructure provides cross-cutting bootstrap wiring for the API server: the Casbin RBAC enforcer and the startup hooks that seed the default namespace, the built-in default role, and the RBAC policy sync. The HTTP/DB/messaging adapters live under module/adapter.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidPermissionName = errors.New("invalid permission name (want resource:action)")

ErrInvalidPermissionName is returned when a role references a permission name that is not in the expected "resource:action" form.

Functions

func Identity

func Identity[T any](a T) T

Identity is a generic function that returns the input value. It is a helper function to generate a function that returns the input value. It is used to provide a function as a interface.

func New

func New(databaseType config.DatabaseType) fx.Option

New creates the infrastructure bootstrap module: the Casbin RBAC enforcer and the startup hooks that seed the default namespace, default role, and RBAC policies.

The database type selects how the Casbin enforcer stores its policies: the explicit "mongodb" persists them in a "casbin_rules" collection, while any other value (including the default/empty, i.e. standalone) keeps them in process memory and does not depend on a *mongo.Client.

Types

This section is empty.

Jump to

Keyboard shortcuts

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