Documentation ¶
Index ¶
- func Start(ctx context.Context, config Config, runnerScaling scaling.RunnerScaling, ...) error
- type CommonConfig
- type Config
- type ControllerListListener
- type Route
- type Service
- func (s *Service) AcquireLease(ctx context.Context, ...) error
- func (s *Service) AsyncCallWasAdded(ctx context.Context)
- func (s *Service) Call(ctx context.Context, req *connect.Request[ftlv1.CallRequest]) (*connect.Response[ftlv1.CallResponse], error)
- func (s *Service) CreateDeployment(ctx context.Context, req *connect.Request[ftlv1.CreateDeploymentRequest]) (*connect.Response[ftlv1.CreateDeploymentResponse], error)
- func (s *Service) GetArtefactDiffs(ctx context.Context, req *connect.Request[ftlv1.GetArtefactDiffsRequest]) (*connect.Response[ftlv1.GetArtefactDiffsResponse], error)
- func (s *Service) GetCertification(context.Context, *connect.Request[ftlv1.GetCertificationRequest]) (*connect.Response[ftlv1.GetCertificationResponse], error)
- func (s *Service) GetDeployment(ctx context.Context, req *connect.Request[ftlv1.GetDeploymentRequest]) (*connect.Response[ftlv1.GetDeploymentResponse], error)
- func (s *Service) GetDeploymentArtefacts(ctx context.Context, req *connect.Request[ftlv1.GetDeploymentArtefactsRequest], ...) error
- func (s *Service) GetModuleContext(ctx context.Context, req *connect.Request[ftlv1.ModuleContextRequest], ...) error
- func (s *Service) GetSchema(ctx context.Context, c *connect.Request[ftlv1.GetSchemaRequest]) (*connect.Response[ftlv1.GetSchemaResponse], error)
- func (s *Service) Ping(ctx context.Context, req *connect.Request[ftlv1.PingRequest]) (*connect.Response[ftlv1.PingResponse], error)
- func (s *Service) ProcessList(ctx context.Context, req *connect.Request[ftlv1.ProcessListRequest]) (*connect.Response[ftlv1.ProcessListResponse], error)
- func (s *Service) PublishEvent(ctx context.Context, req *connect.Request[ftlv1.PublishEventRequest]) (*connect.Response[ftlv1.PublishEventResponse], error)
- func (s *Service) PullSchema(ctx context.Context, req *connect.Request[ftlv1.PullSchemaRequest], ...) error
- func (s *Service) RegisterRunner(ctx context.Context, stream *connect.ClientStream[ftlv1.RegisterRunnerRequest]) (*connect.Response[ftlv1.RegisterRunnerResponse], error)
- func (s *Service) ReplaceDeploy(ctx context.Context, c *connect.Request[ftlv1.ReplaceDeployRequest]) (*connect.Response[ftlv1.ReplaceDeployResponse], error)
- func (s *Service) ResetSubscription(ctx context.Context, req *connect.Request[ftlv1.ResetSubscriptionRequest]) (*connect.Response[ftlv1.ResetSubscriptionResponse], error)
- func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (s *Service) Status(ctx context.Context, req *connect.Request[ftlv1.StatusRequest]) (*connect.Response[ftlv1.StatusResponse], error)
- func (s *Service) StreamDeploymentLogs(ctx context.Context, ...) (*connect.Response[ftlv1.StreamDeploymentLogsResponse], error)
- func (s *Service) UpdateDeploy(ctx context.Context, req *connect.Request[ftlv1.UpdateDeployRequest]) (response *connect.Response[ftlv1.UpdateDeployResponse], err error)
- func (s *Service) UploadArtefact(ctx context.Context, req *connect.Request[ftlv1.UploadArtefactRequest]) (*connect.Response[ftlv1.UploadArtefactResponse], error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Start ¶
func Start( ctx context.Context, config Config, runnerScaling scaling.RunnerScaling, cm *cf.Manager[configuration.Configuration], sm *cf.Manager[configuration.Secrets], conn *sql.DB, devel bool, ) error
Start the Controller. Blocks until the context is cancelled.
Types ¶
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://127.0.0.1:8892" env:"FTL_CONTROLLER_BIND"` IngressBind *url.URL `help:"Socket to bind to for ingress." default:"http://127.0.0.1:8891" env:"FTL_CONTROLLER_INGRESS_BIND"` Key model.ControllerKey `help:"Controller key (auto)." placeholder:"KEY"` DSN string `help:"DAL DSN." default:"${dsn}" env:"FTL_CONTROLLER_DSN"` 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"` KMSURI *string `help:"URI for KMS key e.g. with fake-kms:// or aws-kms://arn:aws:kms:ap-southeast-2:12345:key/0000-1111" env:"FTL_KMS_URI"` MaxOpenDBConnections int `help:"Maximum number of database connections." default:"20" env:"FTL_MAX_OPEN_DB_CONNECTIONS"` MaxIdleDBConnections int `help:"Maximum number of idle database connections." default:"20" env:"FTL_MAX_IDLE_DB_CONNECTIONS"` Registry artefacts.RegistryConfig `embed:"" prefix:"oci-"` CommonConfig }
func (*Config) OpenDBAndInstrument ¶ added in v0.369.0
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 []dalmodel.Controller)
}
ControllerListListener is regularly notified of the current list of controllers This is often used to update a hash ring to distribute work.
type Route ¶ added in v0.365.0
type Route struct { Module string Deployment model.DeploymentKey Endpoint string }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New( ctx context.Context, conn *sql.DB, cm *cf.Manager[configuration.Configuration], sm *cf.Manager[configuration.Secrets], config Config, devel bool, runnerScaling scaling.RunnerScaling, ) (*Service, error)
func (*Service) AcquireLease ¶ added in v0.199.0
func (s *Service) AcquireLease(ctx context.Context, stream *connect.BidiStream[ftlv1.AcquireLeaseRequest, ftlv1.AcquireLeaseResponse]) error
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
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) CreateDeployment ¶
func (*Service) GetArtefactDiffs ¶
func (*Service) GetCertification ¶ added in v0.376.0
func (*Service) GetDeployment ¶
func (*Service) GetDeploymentArtefacts ¶
func (s *Service) GetDeploymentArtefacts(ctx context.Context, req *connect.Request[ftlv1.GetDeploymentArtefactsRequest], resp *connect.ServerStream[ftlv1.GetDeploymentArtefactsResponse]) error
func (*Service) GetModuleContext ¶ added in v0.182.0
func (s *Service) GetModuleContext(ctx context.Context, req *connect.Request[ftlv1.ModuleContextRequest], resp *connect.ServerStream[ftlv1.ModuleContextResponse]) error
GetModuleContext retrieves config, secrets and DSNs for a module.
func (*Service) ProcessList ¶ added in v0.14.0
func (*Service) PublishEvent ¶ added in v0.239.0
func (*Service) PullSchema ¶
func (s *Service) PullSchema(ctx context.Context, req *connect.Request[ftlv1.PullSchemaRequest], stream *connect.ServerStream[ftlv1.PullSchemaResponse]) error
func (*Service) RegisterRunner ¶
func (s *Service) RegisterRunner(ctx context.Context, stream *connect.ClientStream[ftlv1.RegisterRunnerRequest]) (*connect.Response[ftlv1.RegisterRunnerResponse], error)
func (*Service) ReplaceDeploy ¶
func (*Service) ResetSubscription ¶ added in v0.312.0
func (*Service) StreamDeploymentLogs ¶
func (s *Service) StreamDeploymentLogs(ctx context.Context, stream *connect.ClientStream[ftlv1.StreamDeploymentLogsRequest]) (*connect.Response[ftlv1.StreamDeploymentLogsResponse], error)
func (*Service) UpdateDeploy ¶
func (*Service) UploadArtefact ¶
Directories ¶
Path | Synopsis |
---|---|
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. |
migrate
Package migrate supports a dbmate-compatible superset of migration files.
|
Package migrate supports a dbmate-compatible superset of migration files. |