Documentation ¶
Index ¶
- Constants
- func AddVersionHeader(rw http.ResponseWriter)
- func Respond(w http.ResponseWriter, requestId string, producer runtime.Producer, ...)
- func RespondWithApiError(w http.ResponseWriter, requestId string, producer runtime.Producer, ...)
- func RespondWithError(w http.ResponseWriter, requestId string, producer runtime.Producer, err error)
- type EventLogger
- type IdType
- type Identifier
- type RequestContext
- type Responder
- type ResponderImpl
- func (responder *ResponderImpl) GetProducer() runtime.Producer
- func (responder *ResponderImpl) Respond(data interface{}, httpStatus int)
- func (responder *ResponderImpl) RespondWithApiError(apiError *apierror.ApiError)
- func (responder *ResponderImpl) RespondWithCouldNotParseBody(err error)
- func (responder *ResponderImpl) RespondWithCouldNotReadBody(err error)
- func (responder *ResponderImpl) RespondWithCreatedId(id string, link rest_model.Link)
- func (responder *ResponderImpl) RespondWithEmptyOk()
- func (responder *ResponderImpl) RespondWithError(err error)
- func (responder *ResponderImpl) RespondWithFieldError(fe *validation.FieldError)
- func (responder *ResponderImpl) RespondWithNotFound()
- func (responder *ResponderImpl) RespondWithNotFoundWithCause(cause error)
- func (responder *ResponderImpl) RespondWithOk(data interface{}, meta *rest_model.Meta)
- func (responder *ResponderImpl) RespondWithValidationErrors(errors *schema.ValidationErrors)
- func (responder *ResponderImpl) SetProducer(producer runtime.Producer)
- type Response
Constants ¶
View Source
const ( IdPropertyName = "id" SubIdPropertyName = "subId" )
View Source
const ZitiControllerVersionHeader = "ziti-version"
Variables ¶
This section is empty.
Functions ¶
func AddVersionHeader ¶
func AddVersionHeader(rw http.ResponseWriter)
func RespondWithApiError ¶ added in v0.14.35
func RespondWithError ¶ added in v0.14.35
Types ¶
type EventLogger ¶
type Identifier ¶
type RequestContext ¶
type RequestContext struct { Responder Id string ApiSession *model.ApiSession Identity *model.Identity ActivePermissions []string ResponseWriter http.ResponseWriter Request *http.Request EventLogger EventLogger SessionToken string Body []byte // contains filtered or unexported fields }
func (*RequestContext) GetEntityId ¶ added in v0.14.35
func (rc *RequestContext) GetEntityId() (string, error)
func (*RequestContext) GetEntitySubId ¶ added in v0.14.35
func (rc *RequestContext) GetEntitySubId() (string, error)
func (*RequestContext) SetEntityId ¶ added in v0.14.35
func (rc *RequestContext) SetEntityId(id string)
func (*RequestContext) SetEntitySubId ¶ added in v0.14.35
func (rc *RequestContext) SetEntitySubId(id string)
type Responder ¶
type Responder interface { Respond(data interface{}, httpStatus int) RespondWithOk(data interface{}, meta *rest_model.Meta) RespondWithEmptyOk() RespondWithError(err error) RespondWithApiError(apiError *apierror.ApiError) SetProducer(producer runtime.Producer) GetProducer() runtime.Producer RespondWithCouldNotReadBody(err error) RespondWithCouldNotParseBody(err error) RespondWithValidationErrors(errors *schema.ValidationErrors) RespondWithNotFound() RespondWithNotFoundWithCause(cause error) RespondWithFieldError(fe *validation.FieldError) RespondWithCreatedId(id string, link rest_model.Link) }
todo: rename to Responder, remove old Responder and RequestResponder
type ResponderImpl ¶ added in v0.14.35
type ResponderImpl struct {
// contains filtered or unexported fields
}
func NewResponder ¶ added in v0.14.35
func NewResponder(rc *RequestContext) *ResponderImpl
func (*ResponderImpl) GetProducer ¶ added in v0.14.35
func (responder *ResponderImpl) GetProducer() runtime.Producer
func (*ResponderImpl) Respond ¶ added in v0.14.35
func (responder *ResponderImpl) Respond(data interface{}, httpStatus int)
func (*ResponderImpl) RespondWithApiError ¶ added in v0.14.35
func (responder *ResponderImpl) RespondWithApiError(apiError *apierror.ApiError)
func (*ResponderImpl) RespondWithCouldNotParseBody ¶ added in v0.14.35
func (responder *ResponderImpl) RespondWithCouldNotParseBody(err error)
func (*ResponderImpl) RespondWithCouldNotReadBody ¶ added in v0.14.35
func (responder *ResponderImpl) RespondWithCouldNotReadBody(err error)
func (*ResponderImpl) RespondWithCreatedId ¶ added in v0.14.35
func (responder *ResponderImpl) RespondWithCreatedId(id string, link rest_model.Link)
func (*ResponderImpl) RespondWithEmptyOk ¶ added in v0.14.35
func (responder *ResponderImpl) RespondWithEmptyOk()
func (*ResponderImpl) RespondWithError ¶ added in v0.14.35
func (responder *ResponderImpl) RespondWithError(err error)
func (*ResponderImpl) RespondWithFieldError ¶ added in v0.14.35
func (responder *ResponderImpl) RespondWithFieldError(fe *validation.FieldError)
func (*ResponderImpl) RespondWithNotFound ¶ added in v0.14.35
func (responder *ResponderImpl) RespondWithNotFound()
func (*ResponderImpl) RespondWithNotFoundWithCause ¶ added in v0.14.35
func (responder *ResponderImpl) RespondWithNotFoundWithCause(cause error)
func (*ResponderImpl) RespondWithOk ¶ added in v0.14.35
func (responder *ResponderImpl) RespondWithOk(data interface{}, meta *rest_model.Meta)
func (*ResponderImpl) RespondWithValidationErrors ¶ added in v0.14.35
func (responder *ResponderImpl) RespondWithValidationErrors(errors *schema.ValidationErrors)
func (*ResponderImpl) SetProducer ¶ added in v0.14.35
func (responder *ResponderImpl) SetProducer(producer runtime.Producer)
Click to show internal directories.
Click to hide internal directories.