harbor

package
v0.24.3 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2021 License: Apache-2.0 Imports: 10 Imported by: 19

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InsecureTransport http.RoundTripper = &http.Transport{
	Proxy: http.ProxyFromEnvironment,
	DialContext: (&net.Dialer{
		Timeout:   30 * time.Second,
		KeepAlive: 30 * time.Second,
		DualStack: true,
	}).DialContext,
	TLSClientConfig: &tls.Config{
		InsecureSkipVerify: true,
	},
	MaxIdleConns:          100,
	IdleConnTimeout:       90 * time.Second,
	TLSHandshakeTimeout:   10 * time.Second,
	ExpectContinueTimeout: 1 * time.Second,
}

InsecureTransport provides a insecure RoundTripper and disable the HTTP2 try.

Functions

This section is empty.

Types

type ClientSet

type ClientSet struct {
	// contains filtered or unexported fields
}

ClientSet contains clients for V2, Assist, Legacy

func NewClientSet

func NewClientSet(csc *ClientSetConfig) (*ClientSet, error)

NewAssistClient return assist Client

func (*ClientSet) Assist

func (c *ClientSet) Assist() *assistclient.HarborAPI

Assist return AssistClient

func (*ClientSet) Legacy

func (c *ClientSet) Legacy() *legacyclient.HarborAPI

Legacy return LegacyClient

func (*ClientSet) V2

func (c *ClientSet) V2() *v2client.HarborAPI

V2 return V2Client

type ClientSetConfig added in v0.24.3

type ClientSetConfig struct {
	URL      string
	Insecure bool
	Username string
	Password string
}

ClientSetConfig contains config for creating a ClientSet

type Config

type Config struct {
	// URL is the base URL of the upstream server
	URL *url.URL
	// Transport is an inner transport for the client
	Transport http.RoundTripper
	// AuthInfo is for authentication
	AuthInfo runtime.ClientAuthInfoWriter
}

Config contains configs for constructing a client

func (*Config) ToAssistConfig

func (c *Config) ToAssistConfig() assistclient.Config

ToAssistConfig convert the Config to assistclient's Config

func (*Config) ToLegacyConfig

func (c *Config) ToLegacyConfig() legacyclient.Config

ToLegacyConfig convert the Config to legacyclient's Config

func (*Config) ToV2Config

func (c *Config) ToV2Config() v2client.Config

ToV2Config convert the Config to v2client's Config

Jump to

Keyboard shortcuts

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