Documentation
¶
Index ¶
- Constants
- func CreateTLSConfigFromConfig(config *Config) (*tls.Config, error)
- func DefaultFlightctlClientConfigPath() string
- func NewFromConfig(config *Config) (*client.ClientWithResponses, error)
- func NewFromConfigFile(filename string) (*client.ClientWithResponses, error)
- func NewGRPCClientFromConfig(config *Config, endpoint string) (grpc_v1.RouterServiceClient, error)
- func NewGrpcClientFromConfigFile(filename string, endpoint string) (grpc_v1.RouterServiceClient, error)
- func NewHTTPClientFromConfig(config *Config) (*http.Client, error)
- func WriteConfig(filename string, server string, tlsServerName string, ...) error
- type AuthInfo
- type Config
- func (c *Config) DeepCopy() *Config
- func (c *Config) Equal(c2 *Config) bool
- func (c *Config) Flatten() error
- func (c *Config) GetClientCertificatePath() string
- func (c *Config) GetClientKeyPath() string
- func (c *Config) HasCredentials() bool
- func (c *Config) Persist(filename string) error
- func (c *Config) SetBaseDir(baseDir string)
- func (c *Config) Validate() error
- type Service
Constants ¶
const (
// TestRootDirEnvKey is the environment variable key used to set the file system root when testing.
TestRootDirEnvKey = "FLIGHTCTL_TEST_ROOT_DIR"
)
Variables ¶
This section is empty.
Functions ¶
func CreateTLSConfigFromConfig ¶ added in v0.4.0
func DefaultFlightctlClientConfigPath ¶
func DefaultFlightctlClientConfigPath() string
DefaultFlightctlClientConfigPath returns the default path to the Flight Control client config file.
func NewFromConfig ¶
func NewFromConfig(config *Config) (*client.ClientWithResponses, error)
NewFromConfig returns a new Flight Control API client from the given config.
func NewFromConfigFile ¶
func NewFromConfigFile(filename string) (*client.ClientWithResponses, error)
NewFromConfigFile returns a new Flight Control API client using the config read from the given file.
func NewGRPCClientFromConfig ¶
func NewGRPCClientFromConfig(config *Config, endpoint string) (grpc_v1.RouterServiceClient, error)
NewGRPCClientFromConfig returns a new gRPC Client from the given config.
func NewGrpcClientFromConfigFile ¶
func NewGrpcClientFromConfigFile(filename string, endpoint string) (grpc_v1.RouterServiceClient, error)
NewFromConfigFile returns a new Flight Control API client using the config read from the given file.
func NewHTTPClientFromConfig ¶
NewHTTPClientFromConfig returns a new HTTP Client from the given config.
func WriteConfig ¶
func WriteConfig(filename string, server string, tlsServerName string, ca *crypto.TLSCertificateConfig, client *crypto.TLSCertificateConfig) error
WriteConfig writes a client config file using the given parameters.
Types ¶
type AuthInfo ¶
type AuthInfo struct {
// ClientCertificate is the path to a client cert file for TLS.
// +optional
ClientCertificate string `json:"client-certificate,omitempty"`
// ClientCertificateData contains PEM-encoded data from a client cert file for TLS. Overrides ClientCertificate.
// +optional
ClientCertificateData []byte `json:"client-certificate-data,omitempty"`
// ClientKey is the path to a client key file for TLS.
// +optional
ClientKey string `json:"client-key,omitempty"`
// ClientKeyData contains PEM-encoded data from a client key file for TLS. Overrides ClientKey.
// +optional
ClientKeyData []byte `json:"client-key-data,omitempty" datapolicy:"security-key"`
// Bearer token for authentication
// +optional
Token string `json:"token,omitempty"`
}
AuthInfo contains information for authenticating Flight Control API clients.
type Config ¶
type Config struct {
Service Service `json:"service"`
AuthInfo AuthInfo `json:"authentication"`
// contains filtered or unexported fields
}
Config holds the information needed to connect to a Flight Control API server
func NewDefault ¶
func NewDefault() *Config
func ParseConfigFile ¶
func (*Config) GetClientCertificatePath ¶
func (*Config) GetClientKeyPath ¶
func (*Config) HasCredentials ¶
func (*Config) SetBaseDir ¶
type Service ¶
type Service struct {
// Server is the URL of the Flight Control API server (the part before /api/v1/...).
Server string `json:"server"`
// TLSServerName is passed to the server for SNI and is used in the client to check server certificates against.
// If TLSServerName is empty, the hostname used to contact the server is used.
// +optional
TLSServerName string `json:"tls-server-name,omitempty"`
// CertificateAuthority is the path to a cert file for the certificate authority.
CertificateAuthority string `json:"certificate-authority,omitempty"`
// CertificateAuthorityData contains PEM-encoded certificate authority certificates. Overrides CertificateAuthority
CertificateAuthorityData []byte `json:"certificate-authority-data,omitempty"`
InsecureSkipVerify bool `json:"insecureSkipVerify,omitempty"`
}
Service contains information how to connect to and authenticate the Flight Control API server.