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 AllExternalControllerSource
- type AllOfferConnectionSource
- type AllRemoteApplicationSource
- type ExportExternalControllers
- type ExportFirewallRules
- type ExportOfferConnections
- type ExportRelationNetworks
- type ExportRemoteApplications
- type ExportRemoteEntities
- type ExternalControllerModel
- type ExternalControllerSource
- type FirewallRuleSource
- type FirewallRulesModel
- type MigrationExternalController
- type MigrationFirewallRule
- type MigrationOfferConnection
- type MigrationRelationNetworks
- type MigrationRemoteApplication
- type MigrationRemoteEndpoint
- type MigrationRemoteEntity
- type MigrationRemoteSpace
- 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 AllExternalControllerSource ¶
type AllExternalControllerSource interface {
ControllerForModel(string) (MigrationExternalController, error)
}
AllExternalControllerSource defines an in-place usage for reading all the external controllers.
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 ExportExternalControllers ¶
type ExportExternalControllers struct{}
ExportExternalControllers describes a way to execute a migration for exporting external controller s.
func (ExportExternalControllers) Execute ¶
func (m ExportExternalControllers) Execute(src ExternalControllerSource, dst ExternalControllerModel) error
Execute the migration of the external controllers 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 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 ExternalControllerModel ¶
type ExternalControllerModel interface {
AddExternalController(description.ExternalControllerArgs) description.ExternalController
}
ExternalControllerModel defines an in-place usage for adding a external controller to a model.
type ExternalControllerSource ¶
type ExternalControllerSource interface { AllExternalControllerSource AllRemoteApplicationSource }
ExternalControllerSource composes all the interfaces to create a external controllers.
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 MigrationExternalController ¶
type MigrationExternalController interface { // ID holds the controller ID from the external controller ID() string // Alias holds an alias (human friendly) name for the controller. Alias() string // Addrs holds the host:port values for the external // controller's API server. Addrs() []string // CACert holds the certificate to validate the external // controller's target API server's TLS certificate. CACert() string // Models holds model UUIDs hosted on this controller. Models() []string }
MigrationExternalController represents a state.ExternalController Point of use interface to enable better encapsulation.
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) Bindings() map[string]string Spaces() []MigrationRemoteSpace GlobalKey() string Macaroon() string }
MigrationRemoteApplication is an in-place representation of the state.RemoteApplication
type MigrationRemoteEndpoint ¶
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 MigrationRemoteSpace ¶
type MigrationRemoteSpace struct { CloudType string Name string ProviderId string ProviderAttributes map[string]interface{} Subnets []MigrationRemoteSubnet }
MigrationRemoteSpace is an in-place representation of the state.RemoteSpace
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.