Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExampleNew ¶
func ExampleNew()
ExampleNew показывает пример создания и запуска сервера с RestAPI
Types ¶
type ExampleApp ¶
type ExampleApp struct {
// contains filtered or unexported fields
}
ExapmleApp реализует интерфейс IApplication, который отдает серверу параметры подключения, секретный ключ шифрования токена авторизации, а так же обрабатывает поступающие запросы
var App *ExampleApp
func (*ExampleApp) Addr ¶
func (s *ExampleApp) Addr() string
func (*ExampleApp) Executer ¶
func (s *ExampleApp) Executer(r rest.IRequestIn) (rest.IExecuter, bool)
func (*ExampleApp) GenerateID ¶
func (s *ExampleApp) GenerateID() int64
func (*ExampleApp) Secret ¶
func (s *ExampleApp) Secret() []byte
type ExampleGroup ¶
type ExampleRequestRegister ¶
type ExampleRequestRegister struct { ID int64 Name string `rest:"required"` Password string `rest:"required"` GroupID int64 `rest:"required"` // contains filtered or unexported fields }
func (*ExampleRequestRegister) Execute ¶
func (s *ExampleRequestRegister) Execute(req rest.IRequestIn) rest.IRequestOut
func (*ExampleRequestRegister) Validate ¶
func (s *ExampleRequestRegister) Validate(req rest.IRequestIn) rest.IRequestOut
type ExampleRequestSetAvatar ¶
type ExampleRequestSetAvatar struct {
// contains filtered or unexported fields
}
func (*ExampleRequestSetAvatar) Execute ¶
func (s *ExampleRequestSetAvatar) Execute(req rest.IRequestIn) rest.IRequestOut
func (*ExampleRequestSetAvatar) Validate ¶
func (s *ExampleRequestSetAvatar) Validate(req rest.IRequestIn) rest.IRequestOut
type ExampleRequestUserInfo ¶
type ExampleRequestUserInfo struct {
// contains filtered or unexported fields
}
func (*ExampleRequestUserInfo) Execute ¶
func (s *ExampleRequestUserInfo) Execute(req rest.IRequestIn) rest.IRequestOut
func (*ExampleRequestUserInfo) Validate ¶
func (s *ExampleRequestUserInfo) Validate(req rest.IRequestIn) rest.IRequestOut
type ExampleUser ¶
type ExampleUser struct { ID int64 `rest:"default"` Name string `rest:"default"` Group *ExampleGroup Avatar []byte `rest:"ignore"` // contains filtered or unexported fields }
func (*ExampleUser) RestFields ¶
func (s *ExampleUser) RestFields(result json.Map, files map[string]io.ReadCloser, names rest.FieldList)
Click to show internal directories.
Click to hide internal directories.