Help us shape the future of Go! Take the 2026 Go Developer Survey

response

package
v0.24.442 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: Apache-2.0 Imports: 15 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)

func GetApiEnrollmentVersion added in v0.24.374

func GetApiEnrollmentVersion() string

func GetApiVersion added in v0.24.374

func GetApiVersion() string

Types

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

	// The unique id of the current request
	Id string

	// An opaque session token
	SessionToken string
	Jwt          *jwt.Token
	Claims       *oidc_auth.AccessClaims
	ApiSession   *model.ApiSession

	Identity          *model.Identity
	AuthPolicy        *model.AuthPolicy
	AuthQueries       rest_model.AuthQueryList
	ActivePermissions []string
	ResponseWriter    http.ResponseWriter
	Request           *http.Request

	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) NewChangeContext added in v0.24.249

func (rc *RequestContext) NewChangeContext() *change.Context

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