Documentation ¶
Index ¶
- Variables
- type Command
- type CommandStore
- func (s *CommandStore) AddCommand(uri string, command ICommand)
- func (s *CommandStore) AddCommandMethods(uri string, validate func(*Request) *Response, ...)
- func (s *CommandStore) AddCommandObjects(uri string, validator IValidator, executor IExecuter)
- func (s *CommandStore) GetCommand(uri string) (ICommand, bool)
- type Error
- type Executer
- type Fielder
- type IApp
- type ICommand
- type IErrorArgs
- type IExecuter
- type IFieldChecker
- type IFielder
- type IValidator
- type Request
- func (s *Request) Auth() json.Map
- func (s *Request) Close()
- func (s *Request) Data() json.Map
- func (s *Request) File(name string) (io.Reader, bool)
- func (s *Request) FileKeys() []string
- func (s *Request) GenerateToken(data json.Map, expire int64) (string, error)
- func (s *Request) IsAuth() bool
- func (s *Request) IsForm() bool
- func (s *Request) IsJSON() bool
- func (s *Request) RPath() string
- type Response
- func NewResponse() *Response
- func ResponseErrKeyInvalidType(key, kType string) *Response
- func ResponseErrKeyNotExists(key string) *Response
- func ResponseError(err string, args mjson.Map, code int) *Response
- func ResponseErrorMessage(err, message string, code int) *Response
- func ResponseNotFound(data mjson.Map) *Response
- type Rest
- type Validator
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAlreadyOpened = "AlreadyOpened" ErrNotOpened = "NotOpened" ErrKeyNotExists = "KeyNotExists" ErrKeyInvalidType = "KeyInvalidType" ErrNotFound = "NotFound" )
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
func NewCommand ¶
func NewCommand(validator IValidator, executer IExecuter) *Command
type CommandStore ¶
type CommandStore struct {
// contains filtered or unexported fields
}
func NewCommandStore ¶
func NewCommandStore() *CommandStore
func (*CommandStore) AddCommand ¶
func (s *CommandStore) AddCommand(uri string, command ICommand)
func (*CommandStore) AddCommandMethods ¶
func (*CommandStore) AddCommandObjects ¶
func (s *CommandStore) AddCommandObjects(uri string, validator IValidator, executor IExecuter)
func (*CommandStore) GetCommand ¶
func (s *CommandStore) GetCommand(uri string) (ICommand, bool)
type Executer ¶
type Executer struct {
// contains filtered or unexported fields
}
func NewExecuter ¶
type ICommand ¶
type ICommand interface { IValidator IExecuter }
type IErrorArgs ¶
func NewErrFieldRequired ¶
func NewErrFieldRequired(field string) IErrorArgs
func NewErrFieldType ¶
func NewErrFieldType(field, fType, gType, message string) IErrorArgs
func NewErrPrtexpected ¶
func NewErrPrtexpected(field string) IErrorArgs
func NewErrorMessage ¶
func NewErrorMessage(name, text string) IErrorArgs
type IFieldChecker ¶
type IValidator ¶
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
func NewResponse ¶
func NewResponse() *Response
func ResponseErrKeyNotExists ¶
func ResponseErrorMessage ¶
func ResponseNotFound ¶
Click to show internal directories.
Click to hide internal directories.