Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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.
Click to show internal directories.
Click to hide internal directories.