dockerhub

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Logger = log.Log.WithName("dockerhub-registry")

Functions

func ParseName

func ParseName(fullName string) (namespace, repository string, err error)

Types

type Authorizer

type Authorizer struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type Client

type Client struct {
	Name, Namespace string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(c client.Client, registry types.NamespacedName, scheme *runtime.Scheme, httpClient *cmhttp.HttpClient) *Client

NewClient is api client of internal registry

func (*Client) DeleteManifest

func (c *Client) DeleteManifest(image string, manifest *image.ImageManifest) error

DeleteManifest deletes manifest in the registry

func (*Client) ExistBlob

func (c *Client) ExistBlob(repository, digest string) (bool, error)

ExistBlob checks if blob exists

func (*Client) GetManifest

func (c *Client) GetManifest(image string) (*image.ImageManifest, error)

GetManifest gets manifests of image in the registry

func (*Client) ListNamespaces

func (c *Client) ListNamespaces() []string

func (*Client) ListRepositories

func (c *Client) ListRepositories() *image.APIRepositories

ListRepositories get repository list from registry server

func (*Client) ListTags

func (c *Client) ListTags(repository string) *image.APIRepository

ListTags get tag list of repository from registry server

func (*Client) LoginDockerHub

func (c *Client) LoginDockerHub() error

func (*Client) PullBlob

func (c *Client) PullBlob(repository, digest string) (string, int64, error)

PullBlob pulls and stores blob

func (*Client) PushBlob

func (c *Client) PushBlob(repository, digest, blobPath string, size int64) error

PushBlob pushes and stores blob

func (*Client) PutManifest

func (c *Client) PutManifest(image string, manifest *image.ImageManifest) error

PutManifest updates manifest in the registry

func (*Client) Synchronize

func (c *Client) Synchronize() error

Synchronize synchronizes repository list between tmax.io.Repository resource and Registry server

type NamespacesResponse

type NamespacesResponse struct {
	Namespaces []string `json:"namespaces"`
}

type RepositoriesResponse

type RepositoriesResponse struct {
	Count        int          `json:"count"`
	Next         string       `json:"next"`
	Previous     string       `json:"previous"`
	Repositories []Repository `json:"results"`
}

type Repository

type Repository struct {
	User              string    `json:"user"`
	Name              string    `json:"name"`
	Namespace         string    `json:"namespace"`
	RepositoryType    string    `json:"repository_type"`
	Status            int       `json:"status"`
	Description       string    `json:"description"`
	IsPrivate         bool      `json:"is_private"`
	IsAutomated       bool      `json:"is_automated"`
	CanEdit           bool      `json:"can_edit"`
	StarCount         int       `json:"star_count"`
	PullCount         int       `json:"pull_count"`
	LastUpdated       time.Time `json:"last_updated"`
	IsMigrated        bool      `json:"is_migrated"`
	CollaboratorCount int       `json:"collaborator_count"`
	Affiliation       string    `json:"affiliation"`
	HubUser           string    `json:"hub_user"`
}

type Tag

type Tag struct {
	Name string `json:"name"`
}

type TagsResponse

type TagsResponse struct {
	Count    int    `json:"count"`
	Next     string `json:"next"`
	Previous string `json:"previous"`
	Tags     []Tag  `json:"results"`
}

Jump to

Keyboard shortcuts

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