goext/ginext/response.go
Mike Schwörer 2504ef00a0
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 3m26s
v0.0.469
2024-06-11 12:10:49 +02:00

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())
}