registry

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2023 License: ISC Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ChallengeHeader = "WWW-Authenticate"

ChallengeHeader is the HTTP Header containing challenge instructions

View Source
const ContentDigestHeader = "Docker-Content-Digest"

ContentDigestHeader is the key for the key-value pair containing the digest header

View Source
const (
	UserAgent = "basechange"
)

Variables

This section is empty.

Functions

func BuildManifestURL

func BuildManifestURL(image string) (string, error)

BuildManifestURL from raw image data

func GetHost

func GetHost(image string) (string, error)

func GetImageDigest

func GetImageDigest(image string) (string, error)

func GetScopeFromImageName

func GetScopeFromImageName(image, svc string) string

GetScopeFromImageName normalizes an image name for use as scope during auth and head requests

func GetToken

func GetToken(image string) (string, error)

GetToken fetches a token for the registry hosting the provided image

func NormalizeRegistry

func NormalizeRegistry(registry string) (string, error)

NormalizeRegistry makes sure variations of DockerHubs registry

func Req

func Req(method, uri string, header http.Header) ([]byte, error)

Req retrieves the Req HTTP response for a given URL.

func RetryReq

func RetryReq(method, url string, maxAttempts int, header http.Header, expectedCode int) (*http.Response, error)

https://codereview.stackexchange.com/q/173468

Types

type TokenResponse

type TokenResponse struct {
	Token string
}

Jump to

Keyboard shortcuts

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