cmd

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func WaitSignals

func WaitSignals(i *inspServer, sgs ...os.Signal)

Types

type DynamicProbeServer added in v1.0.0

type DynamicProbeServer[T probe.Probe] struct {
	// contains filtered or unexported fields
}

func NewDynamicProbeServer added in v1.0.0

func NewDynamicProbeServer[T probe.Probe](probeManager ProbeManager[T]) *DynamicProbeServer[T]

func (*DynamicProbeServer[T]) Reload added in v1.0.0

func (s *DynamicProbeServer[T]) Reload(ctx context.Context, config []ProbeConfig) error

func (*DynamicProbeServer[T]) Start added in v1.0.0

func (s *DynamicProbeServer[T]) Start(ctx context.Context, config []ProbeConfig) error

func (*DynamicProbeServer[T]) Stop added in v1.0.0

func (s *DynamicProbeServer[T]) Stop(ctx context.Context) error

type EventConfig

type EventConfig struct {
	EventSinks []EventSinkConfig `yaml:"sinks" mapstructure:"sinks" json:"sinks"`
	Probes     []ProbeConfig     `yaml:"probes" mapstructure:"probes" json:"probes"`
}

type EventProbeManager added in v1.0.0

type EventProbeManager struct {
	// contains filtered or unexported fields
}

func (*EventProbeManager) CreateProbe added in v1.0.0

func (m *EventProbeManager) CreateProbe(config ProbeConfig) (probe.EventProbe, error)

func (*EventProbeManager) StartProbe added in v1.0.0

func (m *EventProbeManager) StartProbe(ctx context.Context, probe probe.EventProbe) error

func (*EventProbeManager) StopProbe added in v1.0.0

func (m *EventProbeManager) StopProbe(ctx context.Context, probe probe.EventProbe) error

type EventServer added in v1.0.0

type EventServer struct {
	*DynamicProbeServer[probe.EventProbe]
}

func NewEventServer added in v1.0.0

func NewEventServer(sinks []sink.Sink) (*EventServer, error)

func (*EventServer) Start added in v1.0.0

func (s *EventServer) Start(ctx context.Context, probeConfig []ProbeConfig) error

func (*EventServer) Stop added in v1.0.0

func (s *EventServer) Stop(ctx context.Context) error

type EventSinkConfig added in v1.0.0

type EventSinkConfig struct {
	Name string      `yaml:"name" mapstructure:"name" json:"name"`
	Args interface{} `yaml:"args" mapstructure:"args" json:"args"`
}

type InspServerConfig added in v1.0.0

type InspServerConfig struct {
	DebugMode        bool          `yaml:"debugmode" mapstructure:"debugmode" json:"debugmode"`
	Port             uint16        `yaml:"port" mapstructure:"port" json:"port"`
	EnableController bool          `yaml:"enable_controller" mapstructure:"enable_controller" json:"enable_controller"`
	MetricsConfig    MetricsConfig `yaml:"metrics" mapstructure:"metrics" json:"metrics"`
	EventConfig      EventConfig   `yaml:"event" mapstructure:"event" json:"event"`
}

type MetricsConfig added in v1.0.0

type MetricsConfig struct {
	Probes []ProbeConfig `yaml:"probes" mapstructure:"probes" json:"probes"`
}

type MetricsProbeManager added in v1.0.0

type MetricsProbeManager struct {
	// contains filtered or unexported fields
}

func (*MetricsProbeManager) CreateProbe added in v1.0.0

func (m *MetricsProbeManager) CreateProbe(config ProbeConfig) (probe.MetricsProbe, error)

func (*MetricsProbeManager) StartProbe added in v1.0.0

func (m *MetricsProbeManager) StartProbe(ctx context.Context, probe probe.MetricsProbe) error

func (*MetricsProbeManager) StopProbe added in v1.0.0

func (m *MetricsProbeManager) StopProbe(ctx context.Context, probe probe.MetricsProbe) error

type MetricsServer added in v1.0.0

type MetricsServer struct {
	*DynamicProbeServer[probe.MetricsProbe]
	// contains filtered or unexported fields
}

func NewMetricsServer added in v1.0.0

func NewMetricsServer() (*MetricsServer, error)

func (*MetricsServer) ServeHTTP added in v1.0.0

func (s *MetricsServer) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ProbeConfig added in v1.0.0

type ProbeConfig struct {
	Name string                 `yaml:"name" mapstructure:"name" json:"name"`
	Args map[string]interface{} `yaml:"args" mapstructure:"args" json:"args"`
}

type ProbeManager added in v1.0.0

type ProbeManager[T probe.Probe] interface {
	CreateProbe(config ProbeConfig) (T, error)
	StartProbe(ctx context.Context, probe T) error
	StopProbe(ctx context.Context, probe T) error
}

Jump to

Keyboard shortcuts

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