Documentation ¶
Index ¶
- type Request
- func (s *Request) Auth() json.Map
- func (s *Request) Close()
- func (s *Request) Command() string
- 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) ResponseError(code int, err rest.IErrorArgs) rest.IResponse
- func (s *Request) ResponseSuccess(data json.Map, files map[string]io.ReadCloser) rest.IResponse
- func (s *Request) Root() any
- type Response
- type Rest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
Request реализует объект запроса
func (*Request) Auth ¶
Auth возвращает словарь с данными об авторизации (при условии, что в заголовке Bearer указан токен и его удалось успешно расшифровать и распарсить)
func (*Request) Close ¶
func (s *Request) Close()
Close закрывает все открытые ресурсы запоса (файлы)
func (*Request) File ¶
File возвращает файл, принятый в запросе multipart/form-data, если он существует
func (*Request) GenerateToken ¶
GenerateToken создает новый токен авторизации. expire - timestamp даты, после которой токен не будет действителен (если указан 0 - токен бессрочный)
func (*Request) IsForm ¶
// IsForm возарвщвет true, если в заголовке ContentType multipart/form-data
func (*Request) ResponseError ¶
func (*Request) ResponseSuccess ¶
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
Response реализует объект ответа
func NewResponse ¶
func NewResponse() *Response
func ResponseError ¶
func ResponseError(code int, err rest.IErrorArgs) *Response
func ResponseSuccess ¶
func (*Response) Close ¶
func (s *Response) Close()
Close закрывает ресурсы ответа после завершения отдачи серверу
func (*Response) FileSet ¶
func (s *Response) FileSet(name string, file io.ReadCloser)
FileSet устанавливает файл в словаре файлов по ключу