Documentation
¶
Overview ¶
Package migrations aims to create an intermediate state between state and the description package. One that aims to correctly model the dependencies required for migration.
This package is in a state of transition, from the traditional way in the state package and the new way in this migrations package. It's likely to be a slow, considered move between the two and until all migrations are moved to here, there could be additional complexities. Once that is done, a new look to simplify any complexities which came up during the move is probably wise.
Concept:
The key concept is to remove code (complexities) from the state package that could be easily modelled somewhere else.
Steps:
- Create a new Migration that can perform the execution.
- Create a source (src) and destination (dst) point of use interface
- Migrate from source to destination models.
Index ¶
- type AllOfferConnectionSource
- type AllRemoteApplicationSource
- type ExportFirewallRules
- type ExportOfferConnections
- type ExportRelationNetworks
- type ExportRemoteApplications
- type ExportRemoteEntities
- type FirewallRuleSource
- type FirewallRulesModel
- type MigrationFirewallRule
- type MigrationOfferConnection
- type MigrationRelationNetworks
- type MigrationRemoteApplication
- type MigrationRemoteEndpoint
- type MigrationRemoteEntity
- type MigrationRemoteSubnet
- type OfferConnectionModel
- type OfferConnectionSource
- type RelationNetworksModel
- type RelationNetworksSource
- type RemoteApplicationModel
- type RemoteApplicationSource
- type RemoteEntitiesModel
- type RemoteEntitiesSource
- type StatusSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllOfferConnectionSource ¶
type AllOfferConnectionSource interface {
AllOfferConnections() ([]MigrationOfferConnection, error)
}
AllOfferConnectionSource defines an in-place usage for reading all the offer connections.
type AllRemoteApplicationSource ¶
type AllRemoteApplicationSource interface {
AllRemoteApplications() ([]MigrationRemoteApplication, error)
}
AllRemoteApplicationSource defines an in-place usage for reading all the remote application.
type ExportFirewallRules ¶
type ExportFirewallRules struct{}
ExportFirewallRules describes a way to execute a migration for exporting firewall rules.
func (ExportFirewallRules) Execute ¶
func (ExportFirewallRules) Execute(src FirewallRuleSource, dst FirewallRulesModel) error
Execute the migration of the remote entities using typed interfaces, to ensure we don't loose any type safety. This doesn't conform to an interface because go doesn't have generics, but when this does arrive this would be an execellent place to use them.
type ExportOfferConnections ¶
type ExportOfferConnections struct{}
ExportOfferConnections describes a way to execute a migration for exporting offer connections.
func (ExportOfferConnections) Execute ¶
func (m ExportOfferConnections) Execute(src OfferConnectionSource, dst OfferConnectionModel) error
Execute the migration of the offer connections using typed interfaces, to ensure we don't loose any type safety. This doesn't conform to an interface because go doesn't have generics, but when this does arrive this would be an excellent place to use them.
type ExportRelationNetworks ¶
type ExportRelationNetworks struct{}
ExportRelationNetworks describes a way to execute a migration for exporting relation networks.
func (ExportRelationNetworks) Execute ¶
func (ExportRelationNetworks) Execute(src RelationNetworksSource, dst RelationNetworksModel) error
Execute the migration of the relation networks using typed interfaces, to ensure we don't loose any type safety. This doesn't conform to an interface because go doesn't have generics, but when this does arrive this would be an execellent place to use them.
type ExportRemoteApplications ¶
type ExportRemoteApplications struct{}
ExportRemoteApplications describes a way to execute a migration for exporting remote entities.
func (ExportRemoteApplications) Execute ¶
func (m ExportRemoteApplications) Execute(src RemoteApplicationSource, dst RemoteApplicationModel) error
Execute the migration of the remote entities using typed interfaces, to ensure we don't loose any type safety. This doesn't conform to an interface because go doesn't have generics, but when this does arrive this would be an excellent place to use them.
type ExportRemoteEntities ¶
type ExportRemoteEntities struct{}
ExportRemoteEntities describes a way to execute a migration for exporting remote entities.
func (ExportRemoteEntities) Execute ¶
func (ExportRemoteEntities) Execute(src RemoteEntitiesSource, dst RemoteEntitiesModel) error
Execute the migration of the remote entities using typed interfaces, to ensure we don't loose any type safety. This doesn't conform to an interface because go doesn't have generics, but when this does arrive this would be an excellent place to use them.
type FirewallRuleSource ¶
type FirewallRuleSource interface {
AllFirewallRules() ([]MigrationFirewallRule, error)
}
FirewallRuleSource defines an inplace usage for reading all the remote entities.
type FirewallRulesModel ¶
type FirewallRulesModel interface {
AddFirewallRule(args description.FirewallRuleArgs) description.FirewallRule
}
FirewallRulesModel defines an inplace usage for adding a remote entity to a model.
type MigrationFirewallRule ¶
type MigrationFirewallRule interface { ID() string WellKnownService() firewall.WellKnownServiceType WhitelistCIDRs() []string }
MigrationFirewallRule represents a state.FirewallRule Point of use interface to enable better encapsulation.
type MigrationOfferConnection ¶
type MigrationOfferConnection interface { OfferUUID() string RelationId() int RelationKey() string UserName() string SourceModelUUID() string }
MigrationOfferConnection is an in-place representation of the state.OfferConnection
type MigrationRelationNetworks ¶
MigrationRelationNetworks represents a state.RelationNetwork Point of use interface to enable better encapsulation.
type MigrationRemoteApplication ¶
type MigrationRemoteApplication interface { Tag() names.Tag OfferUUID() string URL() (string, bool) SourceModel() names.ModelTag IsConsumerProxy() bool Endpoints() ([]MigrationRemoteEndpoint, error) GlobalKey() string Macaroon() string ConsumeVersion() int }
MigrationRemoteApplication is an in-place representation of the state.RemoteApplication
type MigrationRemoteEndpoint ¶
type MigrationRemoteEndpoint struct { Name string Role charm.RelationRole Interface string }
MigrationRemoteEndpoint is an in-place representation of the state.Endpoint
type MigrationRemoteEntity ¶
MigrationRemoteEntity represents a state.RemoteEntity Point of use interface to enable better encapsulation.
type MigrationRemoteSubnet ¶
type MigrationRemoteSubnet struct { CIDR string ProviderId string VLANTag int AvailabilityZones []string ProviderSpaceId string ProviderNetworkId string }
MigrationRemoteSubnet is an in-place representation of the state.RemoteSubnet
type OfferConnectionModel ¶
type OfferConnectionModel interface {
AddOfferConnection(description.OfferConnectionArgs) description.OfferConnection
}
OfferConnectionModel defines an in-place usage for adding a offer connection to a model.
type OfferConnectionSource ¶
type OfferConnectionSource interface { AllOfferConnectionSource }
OfferConnectionSource composes all the interfaces to create a offer connection.
type RelationNetworksModel ¶
type RelationNetworksModel interface {
AddRelationNetwork(description.RelationNetworkArgs) description.RelationNetwork
}
RelationNetworksModel defines an inplace usage for adding a relation networks to a model.
type RelationNetworksSource ¶
type RelationNetworksSource interface {
AllRelationNetworks() ([]MigrationRelationNetworks, error)
}
RelationNetworksSource defines an inplace usage for reading all the relation networks.
type RemoteApplicationModel ¶
type RemoteApplicationModel interface {
AddRemoteApplication(description.RemoteApplicationArgs) description.RemoteApplication
}
RemoteApplicationModel defines an in-place usage for adding a remote entity to a model.
type RemoteApplicationSource ¶
type RemoteApplicationSource interface { AllRemoteApplicationSource StatusSource }
RemoteApplicationSource composes all the interfaces to create a remote application.
type RemoteEntitiesModel ¶
type RemoteEntitiesModel interface {
AddRemoteEntity(description.RemoteEntityArgs) description.RemoteEntity
}
RemoteEntitiesModel defines an inplace usage for adding a remote entity to a model.
type RemoteEntitiesSource ¶
type RemoteEntitiesSource interface {
AllRemoteEntities() ([]MigrationRemoteEntity, error)
}
RemoteEntitiesSource defines an inplace usage for reading all the remote entities.
type StatusSource ¶
StatusSource defines an in-place usage for reading in the status for a given entity.