krakend

package
v2.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2022 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Overview

Package krakend registers a bloomfilter given a config and registers the service with consul.

Index

Constants

View Source
const Namespace = "github_com/devopsfaith/bloomfilter"

Namespace for bloomfilter

Variables

View Source
var (
	ErrNoConfig = errors.New("no config for the bloomfilter")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	bf_rpc.Config
	TokenKeys []string `json:"token_keys"`
	Headers   []string `json:"headers"`
}

Config defines the configuration to be added to the KrakenD gateway

type Rejecter

type Rejecter struct {
	BF        bloomfilter.Bloomfilter
	TokenKeys []string
	Headers   []string
}

func Register

func Register(
	ctx context.Context,
	serviceName string,
	cfg config.ServiceConfig,
	logger logging.Logger,
	register func(n string, p int),
) (Rejecter, error)

Register creates rejecter wrapping a bloomfilter given a config

func (*Rejecter) RejectHeader

func (r *Rejecter) RejectHeader(header http.Header) bool

func (*Rejecter) RejectToken

func (r *Rejecter) RejectToken(claims map[string]interface{}) bool

Jump to

Keyboard shortcuts

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