Documentation
¶
Index ¶
- func CtxWithApi(ctx context.Context, api *Api) context.Context
- func ParseLastLink(linkHeader string) (string, bool)
- func ParseNextLink(linkHeader string) (string, bool)
- type Api
- func (a *Api) Configs() ConfigsApi
- func (a Api) Delete(resource string, opts ...HttpOption) error
- func (a *Api) Devices() DeviceApi
- func (a Api) Get(resource string, result any, opts ...HttpOption) error
- func (a Api) GetStream(resource string, opts ...HttpOption) (io.ReadCloser, error)
- func (a Api) GetWithHeaders(resource string, result any, opts ...HttpOption) (http.Header, error)
- func (a Api) Post(resource string, body any, opts ...HttpOption) ([]byte, error)
- func (a Api) Put(resource string, body any, opts ...HttpOption) ([]byte, error)
- func (a *Api) Updates() UpdatesApi
- type AppliedConfigs
- type ConfigFile
- type ConfigFileSet
- type ConfigsApi
- type CreateUpdateOptions
- type Device
- type DeviceApi
- func (d DeviceApi) Delete(uuid string) error
- func (d DeviceApi) DeleteDenied(uuid string) error
- func (d DeviceApi) Get(uuid string) (*Device, error)
- func (d DeviceApi) ListDenied() ([]string, error)
- func (d DeviceApi) ListPage(page int, limit int, sortBy string) ([]DeviceListItem, bool, int, error)
- func (d *DeviceApi) Test(uuid, testId string) (*TargetTest, error)
- func (d *DeviceApi) TestArtifact(uuid, testId, artifact string) (io.ReadCloser, error)
- func (d *DeviceApi) Tests(uuid string) ([]TargetTest, error)
- func (d DeviceApi) UpdateEvents(uuid, updateId string) ([]DeviceUpdateEvent, error)
- func (d DeviceApi) Updates(uuid string) ([]string, error)
- type DeviceConfigsApi
- func (a DeviceConfigsApi) Get() (res ConfigFileSet, err error)
- func (a DeviceConfigsApi) GetApplied() (res AppliedConfigs, err error)
- func (a DeviceConfigsApi) GetHistory(limit int, showFiles bool) (res []ConfigFileSet, err error)
- func (a DeviceConfigsApi) GetPubkey() (res string, err error)
- func (a DeviceConfigsApi) Put(configs ConfigFileSet) (err error)
- type DeviceListItem
- type DeviceUpdateEvent
- type HttpOption
- type Rollout
- type SpecificConfigsApi
- type TargetTest
- type Update
- type UpdateSummary
- type UpdateTuf
- type UpdatesApi
- func (u UpdatesApi) CreateRollout(tag, updateName, rollout string, data Rollout) error
- func (u UpdatesApi) CreateUpdate(tag, updateName string, opts CreateUpdateOptions, body io.Reader) error
- func (u UpdatesApi) Delete(tag, updateName string) error
- func (u UpdatesApi) Get(tag, updateName string) ([]string, error)
- func (u UpdatesApi) GetDevicesForRolloutStatus(tag, updateName, rollout, status string) ([]string, error)
- func (u UpdatesApi) GetDevicesForStatus(tag, updateName, status string) ([]string, error)
- func (u UpdatesApi) GetRollout(tag, updateName, rollout string) (Rollout, error)
- func (u UpdatesApi) GetRolloutSummary(tag, updateName, rollout string) (UpdateSummary, error)
- func (u UpdatesApi) GetSummary(tag, updateName string) (UpdateSummary, error)
- func (u UpdatesApi) GetTuf(tag, updateName string) (UpdateTuf, error)
- func (u UpdatesApi) List() (map[string][]Update, error)
- func (u UpdatesApi) Tail(tag, updateName string) (io.ReadCloser, error)
- func (u UpdatesApi) TailRollout(tag, updateName, rollout string) (io.ReadCloser, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseLastLink ¶
func ParseNextLink ¶
Types ¶
type Api ¶
func (*Api) Configs ¶
func (a *Api) Configs() ConfigsApi
func (Api) GetStream ¶
func (a Api) GetStream(resource string, opts ...HttpOption) (io.ReadCloser, error)
func (Api) GetWithHeaders ¶
func (*Api) Updates ¶
func (a *Api) Updates() UpdatesApi
type AppliedConfigs ¶
type AppliedConfigs = storage.AppliedConfigs
type ConfigFile ¶
type ConfigFile = models.ConfigFile
type ConfigFileSet ¶
type ConfigFileSet = models.ConfigFileSet
type ConfigsApi ¶
type ConfigsApi struct {
// contains filtered or unexported fields
}
func (ConfigsApi) Device ¶
func (a ConfigsApi) Device(uuid string) DeviceConfigsApi
func (ConfigsApi) Factory ¶
func (a ConfigsApi) Factory() SpecificConfigsApi
func (ConfigsApi) Group ¶
func (a ConfigsApi) Group(name string) SpecificConfigsApi
func (ConfigsApi) ListGroups ¶
func (a ConfigsApi) ListGroups() (names []string, err error)
func (ConfigsApi) Upload ¶
func (a ConfigsApi) Upload(r io.Reader, opts ...HttpOption) (err error)
type CreateUpdateOptions ¶
type CreateUpdateOptions struct {
Version int // Override the target version (AppVersion)
HardwareId string // Override the hardware id
Name string // Override the target name
OstreeHash string // Override the ostree hash
Apps map[string]string // Override docker compose apps (name -> sha256)
}
CreateUpdateOptions captures the optional TUF target overrides that can be supplied when creating an update.
type DeviceApi ¶
type DeviceApi struct {
// contains filtered or unexported fields
}
func (DeviceApi) DeleteDenied ¶
DeleteDenied removes a device from the denied list so it can access the backend again.
func (DeviceApi) ListDenied ¶
ListDenied returns all UUIDs on the denied list.
func (DeviceApi) ListPage ¶
func (d DeviceApi) ListPage(page int, limit int, sortBy string) ([]DeviceListItem, bool, int, error)
ListPage fetches a single page of devices. It returns the devices, whether more pages are available, and the total number of pages.
func (*DeviceApi) TestArtifact ¶
func (d *DeviceApi) TestArtifact(uuid, testId, artifact string) (io.ReadCloser, error)
func (DeviceApi) UpdateEvents ¶
func (d DeviceApi) UpdateEvents(uuid, updateId string) ([]DeviceUpdateEvent, error)
type DeviceConfigsApi ¶
type DeviceConfigsApi struct {
// contains filtered or unexported fields
}
func (DeviceConfigsApi) Get ¶ added in v0.9.4
func (a DeviceConfigsApi) Get() (res ConfigFileSet, err error)
func (DeviceConfigsApi) GetApplied ¶
func (a DeviceConfigsApi) GetApplied() (res AppliedConfigs, err error)
func (DeviceConfigsApi) GetHistory ¶ added in v0.9.4
func (a DeviceConfigsApi) GetHistory(limit int, showFiles bool) (res []ConfigFileSet, err error)
func (DeviceConfigsApi) GetPubkey ¶ added in v0.9.4
func (a DeviceConfigsApi) GetPubkey() (res string, err error)
func (DeviceConfigsApi) Put ¶ added in v0.9.4
func (a DeviceConfigsApi) Put(configs ConfigFileSet) (err error)
type DeviceListItem ¶
type DeviceListItem = models.DeviceListItem
type DeviceUpdateEvent ¶
type DeviceUpdateEvent = models.DeviceUpdateEvent
type HttpOption ¶
type HttpOption func(opts *httpOptions)
func HttpHeader ¶
func HttpHeader(name, value string) HttpOption
type SpecificConfigsApi ¶
type SpecificConfigsApi interface {
Get() (res ConfigFileSet, err error)
GetHistory(limit int, showFiles bool) (res []ConfigFileSet, err error)
Put(configs ConfigFileSet) (err error)
}
type TargetTest ¶
type TargetTest = storage.TargetTest
type UpdateSummary ¶ added in v0.9.4
type UpdateSummary = models.UpdateSummary
type UpdateTuf ¶ added in v0.9.3
UpdateTuf holds the TUF metadata for an update keyed by role file name (e.g. "root.json", "targets.json"). Each value is the parsed JSON of the corresponding metadata file.
type UpdatesApi ¶
type UpdatesApi struct {
// contains filtered or unexported fields
}
func (UpdatesApi) CreateRollout ¶
func (u UpdatesApi) CreateRollout(tag, updateName, rollout string, data Rollout) error
func (UpdatesApi) CreateUpdate ¶
func (u UpdatesApi) CreateUpdate(tag, updateName string, opts CreateUpdateOptions, body io.Reader) error
func (UpdatesApi) Delete ¶ added in v0.9.3
func (u UpdatesApi) Delete(tag, updateName string) error
func (UpdatesApi) GetDevicesForRolloutStatus ¶ added in v0.9.4
func (u UpdatesApi) GetDevicesForRolloutStatus(tag, updateName, rollout, status string) ([]string, error)
func (UpdatesApi) GetDevicesForStatus ¶ added in v0.9.4
func (u UpdatesApi) GetDevicesForStatus(tag, updateName, status string) ([]string, error)
func (UpdatesApi) GetRollout ¶
func (u UpdatesApi) GetRollout(tag, updateName, rollout string) (Rollout, error)
func (UpdatesApi) GetRolloutSummary ¶ added in v0.9.4
func (u UpdatesApi) GetRolloutSummary(tag, updateName, rollout string) (UpdateSummary, error)
func (UpdatesApi) GetSummary ¶ added in v0.9.4
func (u UpdatesApi) GetSummary(tag, updateName string) (UpdateSummary, error)
func (UpdatesApi) GetTuf ¶ added in v0.9.3
func (u UpdatesApi) GetTuf(tag, updateName string) (UpdateTuf, error)
func (UpdatesApi) Tail ¶
func (u UpdatesApi) Tail(tag, updateName string) (io.ReadCloser, error)
func (UpdatesApi) TailRollout ¶
func (u UpdatesApi) TailRollout(tag, updateName, rollout string) (io.ReadCloser, error)
Click to show internal directories.
Click to hide internal directories.