github.com/juju/juju@v0.0.0-20240430160146-1752b71fcf00/upgrades/backend.go (about)

     1  // Copyright 2017 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package upgrades
     5  
     6  import (
     7  	environscloudspec "github.com/juju/juju/environs/cloudspec"
     8  	"github.com/juju/juju/environs/config"
     9  	"github.com/juju/juju/state"
    10  )
    11  
    12  // StateBackend provides an interface for upgrading the global state database.
    13  type StateBackend interface{}
    14  
    15  // Model is an interface providing access to the details of a model within the
    16  // controller.
    17  type Model interface {
    18  	Config() (*config.Config, error)
    19  	CloudSpec() (environscloudspec.CloudSpec, error)
    20  }
    21  
    22  // NewStateBackend returns a new StateBackend using a *state.StatePool object.
    23  func NewStateBackend(pool *state.StatePool) StateBackend {
    24  	return stateBackend{pool}
    25  }
    26  
    27  type stateBackend struct {
    28  	pool *state.StatePool
    29  }