docker

package
v0.0.0-...-d1992f0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Crawl

func Crawl(conf CrawlConfig, images chan *ImageEnvelope)

Crawl will search a registry for Docker images. Search can be filtered in the crawl Config. Will return results on images chan; will close images before returning. Returns error when it cannot proceed. Errors encountered getting image manifests are communicated in the ImageEnvelope.

func GetRegistry

func GetRegistry(registryURL string, username string, password string) (*registry.Registry, error)

GetRegistry returns a registry object that can be used later

Types

type AuthConfig

type AuthConfig struct {

	// RegistryURL, Username, Password are required for obtaining a token.
	// Repo and Tag are required for docker.io as as tokens must have a directed
	// scope.
	RegistryURL string
	Repo        string
	Tag         string
	Username    string
	Password    string
}

AuthConfig struct init

type CrawlConfig

type CrawlConfig struct {
	URL      string                 `json:"url"`
	Username string                 `json:"username"`
	Password string                 `json:"password"`
	Repos    map[string]interface{} `json:"repos"`
	Tags     map[string]interface{} `json:"tags"`
}

CrawlConfig struct init

type Image

type Image struct {
	Registry   string            `json:"registry"`
	Repo       string            `json:"repo"`
	Tag        string            `json:"tag"`
	Digest     string            `json:"digest"`
	Layers     []string          `json:"layers"`
	ManifestV2 datastore.JSONMap `json:"manifest"`
	ManifestV1 datastore.JSONMap `json:"manifestv1"`
	Metadata   datastore.JSONMap `json:"metadata"`
}

Image struct init

func GetImage

func GetImage(hub *registry.Registry, repo string, tag string) (*Image, error)

GetImage returns a Docker Image containing V1 and V2 manifests, its layers, and location information.

type ImageEnvelope

type ImageEnvelope struct {
	Image
	Error error `json:"error"`
}

ImageEnvelope struct init

type Token

type Token struct {
	Token string `json:"token"`
}

Token struct init

func AuthRegistry

func AuthRegistry(authConfig *AuthConfig) (*Token, error)

AuthRegistry will attempt to authenticate to a register with the provided credentials, returning the resulting token.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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