target

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2026 License: BSD-3-Clause-Clear Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TargetsResourcePath = "/repo/targets.json"
)

Variables

View Source
var (
	UnknownTarget = Target{
		ID:      "unknown",
		Version: -1,
	}
)

Functions

This section is empty.

Types

type App

type App struct {
	Name string `json:"name"`
	URI  string `json:"uri"`
}

type Apps added in v1.0.0

type Apps []App

func (Apps) Names added in v1.0.0

func (a Apps) Names() (res []string)

func (Apps) URIs added in v1.1.0

func (a Apps) URIs() (res []string)

type Custom

type Custom struct {
	Version string `json:"version"`
	Apps    map[string]struct {
		URI string `json:"uri"`
	} `json:"docker_compose_apps"`
	Arch       string   `json:"arch"`
	HardwareID []string `json:"hardwareIds"`
}

type File

type File struct {
	Signatures *json.RawMessage `json:"signatures"`
	Signed     Signed           `json:"signed"`
}

type Metadata

type Metadata struct {
	Custom Custom `json:"custom"`
}

type Repo

type Repo interface {
	LoadTargets(update bool) (Targets, error)
}

func NewPlainRepo

func NewPlainRepo(dgClient *client.GatewayClient, targetsFilepath string, hardwareID string) (Repo, error)

func NewTufRepo

func NewTufRepo(cfg *config.Config, dgClient *client.GatewayClient, hardwareID string) (Repo, error)

type Signed

type Signed struct {
	Targets map[string]Metadata `json:"targets"`
}

type Target

type Target struct {
	ID      string `json:"id"`
	Version int    `json:"version"`
	Apps    []App  `json:"apps"`
}

func (*Target) AppNames

func (t *Target) AppNames() (res []string)

func (*Target) AppURIs

func (t *Target) AppURIs() (res []string)

func (*Target) Diff added in v1.0.0

func (t *Target) Diff(other *Target) (added, removed, same, from, to Apps)

func (*Target) Equals added in v1.0.0

func (t *Target) Equals(other *Target) bool

func (*Target) IsUnknown added in v0.9.0

func (t *Target) IsUnknown() bool

func (*Target) NoApps

func (t *Target) NoApps() bool

func (*Target) ShortlistApps

func (t *Target) ShortlistApps(shortlist []string)

func (*Target) ShortlistAppsByURI

func (t *Target) ShortlistAppsByURI(shortlist []string)

type Targets

type Targets []Target

func (Targets) GetLatestTarget

func (t Targets) GetLatestTarget() Target

func (Targets) GetSortedList

func (t Targets) GetSortedList() Targets

func (Targets) GetTargetByID

func (t Targets) GetTargetByID(ID string) Target

func (Targets) GetTargetByVersion

func (t Targets) GetTargetByVersion(version int) Target

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL