application

package module
v0.0.0-...-dff0e45 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultApplicationTimeout = time.Second * 5

Variables

This section is empty.

Functions

func Run

func Run[Args any](opt ...Option[Args])

Types

type API

type API = router.API

type APIFunc

type APIFunc[Args any] func(Context[Args]) (API, error)

type Context

type Context[Args any] struct {
	Args struct {
		Args    Args
		Network string `long:"network" description:"network to serve on" default:"tcp" env:"APPLICATION_NETWORK"`
		Address string `long:"address" description:"Address to serve on" default:"0.0.0.0:5443" env:"APPLICATION_ADDRESS"`
	}
	// contains filtered or unexported fields
}

func (*Context[Args]) Deadline

func (ctx *Context[Args]) Deadline() (deadline time.Time, ok bool)

func (*Context[Args]) Done

func (ctx *Context[Args]) Done() <-chan struct{}

func (*Context[Args]) Err

func (ctx *Context[Args]) Err() error

func (*Context[Args]) Value

func (ctx *Context[Args]) Value(key any) any

type GoFunc

type GoFunc[Args any] func(Context[Args]) error

type Handler

type Handler = router.Handler

type Option

type Option[Args any] func(*options[Args])

func OptionAPI

func OptionAPI[Args any](api APIFunc[Args]) Option[Args]

func OptionApplicationTimeout

func OptionApplicationTimeout[Args any](to time.Duration) Option[Args]

func OptionGoFunc

func OptionGoFunc[Args any](fn GoFunc[Args]) Option[Args]

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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