kratos

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Server

func Server(ts saas.TenantStore, options ...Option) middleware.Middleware

Types

type ErrorFormatter

type ErrorFormatter func(err error) (interface{}, error)
var (
	DefaultErrorFormatter ErrorFormatter = func(err error) (interface{}, error) {

		if errors.Is(err, saas.ErrTenantNotFound) {
			return nil, errors.NotFound("TENANT", err.Error())
		}
		return nil, err
	}
)

type HeaderTenantResolveContrib

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

func NewHeaderTenantResolveContrib

func NewHeaderTenantResolveContrib(key string, transporter transport.Transporter) *HeaderTenantResolveContrib

func (*HeaderTenantResolveContrib) Name

func (*HeaderTenantResolveContrib) Resolve

func (h *HeaderTenantResolveContrib) Resolve(ctx *saas.Context) error

type Option

type Option func(*option)

func WithErrorFormatter

func WithErrorFormatter(e ErrorFormatter) Option

func WithMultiTenancyOption

func WithMultiTenancyOption(opt *shttp.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