listing

package
v1.0.20 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ShowIndex       = flag.Bool("show-index", false, "Show an index page, rather than just a 200 response")
	ShowListings    = flag.Bool("show-listings", true, "Index page lists public repositories")
	PullHostname    = flag.String("pull-hostname", "", "Hostname to show on listings and info page, will default to the request hostname")
	RegistryHost    = flag.String("registry-host", "http://localhost:8080", "The URL of the registry being listed")
	RefreshInterval = flag.Duration("refresh-interval", 60*time.Second, "The time between registry refreshes")
)

Functions

This section is empty.

Types

type Catalog

type Catalog struct {
	Repositories []string `json:"repositories"`
}

type DistributionRepository

type DistributionRepository struct {
	Name string   `json:"name"`
	Tags []string `json:"tags"`
}

type Index

type Index struct {
	Title string
}

type Layer

type Layer struct {
	MediaType string `json:"mediaType"`
	Size      int    `json:"size"`
	Digest    string `json:"digest"`
}

type Lister

type Lister struct {
	TokenProvider  TokenProvider
	PublicPrefixes []string
	// contains filtered or unexported fields
}

func NewLister

func NewLister(publicPrefixes []string, getFullToken func(repository ...string) (string, error)) *Lister

func (*Lister) CSS

func (s *Lister) CSS(writer http.ResponseWriter, _ *http.Request)

func (*Lister) Index

func (s *Lister) Index(writer http.ResponseWriter, req *http.Request)

func (*Lister) Initialise

func (s *Lister) Initialise(router *mux.Router)

func (*Lister) JS

func (s *Lister) JS(writer http.ResponseWriter, _ *http.Request)

func (*Lister) ListingIndex

func (s *Lister) ListingIndex(writer http.ResponseWriter, req *http.Request)

func (*Lister) OK

func (s *Lister) OK(writer http.ResponseWriter, _ *http.Request)

type ListingIndex

type ListingIndex struct {
	Title        string
	Repositories *RepositoryList
	LastPolled   time.Time
}

type Manifest

type Manifest struct {
	SHA    string
	Size   int
	Layers []Layer `json:"layers"`
}

type Repository

type Repository struct {
	Name string
	Tags []Tag
}

type RepositoryList

type RepositoryList struct {
	Repositories []*Repository
}

type Tag

type Tag struct {
	Name string
	SHA  string
	Size int
}

type TokenProvider

type TokenProvider func(...string) (string, error)

Jump to

Keyboard shortcuts

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