Documentation ¶
Index ¶
- Variables
- type MockCharmStore
- func (s *MockCharmStore) Get(charmURL *charm.URL) (charm.Charm, error)
- func (s *MockCharmStore) Latest(charmURLs ...*charm.URL) ([]charm.CharmRevision, error)
- func (s *MockCharmStore) Resolve(ref charm.Reference) (*charm.URL, error)
- func (s *MockCharmStore) SetCharm(charmURL *charm.URL, bundle *charm.Bundle) error
- func (s *MockCharmStore) WithAuthAttrs(auth string) charm.Repository
- func (s *MockCharmStore) WithDefaultSeries(series string) charm.Repository
- func (s *MockCharmStore) WithTestMode(testMode bool) charm.Repository
- type MockStore
- type Repo
- func (r *Repo) Bundle(dst, name string) *charm.Bundle
- func (r *Repo) BundlePath(dst, name string) string
- func (r *Repo) ClonedDir(dst, name string) *charm.Dir
- func (r *Repo) ClonedDirPath(dst, name string) string
- func (r *Repo) ClonedURL(dst, series, name string) *charm.URL
- func (r *Repo) Dir(name string) *charm.Dir
- func (r *Repo) DirPath(name string) string
- func (r *Repo) Path() string
- func (r *Repo) RenamedClonedDirPath(dst, name, newName string) string
Constants ¶
This section is empty.
Variables ¶
var Charms = &Repo{}
Charms represents the specific charm repository stored in this package and used by the Juju unit tests. The series name is "quantal".
Functions ¶
This section is empty.
Types ¶
type MockCharmStore ¶
type MockCharmStore struct { AuthAttrs string TestMode bool DefaultSeries string // contains filtered or unexported fields }
MockCharmStore implements charm.Repository and is used to isolate tests that would otherwise need to hit the real charm store.
func NewMockCharmStore ¶
func NewMockCharmStore() *MockCharmStore
func (*MockCharmStore) Latest ¶
func (s *MockCharmStore) Latest(charmURLs ...*charm.URL) ([]charm.CharmRevision, error)
Latest implements charm.Repository.Latest.
func (*MockCharmStore) SetCharm ¶
SetCharm adds and removes charms in s. The affected charm is identified by charmURL, which must be revisioned. If bundle is nil, the charm will be removed; otherwise, it will be stored. It is an error to store a bundle under a charmURL that does not share its name and revision.
func (*MockCharmStore) WithAuthAttrs ¶
func (s *MockCharmStore) WithAuthAttrs(auth string) charm.Repository
func (*MockCharmStore) WithDefaultSeries ¶
func (s *MockCharmStore) WithDefaultSeries(series string) charm.Repository
func (*MockCharmStore) WithTestMode ¶
func (s *MockCharmStore) WithTestMode(testMode bool) charm.Repository
type MockStore ¶
type MockStore struct { Downloads []*charm.URL DownloadsNoStats []*charm.URL Authorizations []string Metadata []string InfoRequestCount int InfoRequestCountNoStats int DefaultSeries string // contains filtered or unexported fields }
MockStore provides a mock charm store implementation useful when testing.
func NewMockStore ¶
NewMockStore creates a mock charm store containing the specified charms.
func (*MockStore) ServeHTTP ¶
func (s *MockStore) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements http.ServeHTTP
func (*MockStore) UpdateStoreRevision ¶
UpdateStoreRevision sets the revision of the specified charm to rev.
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
Repo represents a charm repository used for testing.
func (*Repo) Bundle ¶
Bundle returns an actual charm.Bundle created from a new charm bundle file created from the charm directory named name, in the directory dst.
func (*Repo) BundlePath ¶
BundlePath returns the path to a new charm bundle file created from the charm directory named name, in the directory dst.
func (*Repo) ClonedDir ¶
ClonedDir returns an actual charm.Dir based on a new copy of the charm directory named name, in the directory dst.
func (*Repo) ClonedDirPath ¶
ClonedDirPath returns the path to a new copy of the default charm directory named name.
func (*Repo) ClonedURL ¶
ClonedURL makes a copy of the charm directory. It will create a directory with the series name if it does not exist, and then clone the charm named name into that directory. The return value is a URL pointing at the local charm.
func (*Repo) DirPath ¶
DirPath returns the path to a charm directory with the given name in the default series
func (*Repo) RenamedClonedDirPath ¶
RenamedClonedDirPath returns the path to a new copy of the default charm directory named name, renamed to newName.