Documentation
¶
Index ¶
Constants ¶
View Source
const HookContextFacade = resource.ComponentName + "-hook-context"
HookContextFacade is the name of the API facade for resources in the uniter.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient interface {
// GetResource returns the resource info and content for the given
// name (and unit-implied service).
GetResource(resourceName string) (resource.Resource, io.ReadCloser, error)
}
APIClient exposes the uniter API functionality needed for resources.
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Content is the resources portion of a uniter hook context.
func NewContextAPI ¶
NewContextAPI returns a new Content for the given API client and data dir.
func (*Context) Download ¶
Download downloads the named resource and returns the path to which it was downloaded. If the resource does not exist or has not been uploaded yet then errors.NotFound is returned.
Note that the downloaded file is checked for correctness.
Source Files
¶
- context.go
Click to show internal directories.
Click to hide internal directories.