server

package
v1.18.4 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MIT Imports: 6 Imported by: 34

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component func(root Router)

type Config

type Config struct {
	Listen string
	LogLvl string
}

type Context added in v1.18.0

type Context struct {
	C iris.Context
}

func (*Context) Html added in v1.18.0

func (c *Context) Html(ctx Context, layout string, view string, data any)

func (*Context) Json added in v1.18.0

func (c *Context) Json(resp any)

type Handler added in v1.18.0

type Handler func(ctx Context)

type Router added in v1.18.0

type Router interface {
	Post(path string, middleware ...Handler)
	Get(path string, middleware ...Handler)
	Path(path string) Router
	Party() iris.Party
}

func NewRouter added in v1.18.0

func NewRouter(app *iris.Application) Router

type Server

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

func New

func New(config Config) (handler *Server)

func (*Server) AdvancedConfig

func (s *Server) AdvancedConfig(handler func(app *iris.Application)) *Server

func (*Server) GetMonitor added in v1.6.4

func (s *Server) GetMonitor() *iris.Application

func (*Server) OnErrorCode

func (s *Server) OnErrorCode(code int, onErr func(ctx iris.Context)) *Server

func (*Server) RegisterComponent

func (s *Server) RegisterComponent(component Component) *Server

func (*Server) RegisterComponents

func (s *Server) RegisterComponents(components ...Component) *Server

func (*Server) SetHomePage

func (s *Server) SetHomePage(indexHtml string) *Server

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

Jump to

Keyboard shortcuts

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