utils

package
v0.0.0-...-977965f Latest Latest
Warning

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

Go to latest
Published: May 28, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildBlobURL

func BuildBlobURL(endpoint, repository, digest string) string

BuildBlobURL ... 构建访问 Blob的访问的地址

func GetClient

func GetClient() (*http.Client, error)

GetClient returns the HTTP client that will attach jobService secret to the request, which can be used for accessing Harbor's Core Service. This function returns error if the secret of Job service is not set. 创建HTTP client其可以给发往 Core Service 的请求附带上 jobService secret的信息,主要是用来访问内部的 registry 的。 访问 registry 的 client

func GetTokenForRepo

func GetTokenForRepo(repository, secret, internalTokenServiceURL string) (string, error)

GetTokenForRepo is used for job handler to get a token for clair. 为 clair 访问 registry 提供 token信息。

func NewRepositoryClient

func NewRepositoryClient(endpoint string, insecure bool, credential auth.Credential,
	tokenServiceEndpoint, repository string) (*registry.Repository, error)

NewRepositoryClient creates a repository client with standard token authorizer 没有使用

func NewRepositoryClientForJobservice

func NewRepositoryClientForJobservice(repository, internalRegistryURL, secret, internalTokenServiceURL string) (*registry.Repository, error)

NewRepositoryClientForJobservice creates a repository client that can only be used to access the internal registry 创建访问存储库的client

Types

type UserAgentModifier

type UserAgentModifier struct {
	UserAgent string
}

UserAgentModifier adds the "User-Agent" header to the request

func (*UserAgentModifier) Modify

func (u *UserAgentModifier) Modify(req *http.Request) error

Modify adds user-agent header to the request

Jump to

Keyboard shortcuts

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