context

package
v0.0.0-...-2608902 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2016 License: AGPL-3.0 Imports: 10 Imported by: 0

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

func NewContextAPI(apiClient APIClient, dataDir string) *Context

NewContextAPI returns a new Content for the given API client and data dir.

func (*Context) Download

func (c *Context) Download(name string) (string, error)

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.

func (*Context) Flush

func (c *Context) Flush() error

Flush implements jujuc.Context.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL