Documentation
¶
Overview ¶
Package client implements image factory HTTP API client.
Index ¶
- func IsHTTPErrorCode(err error, code int) bool
- func IsInvalidSchematicError(err error) bool
- type Client
- func (c *Client) BaseURL() string
- func (c *Client) ExtensionsVersions(ctx context.Context, talosVersion string) ([]ExtensionInfo, error)
- func (c *Client) OverlaysVersions(ctx context.Context, talosVersion string) ([]OverlayInfo, error)
- func (c *Client) SchematicCreate(ctx context.Context, schematic schematic.Schematic) (string, error)
- func (c *Client) SchematicGet(ctx context.Context, schematicID string) (*schematic.Schematic, error)
- func (c *Client) Versions(ctx context.Context) ([]string, error)
- type ExtensionInfo
- type HTTPError
- type InvalidSchematicError
- type Option
- type Options
- type OverlayInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsHTTPErrorCode ¶ added in v0.2.1
IsHTTPErrorCode checks if the error is HTTP error with a specific doe.
func IsInvalidSchematicError ¶
IsInvalidSchematicError checks if the error is invalid schematic.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the Image Factory HTTP API client.
func (*Client) ExtensionsVersions ¶
func (c *Client) ExtensionsVersions(ctx context.Context, talosVersion string) ([]ExtensionInfo, error)
ExtensionsVersions gets the version of the extension for a Talos version.
func (*Client) OverlaysVersions ¶ added in v0.3.0
OverlaysVersions gets the version of the extension for a Talos version.
func (*Client) SchematicCreate ¶
func (c *Client) SchematicCreate(ctx context.Context, schematic schematic.Schematic) (string, error)
SchematicCreate generates new schematic from the configuration.
func (*Client) SchematicGet ¶ added in v0.9.0
type ExtensionInfo ¶
type ExtensionInfo struct {
Name string `json:"name"`
Ref string `json:"ref"`
Digest string `json:"digest"`
Author string `json:"author"`
Description string `json:"description"`
}
ExtensionInfo defines extensions versions list response item.
type InvalidSchematicError ¶
type InvalidSchematicError struct {
// contains filtered or unexported fields
}
InvalidSchematicError is parsed from 400 response from the server.
func (*InvalidSchematicError) Error ¶
func (e *InvalidSchematicError) Error() string
Error implements error interface.
type Option ¶
type Option func(*Options)
Option defines a single client option setter.
func WithClient ¶
WithClient overrides default client instance.