Documentation ¶
Index ¶
Constants ¶
const ( // Json marshals the data into json, with indents included Json = iota // JsonCompact marshals the data into json, but without indents JsonCompact // Yaml marshals the data into yaml Yaml )
Variables ¶
var ( // KubeGatewayDefaultGVKs is the list of resource types to return in the kube gateway input snapshot KubeGatewayDefaultGVKs = []schema.GroupVersionKind{ wellknown.GatewayClassListGVK, wellknown.GatewayListGVK, wellknown.HTTPRouteListGVK, wellknown.ReferenceGrantListGVK, v1alpha1.GatewayParametersGVK, gatewayv1.ListenerOptionGVK, gatewayv1.HttpListenerOptionGVK, gatewayv1.RouteOptionGVK, gatewayv1.VirtualHostOptionGVK, extauthv1.AuthConfigGVK, ratelimitv1alpha1.RateLimitConfigGVK, gloov1.UpstreamGVK, wellknownkube.SecretGVK, } )
Functions ¶
This section is empty.
Types ¶
type History ¶
type History interface { // SetApiSnapshot sets the latest Edge ApiSnapshot. SetApiSnapshot(latestInput *v1snap.ApiSnapshot) // SetKubeGatewayClient sets the client to use for Kubernetes CRUD operations when // Kubernetes Gateway integration is enabled. If this is not set, then it is assumed // that Kubernetes Gateway integration is not enabled, and no Kubernetes Gateway // resources will be returned from `GetInputSnapshot`. SetKubeGatewayClient(kubeGatewayClient client.Client) // GetInputSnapshot returns all resources in the Edge input snapshot, and if Kubernetes // Gateway integration is enabled, it additionally returns all resources on the cluster // with types specified by `kubeGatewayGvks`. GetInputSnapshot(ctx context.Context) SnapshotResponseData // GetEdgeApiSnapshot returns all resources in the Edge input snapshot GetEdgeApiSnapshot(ctx context.Context) SnapshotResponseData // GetProxySnapshot returns the Proxies generated for all components. GetProxySnapshot(ctx context.Context) SnapshotResponseData // GetXdsSnapshot returns the entire cache of xDS snapshots // NOTE: This contains sensitive data, as it is the exact inputs that used by Envoy GetXdsSnapshot(ctx context.Context) SnapshotResponseData }
History represents an object that maintains state about the running system The ControlPlane will use the Setters to update the last known state, and the Getters will be used by the Admin Server
func NewHistory ¶
func NewHistory(cache cache.SnapshotCache, settings *gloov1.Settings, kubeGatewayGvks []schema.GroupVersionKind) History
NewHistory returns an implementation of the History interface
- `cache` is the control plane's xDS snapshot cache
- `settings` specifies the Settings for this control plane instance
- `kubeGatewayGvks` specifies the list of resource types to return in the input snapshot when Kubernetes Gateway integration is enabled. For example, this may include Gateway API resources, Portal resources, or other resources specific to the Kubernetes Gateway integration. If not set, then only Edge ApiSnapshot resources will be returned from `GetInputSnapshot`.
type HistoryFactory ¶ added in v1.17.1
type HistoryFactory func(params HistoryFactoryParameters) History
HistoryFactory is a function that produces a History object
func GetHistoryFactory ¶ added in v1.17.1
func GetHistoryFactory() HistoryFactory
GetHistoryFactory returns a default HistoryFactory implementation
type HistoryFactoryParameters ¶ added in v1.17.1
type HistoryFactoryParameters struct { Settings *gloov1.Settings Cache cache.SnapshotCache }
HistoryFactoryParameters are the inputs used to create a History object
type OutputFormat ¶ added in v1.17.4
type OutputFormat int
OutputFormat identifies the format to output an object
func (OutputFormat) String ¶ added in v1.17.4
func (f OutputFormat) String() string
type SnapshotResponseData ¶ added in v1.17.4
type SnapshotResponseData struct { Data interface{} `json:"data"` Error error `json:"error"` }
SnapshotResponseData is the data that is returned by Getter methods on the History object It allows us to encapsulate data and errors together, so that if an issue occurs during the request, we can get access to all the relevant information
func (SnapshotResponseData) Format ¶ added in v1.17.4
func (r SnapshotResponseData) Format(format OutputFormat) ([]byte, error)
func (SnapshotResponseData) MarshalJSON ¶ added in v1.17.4
func (r SnapshotResponseData) MarshalJSON() ([]byte, error)
func (SnapshotResponseData) MarshalJSONString ¶ added in v1.17.4
func (r SnapshotResponseData) MarshalJSONString() string