daemon

package
v0.0.0-...-0208d45 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: Apache-2.0 Imports: 50 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConfigModifyQueueSize is the size of the event queue for serializing
	// configuration updates to the daemon
	ConfigModifyQueueSize = 10
)

Variables

View Source
var (

	// RootCmd represents the base command when called without any subcommands
	RootCmd = &cobra.Command{
		Use:   components.BpflockAgentName,
		Short: "Run the bpflock agent",
		Run: func(cmd *cobra.Command, args []string) {
			cmdRefDir := viper.GetString(option.CMDRef)
			if cmdRefDir != "" {
				genMarkdown(cmd, cmdRefDir)
				os.Exit(0)
			}

			addr := fmt.Sprintf("127.0.0.1:%d", viper.GetInt(option.GopsPort))
			addrField := logrus.Fields{"address": addr}
			if err := gops.Listen(gops.Options{
				Addr:                   addr,
				ReuseSocketAddrAndPort: true,
			}); err != nil {
				log.WithError(err).WithFields(addrField).Fatal("Cannot start gops server")
			}
			log.WithFields(addrField).Info("Started gops server")

			initEnv(cmd)
			runDaemon()
		},
	}
)

Functions

func Execute

func Execute()

Installs the cleanup signal handler and invokes the root command. This function only returns when an interrupt signal has been received. This is intended to be called by main.main().

func NewGetHealthzHandler

func NewGetHealthzHandler(d *Daemon) GetHealthzHandler

Types

type Daemon

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

Daemon is the daemon that is in charge of perform all necessary security locking and auditing mechanisms.

func NewDaemon

func NewDaemon(ctx context.Context, cancel context.CancelFunc) (*Daemon, error)

NewDaemon creates and returns a new Daemon with the parameters set in c.

func (*Daemon) Close

func (d *Daemon) Close()

Close shuts down a daemon

func (*Daemon) DebugEnabled

func (d *Daemon) DebugEnabled() bool

DebugEnabled returns if debug mode is enabled.

func (*Daemon) GetOptions

func (d *Daemon) GetOptions() *option.IntOptions

GetOptions returns the datapath configuration options of the daemon.

Jump to

Keyboard shortcuts

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