Documentation
¶
Index ¶
- Constants
- Variables
- func ErrorResponseJSON(w http.ResponseWriter, httpCode int, internalCode int, err error)
- func ExtractSessionFromRequest(r *http.Request) (string, error)
- func GetAuthorizationTokenFromRequestHeader(r *http.Request, prefix string) string
- func GetDeviceTypeFromRequestHeaders(r *http.Request) string
- func GetLimitAndOffsetFromPageNumber(page, limit int) (int, int)
- func GetLimitAndOffsetFromRequest(r *http.Request) (int, int)
- func GetPagingInt32FromPageNumber(page, limit int) (int32, int32)
- func GetPagingInt32FromRequest(r *http.Request) (int32, int32)
- func GetPagingInt64FromPageNumber(page, limit int) (int64, int64)
- func GetPagingInt64FromRequest(r *http.Request) (int64, int64)
- func GetRequestAuthorFootprint(r *http.Request) string
- func GetRequestCookieStringValue(r *http.Request, cookieName string) (string, error)
- func GetRequestIPAddress(r *http.Request) string
- func GetSessionIdFromRequestCookie(r *http.Request) string
- func HTTPSessionHandler(handler http.Handler) http.Handler
- func InitTracing(ctx context.Context, host, name string) (context.Context, opentracing.Tracer, io.Closer, error)
- func PerformHTTPRequestUrl(host, url string, args map[string]string) string
- func ResponseJSON(w http.ResponseWriter, v interface{})
- func SendSlackHook(url, channel, username, message string) error
- func SetHttpCookieValue(w http.ResponseWriter, domain, cookieName, value string, expireTime time.Time)
- func SetSessionName(name string)
- func SuccessfulResultMap() map[string]interface{}
- type ApiError
- type CreatedObjectId
- type GatewayInterceptor
- type HTTPInterceptor
- type ListResult
- type ResultAdditionalFields
- type Router
- type SuccessfulRequestResult
Constants ¶
View Source
const (
PrefixBearer = "Bearer "
)
Variables ¶
View Source
var SessionName = "session"
Functions ¶
func ErrorResponseJSON ¶
func ErrorResponseJSON(w http.ResponseWriter, httpCode int, internalCode int, err error)
Sends error http response
func GetRequestIPAddress ¶
func InitTracing ¶
func PerformHTTPRequestUrl ¶
func SendSlackHook ¶
func SetHttpCookieValue ¶
func SetHttpCookieValue(w http.ResponseWriter, domain, cookieName, value string, expireTime time.Time)
func SetSessionName ¶
func SetSessionName(name string)
func SuccessfulResultMap ¶
func SuccessfulResultMap() map[string]interface{}
Types ¶
type ApiError ¶
type ApiError struct {
HttpStatus int `json:"http_status, omitempty"`
ErrorCode int `json:"code"`
Message interface{} `json:"message"`
}
func NewApiError ¶
type CreatedObjectId ¶
type CreatedObjectId struct {
Id interface{} `json:"id, omitempty"`
}
type GatewayInterceptor ¶
type GatewayInterceptor struct {
Mux *runtime.ServeMux
Tracer opentracing.Tracer
}
func (*GatewayInterceptor) ServeHTTP ¶
func (i *GatewayInterceptor) ServeHTTP(w http.ResponseWriter, r *http.Request)
type HTTPInterceptor ¶
type HTTPInterceptor struct {
Router Router
Tracer opentracing.Tracer
}
func (*HTTPInterceptor) ServeHTTP ¶
func (i *HTTPInterceptor) ServeHTTP(w http.ResponseWriter, r *http.Request)
type ListResult ¶
type ResultAdditionalFields ¶
type ResultAdditionalFields map[string]interface{}
type SuccessfulRequestResult ¶
type SuccessfulRequestResult struct {
Success bool `json:"success"`
Timestamp interface{} `json:"timestamp, omitempty"`
Message *string `json:"message, omitempty"`
CreatedObjectId
}
func SuccessfulResult ¶
func SuccessfulResult() SuccessfulRequestResult
Click to show internal directories.
Click to hide internal directories.