discovery

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2015 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package discovery contains an experimental implementation of the Image Discovery section of the appc specification.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Client is the default http.Client used for discovery requests.
	Client *http.Client
)

Functions

func DiscoverEndpoints

func DiscoverEndpoints(app App, insecure bool) (out *Endpoints, attempts []FailedAttempt, err error)

DiscoverEndpoints will make HTTPS requests to find the ac-discovery meta tags and optionally will use HTTP if insecure is set. It will not give up until it has exhausted the path or found an image discovery.

func DiscoverPublicKeys added in v0.4.0

func DiscoverPublicKeys(app App, insecure bool) (out *Endpoints, attempts []FailedAttempt, err error)

DiscoverPublicKey will make HTTPS requests to find the ac-public-keys meta tags and optionally will use HTTP if insecure is set. It will not give up until it has exhausted the path or found an public key.

func DiscoverWalk added in v0.4.0

func DiscoverWalk(app App, insecure bool, discoverFn DiscoverWalkFunc) (err error)

DiscoverWalk will make HTTPS requests to find discovery meta tags and optionally will use HTTP if insecure is set. Based on the response of the discoverFn it will continue to recurse up the tree.

Types

type ACIEndpoint added in v0.3.0

type ACIEndpoint struct {
	ACI string
	ASC string
}

type App

type App struct {
	Name   types.ACIdentifier
	Labels map[types.ACIdentifier]string
}

func NewApp

func NewApp(name string, labels map[types.ACIdentifier]string) (*App, error)

func NewAppFromString

func NewAppFromString(app string) (*App, error)

NewAppFromString takes a command line app parameter and returns a map of labels.

Example app parameters:

example.com/reduce-worker:1.0.0
example.com/reduce-worker,channel=alpha,label=value

func (*App) Copy added in v0.6.0

func (a *App) Copy() *App

func (*App) String added in v0.5.2

func (a *App) String() string

String returns the URL-like image name

type DiscoverWalkFunc added in v0.4.0

type DiscoverWalkFunc func(prefix string, eps *Endpoints, err error) error

DiscoverWalkFunc can stop a DiscoverWalk by returning non-nil error.

type Endpoints

type Endpoints struct {
	ACIEndpoints []ACIEndpoint
	Keys         []string
}

func (*Endpoints) Append added in v0.4.0

func (e *Endpoints) Append(ep Endpoints)

type FailedAttempt added in v0.4.0

type FailedAttempt struct {
	Prefix string
	Error  error
}

FailedAttempt represents a failed discovery attempt. This is for debugging and user feedback.

Jump to

Keyboard shortcuts

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