Documentation ¶
Index ¶
- Constants
- Variables
- func GetRegistry(ref string) string
- type Repository
- func (r *Repository) Filter() string
- func (r *Repository) Full() string
- func (r *Repository) HasFilter() bool
- func (r *Repository) HasTags() bool
- func (r *Repository) IsDefaultRegistry() bool
- func (r *Repository) IsSecure() bool
- func (r *Repository) IsSingle() bool
- func (r *Repository) MatchTag(tag string) bool
- func (r *Repository) Name() string
- func (r *Repository) Path() string
- func (r *Repository) PushPrefix() string
- func (r *Repository) Ref() string
- func (r *Repository) Registry() string
- func (r *Repository) Tags() []string
- func (r *Repository) WebSchema() string
Constants ¶
const RefSpec = "[REGISTRY[:PORT]/]REPOSITORY[:TAG|=TAG1,TAG2,TAGn|~/FILTER_REGEXP/]"
RefSpec is a description of a valid registry specification
Variables ¶
var InsecureRegistryEx = `^(127\..*|::1|localhost)(:[0-9]+)?$`
InsecureRegistryEx contains a regex string to match insecure registries
Functions ¶
func GetRegistry ¶
GetRegistry extracts registry address from the repository reference
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository represents parsed repository reference
func ParseRef ¶
func ParseRef(ref string) (*Repository, error)
ParseRef takes a string repository reference and transforms into a Repository
func ParseRefs ¶
func ParseRefs(refs []string) ([]*Repository, error)
ParseRefs is a shorthand for ParseRef to parse multiple repository references at once
func (*Repository) Filter ¶
func (r *Repository) Filter() string
Filter gives us a string form of /FILTER/ regexp we use to match repository tags
func (*Repository) Full ¶
func (r *Repository) Full() string
Full gives us repository in form REGISTRY[:PORT]/REPOSITORY
func (*Repository) HasFilter ¶
func (r *Repository) HasFilter() bool
HasFilter tells us if we've specified /FILTER/ regexp to match tags for this repository
func (*Repository) HasTags ¶
func (r *Repository) HasTags() bool
HasTags tells us if we've specified some concrete tags for this repository
func (*Repository) IsDefaultRegistry ¶
func (r *Repository) IsDefaultRegistry() bool
IsDefaultRegistry tells us if we use default registry (DockerHub)
func (*Repository) IsSecure ¶
func (r *Repository) IsSecure() bool
IsSecure tells us if we will use secure connection for this repository
func (*Repository) IsSingle ¶
func (r *Repository) IsSingle() bool
IsSingle tells us if we created repo from "refWithSingleTag" reference
func (*Repository) MatchTag ¶
func (r *Repository) MatchTag(tag string) bool
MatchTag matches passed tag against repository tag and filter specification
func (*Repository) Name ¶
func (r *Repository) Name() string
Name is same as full but cuts leading REGISTRY[:PORT]/ if we use default registry (DockerHub)
func (*Repository) Path ¶
func (r *Repository) Path() string
Path gives us remote repository path on the registry e.g. "library/alpine"
func (*Repository) PushPrefix ¶
func (r *Repository) PushPrefix() string
PushPrefix generates prefix path for repository in a "push" registry
func (*Repository) Registry ¶
func (r *Repository) Registry() string
Registry gets registry ADDR[:PORT]
func (*Repository) Tags ¶
func (r *Repository) Tags() []string
Tags gives us list of repository tags we use
func (*Repository) WebSchema ¶
func (r *Repository) WebSchema() string
WebSchema gives us HTTP protocol we will use to connect to repository