Documentation ¶
Index ¶
- Variables
- type SimpwebservApp
- func (app *SimpwebservApp) Register(function func(*SimpwebservRequest) *SimpwebservResponse, path string)
- func (app *SimpwebservApp) RegisterInternalServerErrorFunction(function func(error) *SimpwebservResponse)
- func (app *SimpwebservApp) RegisterNotFoundFunction(function func(*SimpwebservRequest) *SimpwebservResponse)
- func (app *SimpwebservApp) Run(host string, port uint16)
- func (app *SimpwebservApp) SetDebugMode(onoff bool)
- func (app *SimpwebservApp) SetEnableConsoleLog(onoff bool)
- func (app *SimpwebservApp) SetHTTPS(pemPath string, keyPath string) error
- type SimpwebservRequest
- func (request *SimpwebservRequest) DecodeCookie() map[string]string
- func (request *SimpwebservRequest) DecodeGETRequest() map[string]string
- func (request *SimpwebservRequest) DecodePOSTFormRequest() map[string]string
- func (request *SimpwebservRequest) GetPOSTBody() *bytes.Buffer
- func (request *SimpwebservRequest) RecvFile(storePath string, name string, maxSize int) error
- type SimpwebservResponse
- func BuildBasicResponse() *SimpwebservResponse
- func BuildInternalServerErrorResponse() *SimpwebservResponse
- func BuildJumpResponse(target string) *SimpwebservResponse
- func BuildNotFoundResponse() *SimpwebservResponse
- func SendFile(request *SimpwebservRequest, contentType string, filePath string, ...) *SimpwebservResponse
- func SendStaticFile(path string, contentType string) *SimpwebservResponse
- type SimpwebservUrlNode
Constants ¶
This section is empty.
Variables ¶
View Source
var FileOverSize = errors.New("File over size")
View Source
var IncompleteFile = errors.New("Incomplete file")
View Source
var IncorrectRequest = errors.New("Incorrect request")
Functions ¶
This section is empty.
Types ¶
type SimpwebservApp ¶
type SimpwebservApp struct { Listener net.Listener UrlMap SimpwebservUrlNode UseHTTPS bool HTTPSConfig *tls.Config NotFoundHandler func(*SimpwebservRequest) *SimpwebservResponse InternalServerErrorHandler func(error) *SimpwebservResponse DebugMode bool EnableConsoleLog bool }
func App ¶
func App() SimpwebservApp
func (*SimpwebservApp) Register ¶
func (app *SimpwebservApp) Register(function func(*SimpwebservRequest) *SimpwebservResponse, path string)
func (*SimpwebservApp) RegisterInternalServerErrorFunction ¶ added in v1.5.0
func (app *SimpwebservApp) RegisterInternalServerErrorFunction(function func(error) *SimpwebservResponse)
func (*SimpwebservApp) RegisterNotFoundFunction ¶ added in v1.5.0
func (app *SimpwebservApp) RegisterNotFoundFunction(function func(*SimpwebservRequest) *SimpwebservResponse)
func (*SimpwebservApp) Run ¶
func (app *SimpwebservApp) Run(host string, port uint16)
func (*SimpwebservApp) SetDebugMode ¶ added in v1.5.0
func (app *SimpwebservApp) SetDebugMode(onoff bool)
func (*SimpwebservApp) SetEnableConsoleLog ¶ added in v1.6.0
func (app *SimpwebservApp) SetEnableConsoleLog(onoff bool)
type SimpwebservRequest ¶
type SimpwebservRequest struct { Method string Path string PurePath string Protocol string Host string Header map[string]string Conn net.Conn // contains filtered or unexported fields }
func (*SimpwebservRequest) DecodeCookie ¶ added in v1.3.0
func (request *SimpwebservRequest) DecodeCookie() map[string]string
func (*SimpwebservRequest) DecodeGETRequest ¶ added in v1.3.0
func (request *SimpwebservRequest) DecodeGETRequest() map[string]string
func (*SimpwebservRequest) DecodePOSTFormRequest ¶ added in v1.3.0
func (request *SimpwebservRequest) DecodePOSTFormRequest() map[string]string
func (*SimpwebservRequest) GetPOSTBody ¶ added in v1.6.1
func (request *SimpwebservRequest) GetPOSTBody() *bytes.Buffer
type SimpwebservResponse ¶
type SimpwebservResponse struct { Protocol string Code string CodeName string Header map[string]string Body *bytes.Buffer ToDoCommand string SetCookieList []string }
func BuildBasicResponse ¶
func BuildBasicResponse() *SimpwebservResponse
func BuildInternalServerErrorResponse ¶ added in v1.5.0
func BuildInternalServerErrorResponse() *SimpwebservResponse
func BuildJumpResponse ¶ added in v1.1.0
func BuildJumpResponse(target string) *SimpwebservResponse
func BuildNotFoundResponse ¶
func BuildNotFoundResponse() *SimpwebservResponse
func SendFile ¶ added in v1.2.0
func SendFile(request *SimpwebservRequest, contentType string, filePath string, fileName string) *SimpwebservResponse
func SendStaticFile ¶ added in v1.1.0
func SendStaticFile(path string, contentType string) *SimpwebservResponse
type SimpwebservUrlNode ¶
type SimpwebservUrlNode struct { Name string NextLayer *list.List IncludeBack bool Function func(*SimpwebservRequest) *SimpwebservResponse }
Click to show internal directories.
Click to hide internal directories.