daemon

package
v0.0.35 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2023 License: MPL-2.0 Imports: 34 Imported by: 0

Documentation

Overview

Package daemon configures and starts the otfd daemon and its subsystems.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyDefaults

func ApplyDefaults(cfg *Config)

Types

type Config

type Config struct {
	AgentConfig                  *agent.Config
	CacheConfig                  *inmem.CacheConfig
	Github                       cloud.CloudOAuthConfig
	Gitlab                       cloud.CloudOAuthConfig
	Secret                       string // secret for signing URLs
	SiteToken                    string
	Host                         string
	Address                      string
	Database                     string
	MaxConfigSize                int64
	SSL                          bool
	CertFile, KeyFile            string
	EnableRequestLogging         bool
	DevMode                      bool
	DisableScheduler             bool
	RestrictOrganizationCreation bool
	SiteAdmins                   []string

	tokens.GoogleIAPConfig
}

Config configures the otfd daemon. Descriptions of each field can be found in the flag definitions in ./cmd/otfd

type Daemon

func New

func New(ctx context.Context, logger logr.Logger, cfg Config) (*Daemon, error)

New builds a new daemon and establishes a connection to the database and migrates it to the latest schema. Close() should be called to close this connection.

func (*Daemon) Start

func (d *Daemon) Start(ctx context.Context, started chan struct{}) error

Start the otfd daemon and block until ctx is cancelled or an error is returned. The started channel is closed once the daemon has started.

Jump to

Keyboard shortcuts

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