controller

package
v0.325.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: Apache-2.0 Imports: 63 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, runnerScaling scaling.RunnerScaling, pool *pgxpool.Pool, encryptors *dal.Encryptors) error

Start the Controller. Blocks until the context is cancelled.

Types

type Call

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

type CommonConfig added in v0.162.0

type CommonConfig struct {
	AllowOrigins   []*url.URL    `help:"Allow CORS requests to ingress endpoints from these origins." env:"FTL_CONTROLLER_ALLOW_ORIGIN"`
	AllowHeaders   []string      `help:"Allow these headers in CORS requests. (Requires AllowOrigins)" env:"FTL_CONTROLLER_ALLOW_HEADERS"`
	NoConsole      bool          `help:"Disable the console."`
	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.

func (*CommonConfig) Validate added in v0.281.9

func (c *CommonConfig) Validate() error

type Config

type Config struct {
	Bind                         *url.URL            `help:"Socket to bind to." default:"http://localhost:8892" env:"FTL_CONTROLLER_BIND"`
	IngressBind                  *url.URL            `help:"Socket to bind to for ingress." default:"http://localhost:8891" env:"FTL_CONTROLLER_INGRESS_BIND"`
	Key                          model.ControllerKey `help:"Controller key (auto)." placeholder:"KEY"`
	DSN                          string              `` /* 127-byte string literal not displayed */
	Advertise                    *url.URL            `` /* 146-byte string literal not displayed */
	ConsoleURL                   *url.URL            `help:"The public URL of the console (for CORS)." env:"FTL_CONTROLLER_CONSOLE_URL"`
	ContentTime                  time.Time           `help:"Time to use for console resource timestamps." default:"${timestamp=1970-01-01T00:00:00Z}"`
	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"`
	EventLogRetention            *time.Duration      `help:"Delete call logs after this time period. 0 to disable" env:"FTL_EVENT_LOG_RETENTION" default:"24h"`
	ArtefactChunkSize            int                 `help:"Size of each chunk streamed to the client." default:"1048576"`
	EncryptionKeys
	CommonConfig
}

func (*Config) SetDefaults added in v0.19.0

func (c *Config) SetDefaults()

type ControllerListListener added in v0.170.0

type ControllerListListener interface {
	UpdatedControllerList(ctx context.Context, controllers []dal.Controller)
}

ControllerListListener is regularly notified of the current list of controllers This is often used to update a hash ring to distribute work.

type EncryptionKeys added in v0.319.0

type EncryptionKeys struct {
	Logs  string `name:"log-key" help:"Key for sensitive log data in internal FTL tables." env:"FTL_LOG_ENCRYPTION_KEY"`
	Async string `name:"async-key" help:"Key for sensitive async call data in internal FTL tables." env:"FTL_ASYNC_ENCRYPTION_KEY"`
}

func (EncryptionKeys) Encryptors added in v0.319.0

func (e EncryptionKeys) Encryptors(required bool) (*dal.Encryptors, error)

type Service

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

func New

func New(ctx context.Context, pool *pgxpool.Pool, config Config, runnerScaling scaling.RunnerScaling, encryptors *dal.Encryptors) (*Service, error)

func (*Service) AcquireLease added in v0.199.0

AcquireLease acquires a lease on behalf of a module.

This is a bidirectional stream where each request from the client must be responded to with an empty response.

func (*Service) AsyncCallWasAdded added in v0.244.0

func (s *Service) AsyncCallWasAdded(ctx context.Context)

AsyncCallWasAdded is an optional notification that an async call was added by this controller

It allows us to speed up execution of scheduled async calls rather than waiting for the next poll time.

func (*Service) Call

func (*Service) GetModuleContext added in v0.182.0

GetModuleContext retrieves config, secrets and DSNs for a module.

func (*Service) Ping

func (*Service) ProcessList added in v0.14.0

func (*Service) PublishEvent added in v0.239.0

func (*Service) ResetSubscription added in v0.312.0

func (*Service) SendFSMEvent added in v0.226.0

func (*Service) ServeHTTP

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

func (*Service) UpdateDeploy

Directories

Path Synopsis
dal
Package dal provides a data abstraction layer for cron jobs
Package dal provides a data abstraction layer for cron jobs
sql
Package dal provides a data abstraction layer for the Controller
Package dal provides a data abstraction layer for the Controller
Package scheduledtask implements a task scheduler.
Package scheduledtask implements a task scheduler.
sql

Jump to

Keyboard shortcuts

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