Documentation
¶
Overview ¶
Package sessionid provides a DataProducer that extracts a session identifier from a configured request header or named cookie and publishes it as a SessionID attribute on the InferenceRequest attribute store, so that affinity-aware scorers and filters can read it without knowing how the session was carried on the wire.
Index ¶
Constants ¶
const SessionIDProducerType = sessionidconstants.SessionIDProducerType
SessionIDProducerType is the plugin type registered with the framework.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Parameters ¶
type Parameters struct {
HeaderName string `json:"headerName"`
CookieName string `json:"cookieName"`
}
Parameters configures the session-id producer.
Exactly one of HeaderName or CookieName must be set:
- HeaderName: read the value of the named request header verbatim.
- CookieName: parse the standard "cookie" request header and read the value of the named cookie.
type Producer ¶
type Producer struct {
// contains filtered or unexported fields
}
Producer extracts a session identifier from each incoming request and publishes it as an endpoint attribute.
func (*Producer) Produce ¶
func (p *Producer) Produce(_ context.Context, request *fwksched.InferenceRequest, _ []fwksched.Endpoint) error
Produce extracts the session identifier from the request and writes it to the request's attribute store. When no identifier can be found the producer is a no-op; consumers must handle absence as "no session preference".