infra

package
v1.29.5 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: MPL-2.0 Imports: 19 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, ns *namespace.Namespace, environ environ.Environ, dbProxyPort int, 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) PubSubSubscriptionConfig added in v1.21.2

func (rm *ResourceManager) PubSubSubscriptionConfig(_ *meta.PubSubTopic, sub *meta.PubSubTopic_Subscription) (config.PubsubSubscription, error)

PubSubSubscriptionConfig returns the PubSub subscription configuration for the given subscription.

func (*ResourceManager) PubSubTopicConfig added in v1.21.2

func (rm *ResourceManager) PubSubTopicConfig(topic *meta.PubSubTopic) (config.PubsubProvider, config.PubsubTopic, error)

PubSubTopicConfig returns the PubSub provider and topic configuration for the given topic.

func (*ResourceManager) RedisConfig added in v1.21.2

RedisConfig returns the Redis server and database configuration for the given database.

func (*ResourceManager) SQLConfig added in v1.21.2

SQLConfig returns the SQL server and database configuration for the given database.

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