infra

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resource

type Resource interface {
	// Stop shuts down the resource.
	Stop()
}

type ResourceManager

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

ResourceManager manages a set of infrastructure resources to support the running Encore application.

func NewResourceManager

func NewResourceManager(app *apps.Instance, sqlMgr *sqldb.ClusterManager, environ environ.Environ, forTests bool) *ResourceManager

func (*ResourceManager) GetPubSub

func (rm *ResourceManager) GetPubSub() *pubsub.NSQDaemon

GetPubSub returns the PubSub daemon if it is running otherwise it returns nil

func (*ResourceManager) GetRedis

func (rm *ResourceManager) GetRedis() *redis.Server

GetRedis returns the Redis server if it is running otherwise it returns nil

func (*ResourceManager) GetSQLCluster

func (rm *ResourceManager) GetSQLCluster() *sqldb.Cluster

GetSQLCluster returns the SQL cluster

func (*ResourceManager) StartPubSub

func (rm *ResourceManager) StartPubSub(ctx context.Context) error

StartPubSub starts a PubSub daemon.

func (*ResourceManager) StartRedis

func (rm *ResourceManager) StartRedis(ctx context.Context) error

StartRedis starts a Redis server.

func (*ResourceManager) StartRequiredServices

func (rm *ResourceManager) StartRequiredServices(a *optracker.AsyncBuildJobs, md *meta.Data)

StartRequiredServices will start the required services for the current application if they are not already running based on the given parse result

func (*ResourceManager) StartSQLCluster

func (rm *ResourceManager) StartSQLCluster(a *optracker.AsyncBuildJobs, md *meta.Data) func(ctx context.Context) error

func (*ResourceManager) StopAll

func (rm *ResourceManager) StopAll()

func (*ResourceManager) UpdateConfig

func (rm *ResourceManager) UpdateConfig(cfg *config.Runtime, md *meta.Data, dbProxyPort int) error

UpdateConfig updates the given config with infrastructure information. Note that all the requisite services must have started up already, which in practice means that (*optracker.AsyncBuildJobs).Wait must have returned first.

type Type

type Type string
const (
	PubSub Type = "pubsub"
	Cache  Type = "cache"
	SQLDB  Type = "sqldb"
)

Jump to

Keyboard shortcuts

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