Documentation ¶
Index ¶
- Variables
- type SimpwebservApp
- 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) RecvFile(storePath string, name string, maxSize int) error
- type SimpwebservResponse
- func BuildBasicResponse() *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 }
func App ¶
func App() SimpwebservApp
func (*SimpwebservApp) Register ¶
func (app *SimpwebservApp) Register(function func(*SimpwebservRequest) *SimpwebservResponse, path string)
func (*SimpwebservApp) Run ¶
func (app *SimpwebservApp) Run(host string, port uint16)
type SimpwebservRequest ¶
type SimpwebservRequest struct { Method string Path string Protocol string Host string Header map[string]string //Body *bytes.Buffer Conn net.Conn }
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
type SimpwebservResponse ¶
type SimpwebservResponse struct { Protocol string Code string CodeName string Header map[string]string Body *bytes.Buffer ToDoCommand string }
func BuildBasicResponse ¶
func BuildBasicResponse() *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
func (*SimpwebservResponse) SetCookie ¶ added in v1.3.0
func (response *SimpwebservResponse) SetCookie(cookieKey string, cookieValue string)
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.