orm

package
v0.0.0-...-cc6ace1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultConfig default orm config
	DefaultConfig = Config{
		Creator: func() o.Ormer {
			return o.NewOrm()
		},
	}
)

Functions

func Middleware

func Middleware(skippers ...middleware.Skipper) func(http.Handler) http.Handler

Middleware middleware which add ormer to the http request context with default config

func MiddlewareWithConfig

func MiddlewareWithConfig(config Config, skippers ...middleware.Skipper) func(http.Handler) http.Handler

MiddlewareWithConfig middleware which add ormer to the http request context with config

Types

type Config

type Config struct {
	// Creator defines a function to create ormer
	Creator func() o.Ormer
}

Config defines the config for Orm middleware.

Jump to

Keyboard shortcuts

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