fiberstanza

package module
v0.0.0-...-2774b1b Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HttpGet

func HttpGet(c *fiber.Ctx, guardName string, url string, opts ...Opt) (*http.Response, error)

HttpGet is a fiberstanza helper function (passthrough to stanza.HttpGet)

func HttpPost

func HttpPost(c *fiber.Ctx, guardName string, url string, body io.Reader, opts ...Opt) (*http.Response, error)

HttpPost is a fiberstanza helper function (passthrough to stanza.HttpPost)

func Init

func Init(ctx context.Context, client Client) (func(), error)

Init is a fiberstanza helper function (passthrough to stanza.Init)

func New

func New(guardName string, opts ...Opt) fiber.Handler

New creates a new fiberstanza middleware fiber.Handler

Types

type Client

type Client struct {
	// Required
	APIKey string // customer generated API key

	// Optional
	Name        string   // defines applications name
	Release     string   // defines applications version
	Environment string   // defines applications environment
	StanzaHub   string   // host:port (ipv4, ipv6, or resolvable hostname)
	Guard       []string // prefetch config for these guards
}

Client defines options for a new Stanza Client

type Opt

type Opt struct {
	Headers       http.Header
	Feature       string
	PriorityBoost int32
	DefaultWeight float32
	Tags          map[string]string
}

Optional arguments

Jump to

Keyboard shortcuts

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