Documentation ¶
Index ¶
- func AddRoute(name string, routes map[string]Method)
- func DoTick()
- func HandleAPI(writer http.ResponseWriter, request *http.Request)
- func InitRouter()
- type HTTPMethod
- type HTTPResponse
- func GenBadRequestResponse(message string) *HTTPResponse
- func GenForbiddenResponse(message string) *HTTPResponse
- func GenInternalServerError(message string) *HTTPResponse
- func GenSuccessResponse(answer interface{}) *HTTPResponse
- func GenTooManyRequestsResponse(message string) *HTTPResponse
- func GenUnauthorizedResponse(message string) *HTTPResponse
- type Method
- type MethodType
- type Response
- type SocketMethod
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitRouter ¶
func InitRouter()
Types ¶
type HTTPMethod ¶
type HTTPResponse ¶
func GenBadRequestResponse ¶
func GenBadRequestResponse(message string) *HTTPResponse
func GenForbiddenResponse ¶
func GenForbiddenResponse(message string) *HTTPResponse
func GenInternalServerError ¶
func GenInternalServerError(message string) *HTTPResponse
func GenSuccessResponse ¶
func GenSuccessResponse(answer interface{}) *HTTPResponse
func GenTooManyRequestsResponse ¶
func GenTooManyRequestsResponse(message string) *HTTPResponse
func GenUnauthorizedResponse ¶
func GenUnauthorizedResponse(message string) *HTTPResponse
func (*HTTPResponse) Write ¶
func (r *HTTPResponse) Write(writer http.ResponseWriter)
type Method ¶
type Method interface { IsPublic() bool GetLimit() int GetType() MethodType }
type SocketMethod ¶
Click to show internal directories.
Click to hide internal directories.