Documentation
¶
Index ¶
- Constants
- type Config
- type RemoteConfig
- type ServiceResourceCache
- type StateCache
- type StateCacheManager
- func (m *StateCacheManager) GetCachePath(envName string) string
- func (m *StateCacheManager) GetStateChangePath() string
- func (m *StateCacheManager) GetStateChangeTime() (time.Time, error)
- func (m *StateCacheManager) Invalidate(ctx context.Context, envName string) error
- func (m *StateCacheManager) Load(ctx context.Context, envName string) (*StateCache, error)
- func (m *StateCacheManager) Save(ctx context.Context, envName string, cache *StateCache) error
- func (m *StateCacheManager) SetTTL(ttl time.Duration)
- func (m *StateCacheManager) TouchStateChange() error
Constants ¶
const ( StateCacheVersion = 1 StateCacheFileName = ".state.json" StateChangeFileName = ".state-change" DefaultCacheTTLDuration = 24 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Remote *RemoteConfig `json:"remote" yaml:"remote"`
}
Config is the state configuration for an azd project
type RemoteConfig ¶
type RemoteConfig struct {
Backend string `json:"backend" yaml:"backend"`
Config map[string]any `json:"config" yaml:"config"`
}
RemoteConfig is the state configuration for a remote backend
type ServiceResourceCache ¶
type ServiceResourceCache struct {
// Resource IDs associated with this service
ResourceIds []string `json:"resourceIds,omitempty"`
// Ingress URL for the service
IngressUrl string `json:"ingressUrl,omitempty"`
}
ServiceResourceCache represents cached resource information for a service
type StateCache ¶
type StateCache struct {
// Version of the cache format
Version int `json:"version"`
// Timestamp when the cache was last updated
UpdatedAt time.Time `json:"updatedAt"`
// Subscription ID
SubscriptionId string `json:"subscriptionId,omitempty"`
// Resource group name
ResourceGroupName string `json:"resourceGroupName,omitempty"`
// Service resources mapped by service name
ServiceResources map[string]ServiceResourceCache `json:"serviceResources,omitempty"`
}
StateCache represents cached Azure resource information for an environment
type StateCacheManager ¶
type StateCacheManager struct {
// contains filtered or unexported fields
}
StateCacheManager manages the state cache for environments
func NewStateCacheManager ¶
func NewStateCacheManager(rootPath string) *StateCacheManager
NewStateCacheManager creates a new state cache manager
func (*StateCacheManager) GetCachePath ¶
func (m *StateCacheManager) GetCachePath(envName string) string
GetCachePath returns the path to the cache file for an environment
func (*StateCacheManager) GetStateChangePath ¶
func (m *StateCacheManager) GetStateChangePath() string
GetStateChangePath returns the path to the state change notification file
func (*StateCacheManager) GetStateChangeTime ¶
func (m *StateCacheManager) GetStateChangeTime() (time.Time, error)
GetStateChangeTime returns the last time the state changed
func (*StateCacheManager) Invalidate ¶
func (m *StateCacheManager) Invalidate(ctx context.Context, envName string) error
Invalidate removes the cache for an environment
func (*StateCacheManager) Load ¶
func (m *StateCacheManager) Load(ctx context.Context, envName string) (*StateCache, error)
Load loads the state cache for an environment
func (*StateCacheManager) Save ¶
func (m *StateCacheManager) Save(ctx context.Context, envName string, cache *StateCache) error
Save saves the state cache for an environment
func (*StateCacheManager) SetTTL ¶
func (m *StateCacheManager) SetTTL(ttl time.Duration)
SetTTL sets the time-to-live for cached data
func (*StateCacheManager) TouchStateChange ¶
func (m *StateCacheManager) TouchStateChange() error
TouchStateChange updates the state change notification file This file is watched by IDEs/tools to know when to refresh their state