juju: github.com/juju/juju/resource/api/private/client Index | Files

package client

import "github.com/juju/juju/resource/api/private/client"

Index

Package Files

client.go

type FacadeCaller Uses

type FacadeCaller interface {
    // FacadeCall makes an API request.
    FacadeCall(request string, args, response interface{}) error
}

FacadeCaller exposes the raw API caller functionality needed here.

type HTTPClient Uses

type HTTPClient interface {
    // Do sends the HTTP request/body and unpacks the response into
    // the provided "resp". If that is a **http.Response then it is
    // unpacked as-is. Otherwise it is unmarshaled from JSON.
    Do(req *http.Request, body io.ReadSeeker, resp interface{}) error
}

HTTPClient exposes the raw API HTTP caller functionality needed here.

type UnitFacadeClient Uses

type UnitFacadeClient struct {
    FacadeCaller
    HTTPClient
}

UnitFacadeClient is an API client for the resources portion of the uniter facade.

func NewUnitFacadeClient Uses

func NewUnitFacadeClient(facadeCaller FacadeCaller, httpClient UnitHTTPClient) *UnitFacadeClient

NewUnitFacadeClient creates a new API client for the resources portion of the uniter facade.

func (*UnitFacadeClient) GetResource Uses

func (c *UnitFacadeClient) GetResource(resourceName string) (resource.Resource, io.ReadCloser, error)

GetResource opens the resource (metadata/blob), if it exists, via the HTTP API and returns it. If it does not exist or hasn't been uploaded yet then errors.NotFound is returned.

type UnitHTTPClient Uses

type UnitHTTPClient interface {
    HTTPClient

    // Unit Returns the name of the unit for this client.
    Unit() string
}

UnitHTTPClient exposes the raw API HTTP caller functionality needed here.

func NewUnitHTTPClient Uses

func NewUnitHTTPClient(client HTTPClient, unitName string) UnitHTTPClient

NewUnitHTTPClient wraps an HTTP client (a la httprequest.Client) with unit information. This allows rewriting of the URL to match the relevant unit.

Package client imports 8 packages (graph) and is imported by 7 packages. Updated 2017-04-03. Refresh now. Tools for package owners.