client

package
v0.0.0-...-65c2b02 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewToken

func NewToken(tok string) (*token, error)

Types

type Remote

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

Remote represents a remote argocd-agent server component

func NewRemote

func NewRemote(hostname string, port int, opts ...RemoteOption) (*Remote, error)

func (*Remote) Addr

func (r *Remote) Addr() string

Addr returns a string representation of the address this remote connects to

func (*Remote) ClientID

func (r *Remote) ClientID() string

func (*Remote) Conn

func (r *Remote) Conn() *grpc.ClientConn

func (*Remote) Connect

func (r *Remote) Connect(ctx context.Context, forceReauth bool) error

Connect connects this Remote to the remote host and performs authentication. If the remote is configured with a retry, Connect will keep trying to establish a connection to the remote host until either the number of maximum retries has been reached or the context ctx is canceled or expired.

When Connect returns nil, the connection was successfully established and an authentication token has been received.

func (*Remote) Creds

func (r *Remote) Creds() auth.Credentials

Creds returns the credentials this Remote uses to connect to the remote host

func (*Remote) Hostname

func (r *Remote) Hostname() string

Hostname returns the name of the host this remote connects to

func (*Remote) Port

func (r *Remote) Port() int

Port returns the port number this remote connects to on the remote host

func (*Remote) SetClientMode

func (r *Remote) SetClientMode(mode types.AgentMode)

func (*Remote) WithBackoff

func (r *Remote) WithBackoff(backoff wait.Backoff) RemoteOption

func (*Remote) WithDialTimeout

func (r *Remote) WithDialTimeout(t time.Duration) RemoteOption

func (*Remote) WithTLSHandShakeTimeout

func (r *Remote) WithTLSHandShakeTimeout(t time.Duration) RemoteOption

type RemoteOption

type RemoteOption func(r *Remote) error

func WithAuth

func WithAuth(method string, creds auth.Credentials) RemoteOption

func WithClientMode

func WithClientMode(mode types.AgentMode) RemoteOption

func WithInsecureSkipTLSVerify

func WithInsecureSkipTLSVerify() RemoteOption

WithInsecureSkipTLSVerify configures the Remote to skip verification of the TLS server certificate

func WithRootAuthorities

func WithRootAuthorities(caData []byte) RemoteOption

WithRootAuthorities configures the Remote to use TLS certificate authorities from PEM data in caData for verifying server certificates.

func WithRootAuthoritiesFromFile

func WithRootAuthoritiesFromFile(caPath string) RemoteOption

WithRootAuthoritiesFromFile configures the Remote to use TLS certificate authorities from file caPath for verifying server certificates.

func WithTLSClientCert

func WithTLSClientCert(cert *x509.Certificate, key crypto.PrivateKey) RemoteOption

func WithTLSClientCertFromBytes

func WithTLSClientCertFromBytes(certData []byte, keyData []byte) RemoteOption

WithTLSClientCertFromBytes configures the Remote to present the client cert given as certData and private key given as keyData on every outbound connection. Both, certData and keyData must be PEM encoded.

func WithTLSClientCertFromFile

func WithTLSClientCertFromFile(certPath, keyPath string) RemoteOption

WithTLSClientCertFromFile configures the Remote to present the client cert loaded from certPath and private key loaded from keyPath on every outbound connection.

Jump to

Keyboard shortcuts

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