callbackserver

package
v1.60.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTimedOut added in v1.29.0

func IsTimedOut(err error) bool

IsTimedOut asserts timedOutError.

Types

type CallbackFunc added in v1.29.0

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

type CallbackServer added in v1.29.0

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

func New added in v1.29.0

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

func (*CallbackServer) Port added in v1.29.0

func (cs *CallbackServer) Port() int

func (*CallbackServer) Run added in v1.29.0

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 added in v1.29.0

type Config struct {
	Port        int
	RedirectURI string
}

Jump to

Keyboard shortcuts

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