callbackserver

package
v3.0.0-...-a69f007 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTimedOut

func IsTimedOut(err error) bool

IsTimedOut asserts timedOutError.

Types

type CallbackFunc

type CallbackFunc func(http.ResponseWriter, *http.Request) (interface{}, error)

type CallbackServer

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

func New

func New(config Config) (*CallbackServer, error)

func (*CallbackServer) Port

func (cs *CallbackServer) Port() int

func (*CallbackServer) Run

func (cs *CallbackServer) Run(ctx context.Context, callback CallbackFunc) (interface{}, error)

Run starts a server listening at a given path and port and calls a callback function as soon as that path is hit.

It blocks and waits until the given path is hit, or until the context deadline is reached, then shuts down the server and returns the result of the callback function.

type Config

type Config struct {
	Host              string // empty to listen on all network interfaces
	Port              int
	RedirectURI       string
	ReadHeaderTimeout time.Duration
}

type FallthroughResult

type FallthroughResult struct {
	Method string
}

FallthroughResult is an intermediate result returned by the callback function that should be skipped

Jump to

Keyboard shortcuts

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