Mike Schwörer
2504ef00a0
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 3m26s
42 lines
793 B
Go
42 lines
793 B
Go
package ginext
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"gogs.mikescher.com/BlackForestBytes/goext/exerr"
|
|
)
|
|
|
|
type cookieval struct {
|
|
name string
|
|
value string
|
|
maxAge int
|
|
path string
|
|
domain string
|
|
secure bool
|
|
httpOnly bool
|
|
}
|
|
|
|
type headerval struct {
|
|
Key string
|
|
Val string
|
|
}
|
|
|
|
type HTTPResponse interface {
|
|
Write(g *gin.Context)
|
|
WithHeader(k string, v string) HTTPResponse
|
|
WithCookie(name string, value string, maxAge int, path string, domain string, secure bool, httpOnly bool) HTTPResponse
|
|
IsSuccess() bool
|
|
}
|
|
|
|
type InspectableHTTPResponse interface {
|
|
HTTPResponse
|
|
|
|
Statuscode() int
|
|
BodyString(g *gin.Context) *string
|
|
ContentType() string
|
|
Headers() []string
|
|
}
|
|
|
|
func NotImplemented() HTTPResponse {
|
|
return Error(exerr.New(exerr.TypeNotImplemented, "").Build())
|
|
}
|