~juju-qa/ubuntu/yakkety/juju/2.0-rc3-again

« back to all changes in this revision

Viewing changes to src/launchpad.net/juju-core/environs/storage.go

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-04-24 22:34:47 UTC
  • Revision ID: package-import@ubuntu.com-20130424223447-f0qdji7ubnyo0s71
Tags: upstream-1.10.0.1
ImportĀ upstreamĀ versionĀ 1.10.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package environs
 
2
 
 
3
import (
 
4
        "fmt"
 
5
        "io"
 
6
)
 
7
 
 
8
// EmptyStorage holds a StorageReader object that contains no files and
 
9
// offers no URLs.
 
10
var EmptyStorage StorageReader = emptyStorage{}
 
11
 
 
12
type emptyStorage struct{}
 
13
 
 
14
func (s emptyStorage) Get(name string) (io.ReadCloser, error) {
 
15
        return nil, &NotFoundError{fmt.Errorf("file %q not found", name)}
 
16
}
 
17
 
 
18
func (s emptyStorage) URL(name string) (string, error) {
 
19
        return "", fmt.Errorf("file %q not found", name)
 
20
}
 
21
 
 
22
func (s emptyStorage) List(prefix string) ([]string, error) {
 
23
        return nil, nil
 
24
}