Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func VerifySignature ¶
func VerifySignature(event ReceivedEvent, secret string) bool
VerifySignature checks that the event's HMAC signature matches the given secret.
Types ¶
type MockServer ¶
type MockServer struct {
// contains filtered or unexported fields
}
MockServer captures operator events sent to its HTTP endpoint.
func NewMockServer ¶
func NewMockServer() *MockServer
func (*MockServer) GetEvents ¶
func (s *MockServer) GetEvents() []ReceivedEvent
func (*MockServer) GetEventsByTopic ¶
func (s *MockServer) GetEventsByTopic(topic string) []ReceivedEvent
GetEventsByTopic returns events matching the given topic.
func (*MockServer) GetURL ¶
func (s *MockServer) GetURL() string
func (*MockServer) Reset ¶
func (s *MockServer) Reset()
func (*MockServer) Start ¶
func (s *MockServer) Start() error
func (*MockServer) Stop ¶
func (s *MockServer) Stop() error
type OperatorEvent ¶
type OperatorEvent struct {
ID string `json:"id"`
Topic string `json:"topic"`
Time time.Time `json:"time"`
DeploymentID string `json:"deployment_id,omitempty"`
TenantID string `json:"tenant_id,omitempty"`
Data json.RawMessage `json:"data"`
}
OperatorEvent mirrors internal/opevents.OperatorEvent for test decoding.
type ReceivedEvent ¶
type ReceivedEvent struct {
Event OperatorEvent
Signature string // raw X-Outpost-Signature header
Body []byte // raw request body (for signature verification)
}
ReceivedEvent is a single operator event received by the mock server.
Click to show internal directories.
Click to hide internal directories.