Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HttpComponent ¶
type HttpComponent struct { component.Component camPluginRouter.RouterPlugin camPluginContext.ContextPlugin // contains filtered or unexported fields }
http server component
func (*HttpComponent) Init ¶
func (comp *HttpComponent) Init(configI camBase.ComponentConfigInterface)
init
type HttpComponentConfig ¶
type HttpComponentConfig struct { component.ComponentConfig camPluginRouter.RouterPluginConfig camPluginContext.ContextPluginConfig camPluginSsl.SslPluginConfig Port uint16 SessionName string SessionKey string // contains filtered or unexported fields }
http server config
func NewHttpComponentConfig ¶
func NewHttpComponentConfig(port uint16) *HttpComponentConfig
new config
func (*HttpComponentConfig) AddRoute ¶
func (config *HttpComponentConfig) AddRoute(route string, handler camBase.HttpRouteHandler)
add custom route handler. its priority is higher than the controller.
type HttpController ¶
type HttpController struct { camPluginRouter.Controller HttpControllerInterface // contains filtered or unexported fields }
http controller
func (*HttpController) GetFile ¶
func (ctrl *HttpController) GetFile(key string) *UploadFile
Get upload file call UploadFile.Save(...) if you want to save the upload file
func (*HttpController) GetRequest
deprecated
func (ctrl *HttpController) GetRequest() *http.Request
Deprecated: remove on v0.5.0 . Please use context to implement camBase.ContextHttpInterface
func (*HttpController) GetRequestWriter
deprecated
func (ctrl *HttpController) GetRequestWriter() *http.ResponseWriter
Deprecated: remove on v0.5.0 . Please use context to implement camBase.ContextHttpInterface
type HttpControllerInterface ¶
type HttpControllerInterface interface {
// contains filtered or unexported methods
}
http controller interface
type HttpSession ¶
type HttpSession struct { camBase.SessionInterface // contains filtered or unexported fields }
session
func NewHttpSession ¶
func NewHttpSession(storeSession *sessions.Session) *HttpSession
func (*HttpSession) Del ¶ added in v0.4.0
func (sess *HttpSession) Del(key interface{})
del value by key
func (*HttpSession) Get ¶
func (sess *HttpSession) Get(key interface{}) interface{}
get value by key
func (*HttpSession) Set ¶
func (sess *HttpSession) Set(key interface{}, value interface{})
set key-value
type UploadFile ¶
type UploadFile struct { File multipart.File Header *multipart.FileHeader }
UploadFile helper
func NewUploadFile ¶
func NewUploadFile(file multipart.File, Header *multipart.FileHeader) *UploadFile
New UploadFile instance
func (*UploadFile) Save ¶
func (uf *UploadFile) Save(absFilename string) error
Save file absFilename
Click to show internal directories.
Click to hide internal directories.