Documentation ¶
Index ¶
- Variables
- type BindingHandler
- type BindingInput
- type BindingOutput
- type CommonGoHook
- type GoHook
- type Handlers
- type HookBindingContext
- type HookConfig
- type HookInput
- type HookLoader
- type HookMetadata
- type HookOutput
- type JqFilterHelper
- type KubernetesConfig
- type OnAfterHookBinding
- type OrderedConfig
- type ScheduleConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var Register = func(_ GoHook) bool { return false }
Register is a method to define go hooks. return value is for trick with
var _ =
Functions ¶
This section is empty.
Types ¶
type BindingHandler ¶
type BindingHandler func(input *BindingInput) (*BindingOutput, error)
type BindingInput ¶
type BindingOutput ¶
type BindingOutput struct { ConfigValuesPatches *utils.ValuesPatch MemoryValuesPatches *utils.ValuesPatch Metrics []metric_operation.MetricOperation Error error }
type CommonGoHook ¶
type CommonGoHook struct { HookConfig *HookConfig HookMetadata *HookMetadata }
func (*CommonGoHook) CommonMetadataFromRuntime ¶
func (c *CommonGoHook) CommonMetadataFromRuntime() HookMetadata
CommonMetadataFromRuntime extracts hook name and path from source filename. This method should be called from Metadata() implementation in each hook.
func (*CommonGoHook) Config ¶
func (c *CommonGoHook) Config(cfg *HookConfig) *HookConfig
return it from Config() in child structs
func (*CommonGoHook) Run ¶
func (c *CommonGoHook) Run(input *HookInput) (*HookOutput, error)
Run executes a handler like in BindingContext.MapV1 or in framework/shell.
type GoHook ¶
type GoHook interface { Metadata() HookMetadata Config() (config *HookConfig) Run(input *HookInput) (output *HookOutput, err error) }
type HookBindingContext ¶
type HookBindingContext struct { Type string // type: Event Synchronization Group Schedule Binding string // binding name Snapshots map[string][]kem_types.ObjectAndFilterResult WatchEvent string // Added/Modified/Deleted Objects []kem_types.ObjectAndFilterResult Object kem_types.ObjectAndFilterResult }
type HookConfig ¶
type HookConfig struct { YamlConfig string // define bindings with YAML as in shell hooks. Schedule []ScheduleConfig Kubernetes []KubernetesConfig OnStartup *OrderedConfig OnBeforeHelm *OrderedConfig OnAfterHelm *OrderedConfig OnAfterDeleteHelm *OrderedConfig OnBeforeAll *OrderedConfig OnAfterAll *OrderedConfig MainHandler BindingHandler GroupHandlers map[string]BindingHandler }
type HookInput ¶
type HookInput struct { BindingContexts []binding_context.BindingContext Values utils.Values ConfigValues utils.Values LogLabels map[string]string Envs map[string]string }
type HookLoader ¶
type HookLoader interface {
Load()
}
type HookMetadata ¶
type HookOutput ¶
type HookOutput struct { ConfigValuesPatches *utils.ValuesPatch MemoryValuesPatches *utils.ValuesPatch Metrics []metric_operation.MetricOperation Error error }
type JqFilterHelper ¶
type JqFilterHelper struct { Name string JqFilterFn func(obj *unstructured.Unstructured) (result string, err error) ResultConverter func(string, interface{}) error }
type KubernetesConfig ¶
type KubernetesConfig struct { Name string ApiVersion string Kind string NameSelector *kem_types.NameSelector NamespaceSelector *kem_types.NamespaceSelector LabelSelector *metav1.LabelSelector FieldSelector *kem_types.FieldSelector JqFilter string IncludeSnapshotsFrom []string Queue string Group string ExecuteHookOnEvents []kem_types.WatchEventType ExecuteHookOnSynchronization bool WaitForSynchronization bool KeepFullObjectsInMemory bool AllowFailure bool Handler BindingHandler FilterFunc func(obj *unstructured.Unstructured) (string, error) }
type OnAfterHookBinding ¶
type OnAfterHookBinding struct { Order int Handler func(bc *binding_context.BindingContext) (*HookOutput, error) }
func (*OnAfterHookBinding) Handle ¶
func (b *OnAfterHookBinding) Handle(bc *binding_context.BindingContext) (*HookOutput, error)
type OrderedConfig ¶
type OrderedConfig struct { Order float64 Handler BindingHandler }
type ScheduleConfig ¶
Click to show internal directories.
Click to hide internal directories.