example_test

package
v1.7.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 12 Imported by: 0

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 ExampleGroup struct {
	ID   int64  `rest:"default"`
	Name string `rest:"default"`
}

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 (*ExampleRequestRegister) Validate

type ExampleRequestSetAvatar

type ExampleRequestSetAvatar struct {
	// contains filtered or unexported fields
}

func (*ExampleRequestSetAvatar) Execute

func (*ExampleRequestSetAvatar) Validate

type ExampleRequestUserInfo

type ExampleRequestUserInfo struct {
	// contains filtered or unexported fields
}

func (*ExampleRequestUserInfo) Execute

func (*ExampleRequestUserInfo) Validate

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL