Documentation ¶
Index ¶
- func NewToken(tok string) (*token, error)
- type Remote
- func (r *Remote) Addr() string
- func (r *Remote) ClientID() string
- func (r *Remote) Conn() *grpc.ClientConn
- func (r *Remote) Connect(ctx context.Context, forceReauth bool) error
- func (r *Remote) Creds() auth.Credentials
- func (r *Remote) Hostname() string
- func (r *Remote) Port() int
- func (r *Remote) SetClientMode(mode types.AgentMode)
- func (r *Remote) WithBackoff(backoff wait.Backoff) RemoteOption
- func (r *Remote) WithDialTimeout(t time.Duration) RemoteOption
- func (r *Remote) WithTLSHandShakeTimeout(t time.Duration) RemoteOption
- type RemoteOption
- func WithAuth(method string, creds auth.Credentials) RemoteOption
- func WithClientMode(mode types.AgentMode) RemoteOption
- func WithInsecureSkipTLSVerify() RemoteOption
- func WithRootAuthorities(caData []byte) RemoteOption
- func WithRootAuthoritiesFromFile(caPath string) RemoteOption
- func WithTLSClientCert(cert *x509.Certificate, key crypto.PrivateKey) RemoteOption
- func WithTLSClientCertFromBytes(certData []byte, keyData []byte) RemoteOption
- func WithTLSClientCertFromFile(certPath, keyPath string) RemoteOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Remote ¶
type Remote struct {
// contains filtered or unexported fields
}
Remote represents a remote argocd-agent server component
func (*Remote) Conn ¶
func (r *Remote) Conn() *grpc.ClientConn
func (*Remote) Connect ¶
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) SetClientMode ¶
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 ¶
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.