Documentation ¶
Index ¶
- Variables
- func ID() string
- func NewGenericHandler(c *websocket.Conn) *genericconnectionhandler
- func WsDataGoChannel(cap int) *wsDataGoChannel
- type Context
- func (c *Context) BasicAuth() (string, string, bool)
- func (c *Context) Body() ([]byte, error)
- func (c *Context) Bytes() []byte
- func (c *Context) File(filePath string, mimeType string)
- func (c *Context) FileHTML(filePath string)
- func (c *Context) Form(key string) string
- func (c *Context) GetCookie(name string) string
- func (c *Context) GetStaticDirFile() (string, string)
- func (c *Context) GetStaticFile() string
- func (c *Context) GetStaticFileExt() string
- func (c *Context) GetStaticFilePath() string
- func (c *Context) HasPrefix(prefix string) bool
- func (c *Context) Header(key string) string
- func (c *Context) Host() string
- func (c *Context) IsStatic() bool
- func (c *Context) Json(data interface{}) (int, error)
- func (c *Context) Method() string
- func (c *Context) Mongo() (*mgo.Session, error)
- func (c *Context) Params(name string) string
- func (c *Context) ParseBody(target interface{}) error
- func (c *Context) Path() string
- func (c *Context) Query(key string) string
- func (c *Context) QueryBool(key string) (bool, error)
- func (c *Context) QueryCaseIn(key string) string
- func (c *Context) QueryInt(key string) (int, error)
- func (c *Context) R() *http.Request
- func (c *Context) Redirect(url string, code int)
- func (c *Context) Redis() (*redis.Client, error)
- func (c *Context) RemoteIP() string
- func (c *Context) RemoveCookie(name string)
- func (c *Context) ResponseHeader() http.Header
- func (c *Context) SessionHash() string
- func (c *Context) SetCookie(name, value string, expireIn time.Duration)
- func (c *Context) SetHeader(key string, value string)
- func (c *Context) Status(statusCode int)
- func (c *Context) Status401()
- func (c *Context) Status403()
- func (c *Context) Status404()
- func (c *Context) StatusServerError()
- func (c *Context) String(str string)
- func (c *Context) URL() *url.URL
- func (c *Context) URLHashPart() string
- func (c *Context) Upgrade() (*websocket.Conn, error)
- func (c *Context) View(filePath string, data interface{}) error
- func (c *Context) W() http.ResponseWriter
- func (c Context) Write(b []byte) (int, error)
- func (c Context) WriteHeader(n int)
- type Flash
- type GenericWsGoServer
- type GoChannel
- type Interface
- type Pico
- func (p *Pico) After(m middlewarehandler)
- func (p *Pico) Before(m middlewarehandler)
- func (p *Pico) BroadcastWS(data WsData)
- func (p *Pico) CustomNotFound()
- func (p *Pico) Delete(pattern string, fn PicoHandler)
- func (p *Pico) Get(pattern string, fn PicoHandler)
- func (p *Pico) GetFlash(sessionId string) interface{}
- func (p *Pico) Listen(port int) error
- func (p *Pico) ListenS(port string)
- func (p *Pico) ListenTLS(port, cert, key string)
- func (p *Pico) MongoURL(murl string)
- func (p *Pico) Must(m middlewarehandler)
- func (p *Pico) Options(pattern string, fn PicoHandler)
- func (p *Pico) Post(pattern string, fn PicoHandler)
- func (p *Pico) Production()
- func (p *Pico) Put(pattern string, fn PicoHandler)
- func (p *Pico) RedisURL(rurl string, redispassword ...string)
- func (p *Pico) SendWS(id string, data WsData)
- func (p *Pico) SetAppName(appname string)
- func (p *Pico) SetFlash(sessionId string, value interface{})
- func (p *Pico) SkipAllMiddlewares()
- func (p *Pico) Static(urlPath, diskPath string)
- func (p *Pico) StaticDefault(diskPath string)
- func (p *Pico) Stop()
- func (p *Pico) StopOnInt()
- func (p *Pico) StopOnIntWithFunc(fn func())
- func (p *Pico) Use(m middlewarehandler)
- func (p *Pico) UseUserManager(url, password string)
- func (p *Pico) Ws(pattern string, mh WsHandler)
- type PicoClient
- type PicoHandler
- type PicoStat
- type Subscribers
- type WSArgs
- type WsData
- func (wd WsData) ArrayString(k string) []string
- func (wd WsData) Bool(k string) bool
- func (wd WsData) Clone() WsData
- func (wd WsData) DataAsString(k string) string
- func (wd WsData) Get(k string) Interface
- func (wd WsData) Int(k string) int
- func (wd WsData) Json() string
- func (wd WsData) Remove(k string)
- func (wd WsData) Set(k string, v Interface)
- func (wd WsData) String(k string) string
- type WsHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrChannelClosed = errors.New("channel closed")
)
View Source
var WsForceClose = WsData{"close": true}
Functions ¶
func NewGenericHandler ¶
func WsDataGoChannel ¶
func WsDataGoChannel(cap int) *wsDataGoChannel
Types ¶
type Context ¶
type Context struct { SessionId string Start time.Time IsWebsocket bool UserManager *usermanager AppName string User interface{} State interface{} // contains filtered or unexported fields }
func (*Context) GetStaticDirFile ¶
func (*Context) GetStaticFile ¶
func (*Context) GetStaticFileExt ¶
func (*Context) GetStaticFilePath ¶
func (*Context) QueryCaseIn ¶
func (*Context) RemoveCookie ¶
func (*Context) ResponseHeader ¶
func (*Context) SessionHash ¶
func (*Context) StatusServerError ¶
func (c *Context) StatusServerError()
func (*Context) URLHashPart ¶
func (*Context) W ¶
func (c *Context) W() http.ResponseWriter
func (Context) WriteHeader ¶
type GenericWsGoServer ¶
type GenericWsGoServer struct { MessageHandler WsHandler // contains filtered or unexported fields }
func (*GenericWsGoServer) Close ¶
func (wsg *GenericWsGoServer) Close()
func (*GenericWsGoServer) Handle ¶
func (wsg *GenericWsGoServer) Handle(c *Context)
type Pico ¶
type Pico struct { Mux *httprouter.Router // contains filtered or unexported fields }
func (*Pico) BroadcastWS ¶
func (*Pico) CustomNotFound ¶
func (p *Pico) CustomNotFound()
func (*Pico) Delete ¶
func (p *Pico) Delete(pattern string, fn PicoHandler)
func (*Pico) Get ¶
func (p *Pico) Get(pattern string, fn PicoHandler)
func (*Pico) Options ¶
func (p *Pico) Options(pattern string, fn PicoHandler)
func (*Pico) Post ¶
func (p *Pico) Post(pattern string, fn PicoHandler)
func (*Pico) Production ¶
func (p *Pico) Production()
func (*Pico) Put ¶
func (p *Pico) Put(pattern string, fn PicoHandler)
func (*Pico) SetAppName ¶
func (*Pico) SkipAllMiddlewares ¶
func (p *Pico) SkipAllMiddlewares()
func (*Pico) StaticDefault ¶
func (*Pico) StopOnIntWithFunc ¶
func (p *Pico) StopOnIntWithFunc(fn func())
func (*Pico) UseUserManager ¶
type PicoClient ¶
type PicoClient struct { Headers map[string]string ContentType string // contains filtered or unexported fields }
func NewClient ¶
func NewClient() *PicoClient
type PicoHandler ¶
type PicoHandler func(c *Context)
type Subscribers ¶
type Subscribers map[string]struct{}
type WsData ¶
func WsDataFromMapString ¶
func WsDataFromString ¶
func (WsData) ArrayString ¶
func (WsData) DataAsString ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.