m

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2025 License: MIT Imports: 15 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppRun

func AppRun(apps ...App) error

Run starts the application and waits for a signal to gracefully shutdown the servers.

func Config

func Config(name ...string) *mcfg.Config

Config returns the instance of the configuration with the specified name.

func DB

func DB(name ...string) *mdb.DB

DB returns the instance of the database with the specified name.

func DBContext

func DBContext(ctx context.Context, name ...string) *mdb.DB

DBContext returns the instance of the database with the specified name and context.

func Log

func Log(name ...string) *mlog.Logger

Log returns the instance of the logger with the specified name.

func Redis

func Redis(name ...string) *mredis.Redis

Redis returns the instance of the redis with the specified name.

func RequestFromCtx

func RequestFromCtx(ctx context.Context) *mhttp.Request

func Server

func Server(name ...string) *mhttp.Server

Server returns the instance of the HTTP server with the specified name.

Types

type App

type App interface {
	// Start starts the server and blocks until the server stops.
	Start(ctx context.Context) error
	// Stop gracefully stops the server.
	Stop(ctx context.Context) error
}

App is a server interface that defines the lifecycle of a server.

type Meta

type Meta = mmeta.Meta // Meta is alias of frequently-used type gmeta.Meta.

type Var

type Var = mvar.Var // Var is a universal variable interface, like generics.

func NewVar

func NewVar(value interface{}, safe ...bool) *Var

Jump to

Keyboard shortcuts

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