Documentation
¶
Overview ¶
Package analytics provides a partitioned Moesif-compatible analytics collector for integration tests.
Index ¶
Constants ¶
View Source
const Port = 3007
Port is the container port used by the testbench.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
Request RequestDetails `json:"request"`
Response ResponseDetails `json:"response"`
UserID string `json:"user_id,omitempty"`
CompanyID string `json:"company_id,omitempty"`
SessionToken string `json:"session_token,omitempty"`
Metadata interface{} `json:"metadata,omitempty"`
Direction string `json:"direction,omitempty"`
Weight int `json:"weight,omitempty"`
Tags string `json:"tags,omitempty"`
A2A any `json:"a2a,omitempty"`
}
Event is the Moesif-shaped event buffered by the collector.
type HeaderValues ¶
HeaderValues preserves all values associated with each HTTP header name.
func (*HeaderValues) UnmarshalJSON ¶
func (h *HeaderValues) UnmarshalJSON(data []byte) error
UnmarshalJSON accepts standard multi-valued headers and legacy scalar values.
type RequestDetails ¶
type RequestDetails struct {
Time time.Time `json:"time"`
URI string `json:"uri"`
Verb string `json:"verb"`
Headers HeaderValues `json:"headers,omitempty"`
APIVersion string `json:"api_version,omitempty"`
IPAddress string `json:"ip_address,omitempty"`
Body interface{} `json:"body,omitempty"`
TransferEncoding string `json:"transfer_encoding,omitempty"`
}
RequestDetails is the request half of an event.
type ResponseDetails ¶
type ResponseDetails struct {
Time time.Time `json:"time"`
Status int `json:"status"`
Headers HeaderValues `json:"headers,omitempty"`
Body interface{} `json:"body,omitempty"`
IPAddress string `json:"ip_address,omitempty"`
TransferEncoding string `json:"transfer_encoding,omitempty"`
}
ResponseDetails is the response half of an event.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements testbench.Service and testbench.Partitioned.
func (*Service) PartitionKey ¶
PartitionKey returns the partitioning strategy used by this stateful service.
Click to show internal directories.
Click to hide internal directories.