lstags: github.com/ivanilves/lstags/repository Index | Files

package repository

import "github.com/ivanilves/lstags/repository"

Package repository provides Repository abstraction to handle Docker repositories. This includes parsing and validation of repo specification passed in a text form, as well as association of the Docker repository with tags (images) it should contain.

Index

Package Files

repository.go

Constants

const RefSpec = "[REGISTRY[:PORT]/]REPOSITORY[:TAG|=TAG1,TAG2,TAGn|~/FILTER_REGEXP/]"

RefSpec is the description of a valid Docker repository specification

Variables

var InsecureRegistryEx = `^(127\..*|::1|localhost)(:[0-9]+)?$`

InsecureRegistryEx contains a regex string to match insecure (non-HTTPS) registries

func GetRegistry Uses

func GetRegistry(ref string) string

GetRegistry extracts registry address from the repository reference

type Repository Uses

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

Repository is a parsed, valid Docker repository reference

func ParseRef Uses

func ParseRef(ref string) (*Repository, error)

ParseRef takes a string repository reference and transforms it into a Repository structure

func ParseRefs Uses

func ParseRefs(refs []string) ([]*Repository, error)

ParseRefs is a shorthand for ParseRef to parse multiple repository references at once

func (*Repository) Filter Uses

func (r *Repository) Filter() string

Filter gives us a string form of /FILTER/ regexp we use to match repository tags

func (*Repository) Full Uses

func (r *Repository) Full() string

Full gives us repository in a "full" form REGISTRY[:PORT]/REPOSITORY

func (*Repository) HasFilter Uses

func (r *Repository) HasFilter() bool

HasFilter tells us if we've specified /FILTER/ regexp to match tags for this repository

func (*Repository) HasTags Uses

func (r *Repository) HasTags() bool

HasTags tells us if we've specified some concrete tags for this repository

func (*Repository) IsDefaultRegistry Uses

func (r *Repository) IsDefaultRegistry() bool

IsDefaultRegistry tells us if we use default registry (DockerHub)

func (*Repository) IsSecure Uses

func (r *Repository) IsSecure() bool

IsSecure tells us if we use secure (HTTPS) connection for this registry/repository

func (*Repository) IsSingle Uses

func (r *Repository) IsSingle() bool

IsSingle tells us if we created repo from reference having only single tag specified

func (*Repository) MatchTag Uses

func (r *Repository) MatchTag(tag string) bool

MatchTag matches passed tag against repository tag and filter specification

func (*Repository) Name Uses

func (r *Repository) Name() string

Name is same as Full() but cuts leading REGISTRY[:PORT]/ if we use default registry (DockerHub)

func (*Repository) Path Uses

func (r *Repository) Path() string

Path gives us repository path without registry hostname e.g. "library/alpine"

func (*Repository) PushPath Uses

func (r *Repository) PushPath(pathSeparator string) string

PushPath returns a repository path with a custom path element separator

func (*Repository) PushPrefix Uses

func (r *Repository) PushPrefix() string

PushPrefix generates prefix path for repository in a "push" registry

func (*Repository) Ref Uses

func (r *Repository) Ref() string

Ref gets original repository reference string

func (*Repository) Registry Uses

func (r *Repository) Registry() string

Registry gets registry ADDR[:PORT]

func (*Repository) Tags Uses

func (r *Repository) Tags() []string

Tags gives us list of tags we specified for this repository (It will return `[]string{}` if we have not specified any)

func (*Repository) WebSchema Uses

func (r *Repository) WebSchema() string

WebSchema tells us we use "http://" or "https://" to connect to this registry/repository

Package repository imports 3 packages (graph) and is imported by 6 packages. Updated 2019-11-25. Refresh now. Tools for package owners.