Documentation
¶
Index ¶
Constants ¶
View Source
const ContentTypeHtml = "text/html; charset=utf-8"
View Source
const ContentTypeJson = "application/json; charset=utf-8"
View Source
const ContentTypeProtobuf = "application/protobuf"
View Source
const XmlContentTypeXml = "application/xml; charset=utf-8"
View Source
const XmlContentTypeXmlAtom = "application/atom+xml; charset=utf-8"
View Source
const XmlContentTypeXmlRss = "application/rss+xml; charset=utf-8"
Variables ¶
This section is empty.
Functions ¶
func WriteResponseBytes ¶
func WriteResponseBytes(ctx *fasthttp.RequestCtx, status int, contentType string, resp []byte)
WriteResponseBytes write response to client with status code, body and content type
func WriteResponseString ¶
func WriteResponseString(ctx *fasthttp.RequestCtx, status int, contentType string, resp string)
WriteResponseString write response to client with status code, body and content type
Types ¶
type ErrorHandlerFunction ¶
type ErrorHandlerFunction func(ctx *fasthttp.RequestCtx, err error)
SendPushFunction type that define function that used to send push
type SVAPI ¶
type SVAPI struct {
// contains filtered or unexported fields
}
SVAPI - main structure
func (*SVAPI) CallAPI ¶
func (as *SVAPI) CallAPI(ctx *fasthttp.RequestCtx, method string)
CallAPI call api method and process it. Modifying body after this function not recommended
func (*SVAPI) GetServiceMap ¶
GetServiceMap returns an json api schema todo realize this function
func (*SVAPI) RegisterService ¶
RegisterService adds a new service to the api server.
The name parameter is optional: if empty it will be inferred from the receiver type name.
Methods from the receiver will be extracted if these rules are satisfied:
- The receiver is exported (begins with an upper case letter) or local (defined in the package registering the service).
- The method name is exported.
- The method has three arguments: *fasthttp.RequestCtx, *args, *reply.
- All three arguments are pointers.
- The second and third arguments are exported or local.
- The method has return type error.
All other methods are ignored.
Click to show internal directories.
Click to hide internal directories.