lstags: github.com/ivanilves/lstags/api/v1 Index | Files | Directories

package v1

import "github.com/ivanilves/lstags/api/v1"

Package v1 provides lstags v1 API to be used both by the application itself and by external projects

Index

Package Files

v1.go

type API Uses

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

API represents configured application API instance, the main abstraction you are supposed to work with

func New Uses

func New(config Config) (*API, error)

New creates new instance of application API

func (*API) CollectPushTags Uses

func (api *API) CollectPushTags(cn *collection.Collection, push PushConfig) (*collection.Collection, error)

CollectPushTags blends passed collection with information fetched from [local] "push" registry, makes required comparisons between them and spits organized info back as collection.Collection

func (*API) CollectTags Uses

func (api *API) CollectTags(refs ...string) (*collection.Collection, error)

CollectTags collects information on tags present in remote registry and [local] Docker daemon, makes required comparisons between them and spits organized info back as collection.Collection

func (*API) PullTags Uses

func (api *API) PullTags(cn *collection.Collection) error

PullTags compares images from remote registry and Docker daemon and pulls images that match tag spec passed and are not present in Docker daemon.

func (*API) PushTags Uses

func (api *API) PushTags(cn *collection.Collection, push PushConfig) error

PushTags compares images from remote and "push" (usually local) registries, pulls images that are present in remote registry, but are not in "push" one and then [re-]pushes them to the "push" registry.

type Config Uses

type Config struct {
    // DockerJSONConfigFile is a path to Docker JSON config file
    DockerJSONConfigFile string
    // ConcurrentRequests defines how much requests to registry we could run in parallel
    ConcurrentRequests int
    // WaitBetween defines how much we will wait between batches of requests (incl. pull and push)
    WaitBetween time.Duration
    // TraceRequests sets if we will print out registry HTTP request traces
    TraceRequests bool
    // RetryRequests defines how much retries we will do to the failed HTTP request
    RetryRequests int
    // RetryDelay defines how much we will wait between failed HTTP request and retry
    RetryDelay time.Duration
    // InsecureRegistryEx is a regex string to match insecure (non-HTTPS) registries
    InsecureRegistryEx string
    // VerboseLogging sets if we will print debug log messages
    VerboseLogging bool
    // DryRun sets if we will dry run pull or push
    DryRun bool
}

Config holds API instance configuration

type PushConfig Uses

type PushConfig struct {
    // Prefix is prepended to the repository path while pushing to the registry
    Prefix string
    // Registry is an address of the Docker registry in which we push our images
    Registry string
    // UpdateChanged tells us if we will re-push (update/overwrite) images having same tag, but different digest
    UpdateChanged bool
    // PathSeparator defines which path separator to use (default: "/")
    PathSeparator string
    // PathTemplate is a template to change push path, sprig functions are supprted
    PathTemplate string
    // TagTemplate is a template to change push tag, sprig functions are supprted
    TagTemplate string
}

PushConfig holds push-specific configuration (where to push and with which prefix)

Directories

PathSynopsis
collectionPackage collection provides a "container" structure to store Docker registry query results in a well organized and easily accessible form.
registry/clientPackage client provides Docker registry client API
registry/client/auth
registry/client/auth/basic
registry/client/auth/basic/store
registry/client/auth/bearer
registry/client/auth/none
registry/client/cache
registry/client/request
registry/container

Package v1 imports 22 packages (graph) and is imported by 1 packages. Updated 2020-10-06. Refresh now. Tools for package owners.