gin

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: MIT Imports: 5 Imported by: 9

README

gin adapter

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MultiTenancy

func MultiTenancy(ts saas.TenantStore, options ...Option) gin.HandlerFunc

Types

type ErrorFormatter

type ErrorFormatter func(context *gin.Context, err error)
var (
	DefaultErrorFormatter ErrorFormatter = func(context *gin.Context, err error) {
		if errors.Is(err, saas.ErrTenantNotFound) {
			context.AbortWithError(404, err)
		} else {
			context.AbortWithError(500, err)
		}
	}
)

type Option

type Option func(*option)

func WithErrorFormatter

func WithErrorFormatter(e ErrorFormatter) Option

func WithMultiTenancyOption

func WithMultiTenancyOption(opt *http.WebMultiTenancyOption) Option

func WithResolveOption

func WithResolveOption(opt ...saas.ResolveOption) Option

Jump to

Keyboard shortcuts

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