controller

package
v0.422.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: Apache-2.0 Imports: 51 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(
	ctx context.Context,
	config Config,
	storage *artefacts.OCIArtefactService,
	adminClient ftlv1connect.AdminServiceClient,
	timelineClient *timelineclient.Client,
	devel bool,
) error

Start the Controller. Blocks until the context is cancelled.

Types

type CommonConfig

type CommonConfig struct {
	IdleRunners    int           `help:"Number of idle runners to keep around (not supported in production)." default:"3"`
	WaitFor        []string      `help:"Wait for these modules to be deployed before becoming ready." placeholder:"MODULE"`
	CronJobTimeout time.Duration `help:"Timeout for cron jobs." default:"5m"`
}

CommonConfig between the production controller and development server.

type Config

type Config struct {
	Bind                         *url.URL       `help:"Socket to bind to." default:"http://127.0.0.1:8892" env:"FTL_BIND"`
	Key                          key.Controller `help:"Controller key (auto)." placeholder:"KEY"`
	Advertise                    *url.URL       `` /* 135-byte string literal not displayed */
	RunnerTimeout                time.Duration  `help:"Runner heartbeat timeout." default:"10s"`
	ControllerTimeout            time.Duration  `help:"Controller heartbeat timeout." default:"10s"`
	DeploymentReservationTimeout time.Duration  `help:"Deployment reservation timeout." default:"120s"`
	ModuleUpdateFrequency        time.Duration  `help:"Frequency to send module updates." default:"30s"`
	ArtefactChunkSize            int            `help:"Size of each chunk streamed to the client." default:"1048576"`
	CommonConfig
}

func (*Config) OpenDBAndInstrument

func (c *Config) OpenDBAndInstrument(dsn string) (*sql.DB, error)

func (*Config) SetDefaults

func (c *Config) SetDefaults()

type Service

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

func New

func New(
	ctx context.Context,
	adminClient ftlv1connect.AdminServiceClient,
	timelineClient *timelineclient.Client,
	storage *artefacts.OCIArtefactService,
	config Config,
	devel bool,
) (*Service, error)

func (*Service) Call

func (*Service) GetDeploymentContext

GetDeploymentContext retrieves config, secrets and DSNs for a module.

func (*Service) Ping

func (*Service) UpdateDeploy

Directories

Path Synopsis
Package scheduledtask implements a task scheduler.
Package scheduledtask implements a task scheduler.

Jump to

Keyboard shortcuts

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