Documentation ¶
Index ¶
- func BuildBlobURL(endpoint, repository, digest string) string
- func GetClient() (*http.Client, error)
- func GetTokenForRepo(repository, secret, internalTokenServiceURL string) (string, error)
- func NewRepositoryClient(endpoint string, insecure bool, credential auth.Credential, ...) (*registry.Repository, error)
- func NewRepositoryClientForJobservice(repository, internalRegistryURL, secret, internalTokenServiceURL string) (*registry.Repository, error)
- type UserAgentModifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildBlobURL ¶
BuildBlobURL ... 构建访问 Blob的访问的地址
func GetClient ¶
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 ¶
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