api

package
v0.0.0-...-70c2902 Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// V1ApiQueue version api
	V1ApiQueue = "v1"
)

Variables

View Source
var EndPoints map[string][]endPoint

EndPoints list

Functions

func AddEndPoint

func AddEndPoint(queue, url string)

AddEndPoint to the list

func CheckEndPoint

func CheckEndPoint(queue, url string) error

CheckEndPoint in registrated endpoints

Types

type ApiRequest

type ApiRequest struct {
	HeadRequest
	// contains filtered or unexported fields
}

ApiRequest base struct request

type ApiRun

type ApiRun interface {
	Execute()  // запуск исполняющей функции в запросе
	Validate() // валидация данных
}

ApiRun execute

type HeadRequest

type HeadRequest interface {
	Request()   // execute FetchTask
	NatsQueue() // nats func
}

HeadRequest ai request header

type ReplayBadRequest

type ReplayBadRequest struct {
	Status      int    `json:"Status"`
	Description string `json:"Description"`
}

ReplayBadRequest if something goes wrong

func (*ReplayBadRequest) Encode

Encode answer with status

func (*ReplayBadRequest) SetBadRequest

func (t *ReplayBadRequest) SetBadRequest(w http.ResponseWriter)

SetBadRequest describe often used status

func (*ReplayBadRequest) SetNotFound

func (t *ReplayBadRequest) SetNotFound(w http.ResponseWriter, desc string)

SetNotFound no found answer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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