handlers

package
v0.0.7-beta Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GuardUnknown = iota
	GuardSuccess
	GuardFailure
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Guard

type Guard struct {
	Success int
	Failure int
	Unknown int
	// contains filtered or unexported fields
}

func (*Guard) Allowed

func (g *Guard) Allowed() bool

func (*Guard) BlockMessage

func (g *Guard) BlockMessage() string

func (*Guard) BlockReason

func (g *Guard) BlockReason() string

func (*Guard) Blocked

func (g *Guard) Blocked() bool

func (*Guard) Context

func (g *Guard) Context() context.Context

func (*Guard) End

func (g *Guard) End(status int)

func (*Guard) Error

func (g *Guard) Error() error

func (*Guard) Token

func (g *Guard) Token() string

type Handler

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

func NewHandler

func NewHandler(gn string, fn *string, pb *int32, dw *float32, kv *map[string]string) (*Handler, error)

func (*Handler) DefaultWeight

func (h *Handler) DefaultWeight() *float32

func (*Handler) FailOpen

func (h *Handler) FailOpen(ctx context.Context)

func (*Handler) FeatureName

func (h *Handler) FeatureName() *string

func (*Handler) Guard

func (h *Handler) Guard(ctx context.Context, span trace.Span, tokens []string) *Guard

func (*Handler) GuardName

func (h *Handler) GuardName() string

func (*Handler) NewGuard

func (h *Handler) NewGuard(ctx context.Context, span trace.Span, attr []attribute.KeyValue, err error) *Guard

func (*Handler) OTELEnabled

func (h *Handler) OTELEnabled() bool

Global Helper Functions //

func (*Handler) PriorityBoost

func (h *Handler) PriorityBoost() *int32

func (*Handler) Propagator

func (h *Handler) Propagator() propagation.TextMapPropagator

func (*Handler) SentinelEnabled

func (h *Handler) SentinelEnabled() bool

func (*Handler) Tags

func (h *Handler) Tags() *map[string]string

func (*Handler) Tracer

func (h *Handler) Tracer() trace.Tracer

OTEL Helper Functions //

type InboundHandler

type InboundHandler struct {
	*Handler
}

func NewInboundHandler

func NewInboundHandler(gn string, fn *string, pb *int32, dw *float32, kv *map[string]string) (*InboundHandler, error)

NewInboundHandler returns a new InboundHandler

type OutboundHandler

type OutboundHandler struct {
	*Handler
}

func NewOutboundHandler

func NewOutboundHandler(gn string, fn *string, pb *int32, dw *float32, kv *map[string]string) (*OutboundHandler, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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