envelope

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package envelope defines the on-the-wire payload shapes mast accepts on its inject endpoint. Field names and JSON casing mirror the emitters that produce them so consumers can pattern-match against a single stable schema.

Index

Constants

View Source
const (
	KindK8sEvent         = "k8s-event"
	KindK8sEventFollowup = "k8s-event-followup"
)

Payload kind constants stamped by the emitter on InjectPayload.Kind. Consumers use these to distinguish signal sources.

Variables

This section is empty.

Functions

This section is empty.

Types

type InjectPayload

type InjectPayload struct {
	Kind         string         `json:"kind"`
	Reason       string         `json:"reason"`
	Namespace    string         `json:"namespace"`
	KindOfObject string         `json:"kind_of_object"`
	Name         string         `json:"name"`
	Container    string         `json:"container,omitempty"`
	UID          string         `json:"uid"`
	Message      string         `json:"message"`
	Count        int            `json:"count"`
	FirstSeen    time.Time      `json:"first_seen"`
	LastSeen     time.Time      `json:"last_seen"`
	Cluster      string         `json:"cluster"`
	Context      PayloadContext `json:"context"`
}

InjectPayload is the JSON body POSTed to /inject by k8s-event-watcher (and any other edge-trigger source that speaks the same shape). The schema mirrors core-agent/cmd/k8s-event-watcher/types.go verbatim so the existing sidecar image can be repointed at mast without recompilation.

type PayloadContext

type PayloadContext struct {
	ControllerRef string            `json:"controller_ref,omitempty"`
	Node          string            `json:"node,omitempty"`
	Labels        map[string]string `json:"labels,omitempty"`
}

PayloadContext is the nested "context" object on InjectPayload.

Jump to

Keyboard shortcuts

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