Documentation ¶
Index ¶
- type Resource
- type ResourceManager
- func (rm *ResourceManager) GetPubSub() *pubsub.NSQDaemon
- func (rm *ResourceManager) GetRedis() *redis.Server
- func (rm *ResourceManager) GetSQLCluster() *sqldb.Cluster
- func (rm *ResourceManager) PubSubSubscriptionConfig(_ *meta.PubSubTopic, sub *meta.PubSubTopic_Subscription) (config.PubsubSubscription, error)
- func (rm *ResourceManager) PubSubTopicConfig(topic *meta.PubSubTopic) (config.PubsubProvider, config.PubsubTopic, error)
- func (rm *ResourceManager) RedisConfig(redis *meta.CacheCluster) (config.RedisServer, config.RedisDatabase, error)
- func (rm *ResourceManager) SQLConfig(db *meta.SQLDatabase) (config.SQLServer, config.SQLDatabase, error)
- func (rm *ResourceManager) StartPubSub(ctx context.Context) error
- func (rm *ResourceManager) StartRedis(ctx context.Context) error
- func (rm *ResourceManager) StartRequiredServices(a *optracker.AsyncBuildJobs, md *meta.Data)
- func (rm *ResourceManager) StartSQLCluster(a *optracker.AsyncBuildJobs, md *meta.Data) func(ctx context.Context) error
- func (rm *ResourceManager) StopAll()
- func (rm *ResourceManager) UpdateConfig(cfg *config.Runtime, md *meta.Data, dbProxyPort int) error
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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, 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
func (rm *ResourceManager) RedisConfig(redis *meta.CacheCluster) (config.RedisServer, config.RedisDatabase, error)
RedisConfig returns the Redis server and database configuration for the given database.
func (*ResourceManager) SQLConfig ¶ added in v1.21.2
func (rm *ResourceManager) SQLConfig(db *meta.SQLDatabase) (config.SQLServer, config.SQLDatabase, error)
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 ¶
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.