esrv

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host         string        `env:"REST_SERVER_HOST,required"`
	Port         int           `env:"REST_SERVER_PORT" envDefault:"8080"`
	ReadTimeout  time.Duration `env:"REST_SERVER_READ_TIMEOUT,required"`
	WriteTimeout time.Duration `env:"REST_SERVER_WRITE_TIMEOUT,required"`
	EnableCors   bool          `env:"REST_ENABLE_CORS" envDefault:"false"`
	BodyLimit    string        `env:"REST_BODY_LIMIT" envDefault:"8K"`
}

func NewConfig

func NewConfig() (*Config, error)

func (*Config) ToServerConfig

func (c *Config) ToServerConfig() *serverConfig

type Esrv

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

func NewEsrv

func NewEsrv(e *echo.Echo, sc *serverConfig) *Esrv

func (*Esrv) ListenAndServe

func (es *Esrv) ListenAndServe()

func (*Esrv) Shutdown

func (es *Esrv) Shutdown()

Jump to

Keyboard shortcuts

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