juju: github.com/juju/juju/state/migrations Index | Files

package migrations

import "github.com/juju/juju/state/migrations"

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

Package Files

doc.go externalcontrollers.go firewallrules.go offerconnections.go relationnetworks.go remoteapplications.go remoteentities.go

type AllExternalControllerSource Uses

type AllExternalControllerSource interface {
    ControllerForModel(string) (MigrationExternalController, error)
}

AllExternalControllerSource defines an in-place usage for reading all the external controllers.

type AllOfferConnectionSource Uses

type AllOfferConnectionSource interface {
    AllOfferConnections() ([]MigrationOfferConnection, error)
}

AllOfferConnectionSource defines an in-place usage for reading all the offer connections.

type AllRemoteApplicationSource Uses

type AllRemoteApplicationSource interface {
    AllRemoteApplications() ([]MigrationRemoteApplication, error)
}

AllRemoteApplicationSource defines an in-place usage for reading all the remote application.

type ExportExternalControllers Uses

type ExportExternalControllers struct{}

ExportExternalControllers describes a way to execute a migration for exporting external controller s.

func (ExportExternalControllers) Execute Uses

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 Uses

type ExportFirewallRules struct{}

ExportFirewallRules describes a way to execute a migration for exporting firewall rules.

func (ExportFirewallRules) Execute Uses

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 Uses

type ExportOfferConnections struct{}

ExportOfferConnections describes a way to execute a migration for exporting offer connections.

func (ExportOfferConnections) Execute Uses

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 Uses

type ExportRelationNetworks struct{}

ExportRelationNetworks describes a way to execute a migration for exporting relation networks.

func (ExportRelationNetworks) Execute Uses

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 Uses

type ExportRemoteApplications struct{}

ExportRemoteApplications describes a way to execute a migration for exporting remote entities.

func (ExportRemoteApplications) Execute Uses

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 Uses

type ExportRemoteEntities struct{}

ExportRemoteEntities describes a way to execute a migration for exporting remote entities.

func (ExportRemoteEntities) Execute Uses

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 Uses

type ExternalControllerModel interface {
    AddExternalController(description.ExternalControllerArgs) description.ExternalController
}

ExternalControllerModel defines an in-place usage for adding a external controller to a model.

type ExternalControllerSource Uses

type ExternalControllerSource interface {
    AllExternalControllerSource
    AllRemoteApplicationSource
}

ExternalControllerSource composes all the interfaces to create a external controllers.

type FirewallRuleSource Uses

type FirewallRuleSource interface {
    AllFirewallRules() ([]MigrationFirewallRule, error)
}

FirewallRuleSource defines an inplace usage for reading all the remote entities.

type FirewallRulesModel Uses

type FirewallRulesModel interface {
    AddFirewallRule(args description.FirewallRuleArgs) description.FirewallRule
}

FirewallRulesModel defines an inplace usage for adding a remote entity to a model.

type MigrationExternalController Uses

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 Uses

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 Uses

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 Uses

type MigrationRelationNetworks interface {
    Id() string
    RelationKey() string
    CIDRS() []string
}

MigrationRelationNetworks represents a state.RelationNetwork Point of use interface to enable better encapsulation.

type MigrationRemoteApplication Uses

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 Uses

type MigrationRemoteEndpoint struct {
    Name      string
    Role      charm.RelationRole
    Interface string
}

MigrationRemoteEndpoint is an in-place representation of the state.Endpoint

type MigrationRemoteEntity Uses

type MigrationRemoteEntity interface {
    ID() string
    Token() string
    Macaroon() string
}

MigrationRemoteEntity represents a state.RemoteEntity Point of use interface to enable better encapsulation.

type MigrationRemoteSpace Uses

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 Uses

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 Uses

type OfferConnectionModel interface {
    AddOfferConnection(description.OfferConnectionArgs) description.OfferConnection
}

OfferConnectionModel defines an in-place usage for adding a offer connection to a model.

type OfferConnectionSource Uses

type OfferConnectionSource interface {
    AllOfferConnectionSource
}

OfferConnectionSource composes all the interfaces to create a offer connection.

type RelationNetworksModel Uses

type RelationNetworksModel interface {
    AddRelationNetwork(description.RelationNetworkArgs) description.RelationNetwork
}

RelationNetworksModel defines an inplace usage for adding a relation networks to a model.

type RelationNetworksSource Uses

type RelationNetworksSource interface {
    AllRelationNetworks() ([]MigrationRelationNetworks, error)
}

RelationNetworksSource defines an inplace usage for reading all the relation networks.

type RemoteApplicationModel Uses

type RemoteApplicationModel interface {
    AddRemoteApplication(description.RemoteApplicationArgs) description.RemoteApplication
}

RemoteApplicationModel defines an in-place usage for adding a remote entity to a model.

type RemoteApplicationSource Uses

type RemoteApplicationSource interface {
    AllRemoteApplicationSource
    StatusSource
}

RemoteApplicationSource composes all the interfaces to create a remote application.

type RemoteEntitiesModel Uses

type RemoteEntitiesModel interface {
    AddRemoteEntity(description.RemoteEntityArgs) description.RemoteEntity
}

RemoteEntitiesModel defines an inplace usage for adding a remote entity to a model.

type RemoteEntitiesSource Uses

type RemoteEntitiesSource interface {
    AllRemoteEntities() ([]MigrationRemoteEntity, error)
}

RemoteEntitiesSource defines an inplace usage for reading all the remote entities.

type StatusSource Uses

type StatusSource interface {
    StatusArgs(string) (description.StatusArgs, error)
}

StatusSource defines an in-place usage for reading in the status for a given entity.

Package migrations imports 5 packages (graph) and is imported by 2 packages. Updated 2020-09-03. Refresh now. Tools for package owners.