util

package
v0.0.0-...-4a12623 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHTTPTransport

func GetHTTPTransport(insecure bool) http.RoundTripper

GetHTTPTransport can be used to share the common HTTP transport

func IsSpecificPath

func IsSpecificPath(path string) ([]string, bool)

IsSpecificPath checks whether the input path is a specified string If it is, the function returns a string array that parsed from the input path A specified string means we can get a specific string array after parsing it "library/hello-world" is a specified string as it only matches "library/hello-world" "library/**" isn't a specified string as it can match all string that starts with "library/" "library/{test,busybox}" is a specified string as it only matches "library/hello-world" and "library/busybox"

func IsSpecificPathComponent

func IsSpecificPathComponent(component string) ([]string, bool)

IsSpecificPathComponent checks whether the input path component is a specified string If it is, the function returns a string array that parsed from the input component A specified string means we can get a specific string array after parsing it "library" is a specified string as it only matches "library" "library*" isn't a specified string as it can match all string that starts with "library" "{library, test}" is a specified string as it only matches "library" and "test" Note: the function doesn't support the component that contains more than one "{" such as "a{b{c,d}e}f"

func Match

func Match(pattern, str string) (bool, error)

Match returns whether the str matches the pattern

func ParseRepository

func ParseRepository(repository string) (string, string)

ParseRepository parses the "repository" provided into two parts: namespace and the rest the string before the last "/" is the namespace part c -> [,c] b/c -> [b,c] a/b/c -> [a/b,c]

func Ping

func Ping(registry *model.Registry) (string, string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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