apisix

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 11 Imported by: 0

README

Apisix

Ref: https://github.com/apache/apisix-go-plugin-runner

In your go-runner

import _ "github.com/go-saas/saas/gateway/apisix"

apisix.InitTenantStore(ts)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InfoHeaderOrDefault

func InfoHeaderOrDefault(h string) string

func Init

func Init(t saas.TenantStore, nextHeader, nextInfoHeader string, format FormatError)

Types

type FormatError

type FormatError func(err error, w http.ResponseWriter)

type Resolver

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

func NewResolver

func NewResolver(r pkgHTTP.Request, key, pathRegex string) *Resolver

func (*Resolver) Resolve

type Saas

type Saas struct {
	plugin.DefaultPlugin
}

Saas resolve and validate tenant information

func (*Saas) Name

func (p *Saas) Name() string

func (*Saas) ParseConf

func (p *Saas) ParseConf(in []byte) (interface{}, error)

func (*Saas) RequestFilter

func (p *Saas) RequestFilter(conf interface{}, w http.ResponseWriter, r pkgHTTP.Request)

type SaasConf

type SaasConf struct {
	TenantKey      string `json:"tenant_key"`
	NextHeader     string `json:"next_header"`
	NextInfoHeader string `json:"next_info_header"`
	PathRegex      string `json:"path_regex"`
}

Jump to

Keyboard shortcuts

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