hub

package
v0.0.0-...-93529e1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImageInfo

type ImageInfo struct {
	ImageName   string
	IsInspected bool
	IsPrivate   bool
}

type ImageList

type ImageList struct {
	CurrentPage int
	PageCount   int
	ImageCount  int
	Images      []ImageInfo
}

type Info

type Info struct {
	Name            string     `json:"name"`
	Namespace       string     `json:"namespace"`
	Description     string     `json:"description"`
	FullDescription string     `json:"full_description"`
	IsAutomated     bool       `json:"is_automated"`
	IsPrivate       bool       `json:"is_private"`
	LastUpdated     *time.Time `json:"last_updated"`
	PullCount       int        `json:"pull_count"`
	StarCount       int        `json:"star_count"`
}

Info is returned from the hub.docker.com/v2/repositories API

type InfoService

type InfoService struct {
	// contains filtered or unexported fields
}

InfoService connects to the Docker Hub over the internet

func NewMockService

func NewMockService(transport *http.Transport) InfoService

NewMockService is for testing

func NewService

func NewService() InfoService

NewService is a real info service

func (*InfoService) Info

func (hub *InfoService) Info(image registry.Image) (hubInfo Info, err error)

Info gets information about this image

func (*InfoService) Login

func (hub *InfoService) Login(user string, password string) (token string, err error)

Login logs in to get an auth token from Docker Hub

func (*InfoService) UserNamespaceImages

func (hub *InfoService) UserNamespaceImages(user string, password string, namespace string, page int) (imageList ImageList, notfound bool, err error)

UserNamespaceImages gets the list of images within a namespace

func (*InfoService) UserNamespaces

func (hub *InfoService) UserNamespaces(user string, password string) (namespaceList NamespaceList, err error)

UserNamespaces gets the namespaces the user belongs to including any orgs they are a member of

type NamespaceList

type NamespaceList struct {
	Namespaces []string
}

Jump to

Keyboard shortcuts

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