Documentation
¶
Index ¶
- func AddMetrics(mux *http.ServeMux)
- func AddPprof(mux *http.ServeMux)
- func AddSnapshots(mux *http.ServeMux, history SnapshotHistory)
- func MustStartServerBackground(snapshotHistory SnapshotHistory, port uint32, ...)
- func StartServer(snapshotHistory SnapshotHistory, port uint32, ...) error
- type Filters
- type Index
- type SnapshotHistory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddMetrics ¶
func AddMetrics(mux *http.ServeMux)
func AddSnapshots ¶
func AddSnapshots(mux *http.ServeMux, history SnapshotHistory)
func MustStartServerBackground ¶
func MustStartServerBackground(
snapshotHistory SnapshotHistory,
port uint32,
addHandlers ...func(mux *http.ServeMux, profiles map[string]string),
)
func StartServer ¶
func StartServer(
snapshotHistory SnapshotHistory,
port uint32,
addHandlers ...func(mux *http.ServeMux, profiles map[string]string),
) error
Types ¶
type Filters ¶ added in v0.22.20
type Filters struct {
// contains filtered or unexported fields
}
func NewFilters ¶ added in v0.22.20
func NewFilters(includedClusters []string, includedNamespaces []string, includedResourceTypes []string) Filters
type SnapshotHistory ¶
type SnapshotHistory interface {
// SetInput Sets the input snapshot for the given component
SetInput(id string, latestInput json.Marshaler)
// GetInputCopy gets an in-memory copy of the output snapshot for all components.
GetInputCopy() (map[string]interface{}, error)
// GetInput gets the input snapshot for all components.
GetInput() ([]byte, error)
// GetFilteredInput gets the input snapshot for all components and applies filters
GetFilteredInput(format string, filters Filters) ([]byte, error)
// SetOutput Sets the output snapshot for the given component
SetOutput(id string, latestOutput json.Marshaler)
// GetOutputCopy gets an in-memory copy of the output snapshot for all components.
GetOutputCopy() (map[string]interface{}, error)
// GetOutput gets the output snapshot for all component.
GetOutput() ([]byte, error)
// GetFilteredOutput gets the output snapshot for all components and applies filters
GetFilteredOutput(format string, filters Filters) ([]byte, error)
}
Could be good to enhance this interface to use more defined types/structs. Right now they are mostly generics which relies on a lot of type assertion. If we did maintain the format here it would need to be checked when set
INPUT FORMAT
{
"cert-issuer": {
"<resourceType>": [...],
"<resourceType>": [...]
},
"translator": {
"<resourceType>": [resources .....],
}
}
OUTPUT FORMAT
{
"roottrust": {...},
"translator": {
"<cluster>/<namespace>": {
"<name>~<namespace>~<cluster>~<resourceType>": {
"Err": null,
"Outputs": {
"<resourceType>": [resources .....]
},
"Warnings": null
},
}
}
}
func NewSnapshotHistory ¶
func NewSnapshotHistory() SnapshotHistory
Click to show internal directories.
Click to hide internal directories.