Documentation ¶
Index ¶
- Variables
- func DefaultFlightctlClientConfigPath() string
- func NewFromConfig(config *Config) (*client.ClientWithResponses, error)
- func NewFromConfigFile(filename string) (*client.ClientWithResponses, error)
- func NewWithResponses(endpoint string, caFilePath, certFilePath, keyFilePath string) (*client.ClientWithResponses, error)
- func WriteConfig(filename string, server string, tlsServerName string, ...) error
- type AuthInfo
- type Config
- type Enrollment
- func (e *Enrollment) CreateEnrollmentRequest(ctx context.Context, req v1alpha1.EnrollmentRequest, ...) (*v1alpha1.EnrollmentRequest, error)
- func (e *Enrollment) GetEnrollmentRequest(ctx context.Context, id string, cb ...client.RequestEditorFn) (*v1alpha1.EnrollmentRequest, error)
- func (e *Enrollment) SetRPCMetricsCallback(cb func(operation string, durationSeconds float64, err error))
- type Management
- func (m *Management) GetDevice(ctx context.Context, name string, rcb ...client.RequestEditorFn) (*v1alpha1.Device, error)
- func (m *Management) GetRenderedDeviceSpec(ctx context.Context, name string, params *v1alpha1.GetRenderedDeviceSpecParams, ...) (*v1alpha1.RenderedDeviceSpec, int, error)
- func (m *Management) UpdateDevice(ctx context.Context, name string, req v1alpha1.Device, ...) (*v1alpha1.Device, error)
- func (m *Management) UpdateDeviceStatus(ctx context.Context, name string, device v1alpha1.Device, ...) error
- type Service
Constants ¶
This section is empty.
Variables ¶
var (
ErrEmptyResponse = errors.New("empty response")
)
Functions ¶
func DefaultFlightctlClientConfigPath ¶
func DefaultFlightctlClientConfigPath() string
DefaultFlightctlClientConfigPath returns the default path to the FlightCtl client config file.
func NewFromConfig ¶
func NewFromConfig(config *Config) (*client.ClientWithResponses, error)
NewFromConfig returns a new FlightCtl API client from the given config.
func NewFromConfigFile ¶
func NewFromConfigFile(filename string) (*client.ClientWithResponses, error)
NewFromConfigFile returns a new FlightCtl API client using the config read from the given file.
func NewWithResponses ¶
func NewWithResponses(endpoint string, caFilePath, certFilePath, keyFilePath string) (*client.ClientWithResponses, error)
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"` }
AuthInfo contains information for authenticating FlightCtl API clients.
type Config ¶
Config holds the information needed to connect to a FlightCtl API server
type Enrollment ¶
type Enrollment struct {
// contains filtered or unexported fields
}
func NewEnrollment ¶
func NewEnrollment( client *client.ClientWithResponses, ) *Enrollment
func (*Enrollment) CreateEnrollmentRequest ¶
func (e *Enrollment) CreateEnrollmentRequest(ctx context.Context, req v1alpha1.EnrollmentRequest, cb ...client.RequestEditorFn) (*v1alpha1.EnrollmentRequest, error)
func (*Enrollment) GetEnrollmentRequest ¶
func (e *Enrollment) GetEnrollmentRequest(ctx context.Context, id string, cb ...client.RequestEditorFn) (*v1alpha1.EnrollmentRequest, error)
func (*Enrollment) SetRPCMetricsCallback ¶
func (e *Enrollment) SetRPCMetricsCallback(cb func(operation string, durationSeconds float64, err error))
type Management ¶
type Management struct {
// contains filtered or unexported fields
}
func NewManagement ¶
func NewManagement( client *client.ClientWithResponses, ) *Management
func (*Management) GetDevice ¶
func (m *Management) GetDevice(ctx context.Context, name string, rcb ...client.RequestEditorFn) (*v1alpha1.Device, error)
func (*Management) GetRenderedDeviceSpec ¶
func (m *Management) GetRenderedDeviceSpec(ctx context.Context, name string, params *v1alpha1.GetRenderedDeviceSpecParams, rcb ...client.RequestEditorFn) (*v1alpha1.RenderedDeviceSpec, int, error)
GetRenderedDeviceSpec returns the rendered device spec for the given device and the response code. If the server returns a 200, the rendered device spec is returned. If the server returns a 204, the rendered device spec is nil, and the response code is returned which should be evaluated but the caller.
func (*Management) UpdateDevice ¶
func (*Management) UpdateDeviceStatus ¶
func (m *Management) UpdateDeviceStatus(ctx context.Context, name string, device v1alpha1.Device, rcb ...client.RequestEditorFn) error
UpdateDeviceStatus updates the status of the device with the given name.
type Service ¶
type Service struct { // Server is the URL of the FlightCtl 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"` }
Service contains information how to connect to and authenticate the FlightCtl API server.