Documentation ¶
Index ¶
- Constants
- Variables
- func CheckEmailForm(in string) bool
- func CheckForm(re *regexp.Regexp, in string) bool
- func CheckURLForm(in string) bool
- func TransformTags(in string) string
- type AbsApp
- type App
- func (app *App) AccessLog(ctx *Context)
- func (app *App) ErrorLog(ctx *Context)
- func (app *App) Log(tag string, msg string)
- func (app *App) Run(port int)
- func (app *App) RunCGI(port int)
- func (app *App) SetHandler(url string, handleFunc func(*Context))
- func (app *App) SetStaticPath(url string, path string)
- type Context
- type ContextInfo
- type FileStorage
- func (fs *FileStorage) Count() int
- func (fs *FileStorage) Delete(key string)
- func (fs *FileStorage) Get(key string) ([]byte, error)
- func (fs *FileStorage) GetJSON(key string) (interface{}, error)
- func (fs *FileStorage) GetString(key string) (string, error)
- func (fs *FileStorage) Has(key string) bool
- func (fs *FileStorage) Init(path string, mode int) error
- func (fs *FileStorage) LoadIndex() error
- func (fs *FileStorage) Master()
- func (fs *FileStorage) SaveIndex() error
- func (fs *FileStorage) Set(key string, value []byte) error
- func (fs *FileStorage) SetJSON(key string, value interface{}) error
- func (fs *FileStorage) SetString(key string, value string) error
- type RenderHandler
- type RootHandler
- type Storage
- type StorageCmdItem
- type StorageStat
Constants ¶
View Source
const ( FILE_STORAGE_MODE_SINGLE = 0 FILE_STORAGE_MODE_MULIPLE = 1 )
View Source
const ( ERROR_UNKNOWN = "Unknown Error" ERROR_KEY_NOT_EXISTS = "Key doesn't exists" ERROR_IMPERMEABLE_KEY = "Impereable Key" )
View Source
const ( ErrNotFound = "Page Not Found" ErrAccessDenied = "Access Denied" ErrInternalServerError = "Internal Server Error" )
View Source
const (
OP_SAVE = 0
)
Variables ¶
View Source
var EmailPattern, URLPattern *regexp.Regexp
Functions ¶
func CheckEmailForm ¶
func CheckURLForm ¶
func TransformTags ¶
Types ¶
type App ¶
type App struct { Port int Handler RootHandler }
func (*App) SetHandler ¶
func (*App) SetStaticPath ¶
type Context ¶
type Context struct { Writer http.ResponseWriter Request *http.Request Application *App Info ContextInfo Headers map[string]string }
type ContextInfo ¶
type FileStorage ¶
type FileStorage struct { Path string Mode int Index map[string]string Stat StorageStat // @TODO GetChan chan string SetChan chan string CmdChan chan *StorageCmdItem }
func (*FileStorage) Count ¶
func (fs *FileStorage) Count() int
func (*FileStorage) Delete ¶
func (fs *FileStorage) Delete(key string)
func (*FileStorage) GetJSON ¶
func (fs *FileStorage) GetJSON(key string) (interface{}, error)
Gets string form storage assigned with specified key, coverts it to json object and returns. if this key doesn't exists or failed to parse json, return nil, err
func (*FileStorage) Has ¶
func (fs *FileStorage) Has(key string) bool
func (*FileStorage) LoadIndex ¶
func (fs *FileStorage) LoadIndex() error
func (*FileStorage) Master ¶
func (fs *FileStorage) Master()
func (*FileStorage) SaveIndex ¶
func (fs *FileStorage) SaveIndex() error
func (*FileStorage) SetJSON ¶
func (fs *FileStorage) SetJSON(key string, value interface{}) error
type RootHandler ¶
func (RootHandler) ServeHTTP ¶
func (h RootHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)
type StorageCmdItem ¶
type StorageCmdItem struct { Op int Arg1 interface{} }
Click to show internal directories.
Click to hide internal directories.