~juju-qa/ubuntu/xenial/juju/xenial-2.0-beta3

« back to all changes in this revision

Viewing changes to src/github.com/juju/juju/apiserver/migrationmaster/export_test.go

  • Committer: Martin Packman
  • Date: 2016-03-30 19:31:08 UTC
  • mfrom: (1.1.41)
  • Revision ID: martin.packman@canonical.com-20160330193108-h9iz3ak334uk0z5r
Merge new upstream source 2.0~beta3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright 2016 Canonical Ltd.
 
2
// Licensed under the AGPLv3, see LICENCE file for details.
 
3
 
 
4
package migrationmaster
 
5
 
 
6
import (
 
7
        "github.com/juju/juju/migration"
 
8
        "github.com/juju/juju/state"
 
9
)
 
10
 
 
11
func PatchState(p Patcher, st Backend) {
 
12
        p.PatchValue(&getBackend, func(*state.State) Backend {
 
13
                return st
 
14
        })
 
15
}
 
16
 
 
17
func PatchExportModel(p Patcher, f func(migration.StateExporter) ([]byte, error)) {
 
18
        p.PatchValue(&exportModel, f)
 
19
}
 
20
 
 
21
type Patcher interface {
 
22
        PatchValue(ptr, value interface{})
 
23
}