Documentation
¶
Index ¶
- Constants
- func DialVsock(ctx context.Context, cid, port uint32) (net.Conn, error)
- func NewInet(config Config) (apiClient *api.ClientWithResponses, err error)
- func NewUDS(config Config) (apiClient *api.ClientWithResponses, err error)
- func NewUDSClient(config Config) *http.Client
- func NewVsock(config Config) (*api.ClientWithResponses, error)
- func ParseVsockURL(s string) (cid, port uint32, err error)
- type Config
- type RefreshTransport
Constants ¶
const ( UDSPrefix = "http:///" InetPrefix = "https://" )
const ( // VsockPrefix is the scheme of the url of the daemon of a guest, reached // from its hypervisor: vsock://<context id>:<port>. VsockPrefix = "vsock://" )
Variables ¶
This section is empty.
Functions ¶
func DialVsock ¶
DialVsock connects to the port of the context id from a reserved source port. The bind needs CAP_NET_BIND_SERVICE, and a port in use the next one.
func NewInet ¶
func NewInet(config Config) (apiClient *api.ClientWithResponses, err error)
NewInet returns api *api.ClientWithResponses from config.
request authorization header will be created from one of config properties: - Username & Password - Bearer - BearerFunc, called once the connection is ready - Authorization
func NewUDSClient ¶
func NewVsock ¶
func NewVsock(config Config) (*api.ClientWithResponses, error)
NewVsock returns a client of the daemon of a guest. A daemon not running is an error at the first request, with no retry: the caller has other ways to reach the guest.
func ParseVsockURL ¶
ParseVsockURL returns the context id and the port of a vsock url.
Types ¶
type Config ¶
type Config struct {
Certificate string
Key string
Username string
Password string `json:"-"`
URL string `json:"url"`
Authorization string `json:"-"`
Bearer string `json:"-"`
BearerFunc func() (string, error) `json:"-"`
Timeout time.Duration
InsecureSkipVerify bool
RootCA string
ServerName string
Tokens tokencache.Entry
}
Config is the agent HTTP/2 requester configuration
type RefreshTransport ¶
type RefreshTransport struct {
Base http.RoundTripper
Username string
Password string
// contains filtered or unexported fields
}