repos

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BaseUrl      = "service/rest"
	RepoUrl      = BaseUrl + "/v1/repositories"
	ComponentUrl = BaseUrl + "/v1/components?repository="
)
View Source
const LIMIT = 100

Variables

This section is empty.

Functions

func NewDockerRegistryClient

func NewDockerRegistryClient(endpoint, username, password string) *dockerRegistryClient

func NewHarborClient

func NewHarborClient(endpoint, username, password, version string) *harborClient

func NewNexusClient

func NewNexusClient(endpoint, username, password string) *nexusClient

Types

type BasicTransport

type BasicTransport struct {
	Transport http.RoundTripper
	URL       string
	Username  string
	Password  string
}

func (*BasicTransport) RoundTrip

func (t *BasicTransport) RoundTrip(req *http.Request) (*http.Response, error)

type Config added in v1.5.0

type Config struct {
	Type     string
	EndPoint string
	//DownloadUrl string
	Credential Credential
	Version    string
}

type Credential added in v1.5.0

type Credential struct {
	Username string
	Password string
}

type HttpClient

type HttpClient struct {
	Username string
	Password string
	Host     string
}

func (*HttpClient) Do

func (h *HttpClient) Do(request *http.Request) (body []byte, resp *http.Response, err error)

func (*HttpClient) Get

func (h *HttpClient) Get(endpoint string) ([]byte, *http.Response, error)

func (*HttpClient) GetNameResult added in v1.4.1

func (h *HttpClient) GetNameResult(url string) ([]NameResult, error)

func (*HttpClient) NewRequest

func (h *HttpClient) NewRequest(method, endpoint string) (request *http.Request, err error)

type ItemResult

type ItemResult struct {
	Items             []NameResult
	ContinuationToken string `json:"continuationToken"`
}

type NameResult

type NameResult struct {
	Name      string
	Version   string
	Format    string
	ProjectID int `json:"project_id"`
}

type ProjectRequest added in v1.5.0

type ProjectRequest struct {
	Page          int    `json:"page"`
	Limit         int    `json:"limit"`
	Name          string `json:"name"`
	ContinueToken string `json:"continueToken"`
}

type RepoRequest added in v1.5.0

type RepoRequest struct {
	Repo          string `json:"repo"`
	Page          int    `json:"page"`
	Limit         int    `json:"limit"`
	Search        string `json:"search"`
	ContinueToken string `json:"continueToken"`
}

type RepoResponse added in v1.5.0

type RepoResponse struct {
	Items         []string `json:"items"`
	Total         int      `json:"total"`
	ContinueToken string   `json:"continueToken"`
}

Jump to

Keyboard shortcuts

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