web

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
}

func NewApplication

func NewApplication() *Application

func (*Application) Run

func (a *Application) Run()

type ContextCustomizer

type ContextCustomizer struct {
}

func NewContextCustomizer

func NewContextCustomizer() *ContextCustomizer

func (*ContextCustomizer) CustomizeContext

func (c *ContextCustomizer) CustomizeContext(ctx app.Context) error

type DefaultServer

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

func NewDefaultServer

func NewDefaultServer() *DefaultServer

func (*DefaultServer) Port

func (s *DefaultServer) Port() int

func (*DefaultServer) ServeHTTP

func (s *DefaultServer) ServeHTTP(writer stdhttp.ResponseWriter, request *stdhttp.Request)

func (*DefaultServer) ShutDownGracefully

func (s *DefaultServer) ShutDownGracefully(ctx context.Context) error

func (*DefaultServer) Start

func (s *DefaultServer) Start() error

func (*DefaultServer) Stop

func (s *DefaultServer) Stop() error

type Server

type Server interface {
	Start() error
	Stop() error
	Port() int
	ShutDownGracefully(ctx context.Context) error
}

type ServerContext

type ServerContext struct {
	HandlerChain http.HandlerChain
	// contains filtered or unexported fields
}

func (*ServerContext) Abort

func (c *ServerContext) Abort()

func (*ServerContext) Deadline

func (c *ServerContext) Deadline() (deadline time.Time, ok bool)

func (*ServerContext) Done

func (c *ServerContext) Done() <-chan struct{}

func (*ServerContext) Err

func (c *ServerContext) Err() error

func (*ServerContext) Invoke

func (c *ServerContext) Invoke(ctx http.Context)

func (*ServerContext) IsAborted

func (c *ServerContext) IsAborted() bool

func (*ServerContext) IsCompleted

func (c *ServerContext) IsCompleted() bool

func (*ServerContext) Parent

func (c *ServerContext) Parent() *ServerContext

func (*ServerContext) Request

func (c *ServerContext) Request() http.Request

func (*ServerContext) Reset

func (c *ServerContext) Reset(req *stdhttp.Request, writer stdhttp.ResponseWriter)

func (*ServerContext) Response

func (c *ServerContext) Response() http.Response

func (*ServerContext) Value

func (c *ServerContext) Value(key any) any

func (*ServerContext) With

func (c *ServerContext) With(request http.Request, response http.Response) http.Context

func (*ServerContext) WithRequest

func (c *ServerContext) WithRequest(request http.Request) http.Context

func (*ServerContext) WithResponse

func (c *ServerContext) WithResponse(response http.Response) http.Context

func (*ServerContext) WithValue

func (c *ServerContext) WithValue(key, val any) http.Context

type ServerContextDelegate

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

func (ServerContextDelegate) Invoke

func (d ServerContextDelegate) Invoke(ctx http.Context)

type ServerProperties

type ServerProperties struct {
	//property.Properties `prefix:"server"`
	Port int `prop:"port" default:"8080"`
}

type ServerRequest

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

func (*ServerRequest) Context

func (r *ServerRequest) Context() http.Context

func (*ServerRequest) Cookie

func (r *ServerRequest) Cookie(name string) (*http.Cookie, bool)

func (*ServerRequest) Cookies

func (r *ServerRequest) Cookies() []*http.Cookie

func (*ServerRequest) Header

func (r *ServerRequest) Header(name string) (string, bool)

func (*ServerRequest) HeaderNames

func (r *ServerRequest) HeaderNames() []string

func (*ServerRequest) Headers

func (r *ServerRequest) Headers(name string) []string

func (*ServerRequest) IsSecure

func (r *ServerRequest) IsSecure() bool

func (*ServerRequest) Method

func (r *ServerRequest) Method() http.Method

func (*ServerRequest) Path

func (r *ServerRequest) Path() string

func (*ServerRequest) QueryParameter

func (r *ServerRequest) QueryParameter(name string) (string, bool)

func (*ServerRequest) QueryParameterNames

func (r *ServerRequest) QueryParameterNames() []string

func (*ServerRequest) QueryParameters

func (r *ServerRequest) QueryParameters(name string) []string

func (*ServerRequest) QueryString

func (r *ServerRequest) QueryString() string

func (*ServerRequest) Reader

func (r *ServerRequest) Reader() io.Reader

func (*ServerRequest) Scheme

func (r *ServerRequest) Scheme() string

func (*ServerRequest) WithReader

func (r *ServerRequest) WithReader(reader io.Reader) http.Request

type ServerResponse

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

func (*ServerResponse) AddCookie

func (r *ServerResponse) AddCookie(cookie *http.Cookie)

func (*ServerResponse) AddHeader

func (r *ServerResponse) AddHeader(name string, value string)

func (*ServerResponse) CharacterEncoding

func (r *ServerResponse) CharacterEncoding() string

func (*ServerResponse) ContentLength

func (r *ServerResponse) ContentLength() int

func (*ServerResponse) ContentType

func (r *ServerResponse) ContentType() string

func (*ServerResponse) Context

func (r *ServerResponse) Context() http.Context

func (*ServerResponse) DeleteHeader

func (r *ServerResponse) DeleteHeader(name string)

func (*ServerResponse) Flush

func (r *ServerResponse) Flush()

func (*ServerResponse) Header

func (r *ServerResponse) Header(name string) string

func (*ServerResponse) HeaderNames

func (r *ServerResponse) HeaderNames() []string

func (*ServerResponse) Headers

func (r *ServerResponse) Headers(name string) []string

func (*ServerResponse) IsCommitted

func (r *ServerResponse) IsCommitted() bool

func (*ServerResponse) Reset

func (r *ServerResponse) Reset()

func (*ServerResponse) SetCharacterEncoding

func (r *ServerResponse) SetCharacterEncoding(charset string)

func (*ServerResponse) SetContentLength

func (r *ServerResponse) SetContentLength(len int)

func (*ServerResponse) SetContentType

func (r *ServerResponse) SetContentType(contentType string)

func (*ServerResponse) SetHeader

func (r *ServerResponse) SetHeader(name string, value string)

func (*ServerResponse) SetStatus

func (r *ServerResponse) SetStatus(status http.Status)

func (*ServerResponse) Status

func (r *ServerResponse) Status() http.Status

func (*ServerResponse) WithWriter

func (r *ServerResponse) WithWriter(writer io.Writer) http.Response

func (*ServerResponse) Writer

func (r *ServerResponse) Writer() io.Writer

type ServerStartStopLifecycle

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

func (*ServerStartStopLifecycle) IsRunning

func (l *ServerStartStopLifecycle) IsRunning() bool

func (*ServerStartStopLifecycle) Start

func (l *ServerStartStopLifecycle) Start() error

func (*ServerStartStopLifecycle) Stop

func (l *ServerStartStopLifecycle) Stop() error

Directories

Path Synopsis
mvc

Jump to

Keyboard shortcuts

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