response

package
v0.24.137 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IdPropertyName    = "id"
	SubIdPropertyName = "subId"
)
View Source
const (
	ApiSessionExpirationSecondsHeader = "expiration-seconds"
	ApiSessionExpiresAtHeader         = "expires-at"
	ServerHeader                      = "server"
)

Variables

This section is empty.

Functions

func AddHeaders added in v0.17.56

func AddHeaders(rc *RequestContext)

func AddSessionHeaders added in v0.17.56

func AddSessionHeaders(rc *RequestContext)

Types

type AuthStatus added in v0.21.160

type AuthStatus struct {
	SecondaryExtJwtSignerId       string
	PassedSecondaryExtJwtSignerId bool
}

type EdgeResponseMapper added in v0.21.0

type EdgeResponseMapper struct{}

func (EdgeResponseMapper) EmptyOkData added in v0.21.0

func (EdgeResponseMapper) EmptyOkData() interface{}

func (EdgeResponseMapper) MapApiError added in v0.21.0

func (self EdgeResponseMapper) MapApiError(requestId string, apiError *errorz.ApiError) interface{}

type EventLogger

type EventLogger interface {
	Log(actorType, actorId, eventType, entityType, entityId, formatString string, formatData []string, data map[interface{}]interface{})
}

type RequestContext

type RequestContext struct {
	Responder
	Id                string
	ApiSession        *model.ApiSession
	Identity          *model.Identity
	AuthPolicy        *model.AuthPolicy
	AuthStatus        AuthStatus
	ActivePermissions []string
	ResponseWriter    http.ResponseWriter
	Request           *http.Request
	SessionToken      string

	Body      []byte
	StartTime time.Time
	// contains filtered or unexported fields
}

func (*RequestContext) GetBody added in v0.21.0

func (rc *RequestContext) GetBody() []byte

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) GetId added in v0.21.0

func (rc *RequestContext) GetId() string

func (*RequestContext) GetRequest added in v0.21.0

func (rc *RequestContext) GetRequest() *http.Request

func (*RequestContext) GetResponseWriter added in v0.21.0

func (rc *RequestContext) GetResponseWriter() http.ResponseWriter

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 {
	api.Responder
	RespondWithOk(data interface{}, meta *rest_model.Meta)
	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 {
	api.Responder
}

func NewResponder added in v0.14.35

func NewResponder(rc *RequestContext) *ResponderImpl

func (*ResponderImpl) RespondWithCreatedId added in v0.14.35

func (responder *ResponderImpl) RespondWithCreatedId(id string, link rest_model.Link)

func (*ResponderImpl) RespondWithOk added in v0.14.35

func (responder *ResponderImpl) RespondWithOk(data interface{}, meta *rest_model.Meta)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL