KaimingRef

KaimingRef — Application reference

Functions

Properties

char * arch Read / Write / Construct Only
char * branch Read / Write / Construct Only
char * collection-id Read / Write / Construct Only
char * commit Read / Write / Construct Only
KaimingRefKind kind Read / Write / Construct Only
char * name Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── KaimingRef
        ├── KaimingBundleRef
        ├── KaimingInstalledRef
        ├── KaimingRelatedRef
        ╰── KaimingRemoteRef

Description

Currently Kaiming manages two types of binary artifacts: applications, and runtimes. Applications contain a program that desktop users can run, while runtimes contain only libraries and data. An KaimingRef object (or short: ref) can refer to either of these.

Both applications and runtimes are identified by a 4-tuple of strings: kind, name, arch and branch, e.g. app/org.gnome.evince/x86_64/master. The functions kaiming_ref_parse() and kaiming_ref_format_ref() can be used to convert KaimingRef objects into this string representation and back.

Note that the identifiers must be unique within a repo (e.g. Flathub) based only on the name, arch, and branch 3-tuple, without regard to the kind. In other words if app/org.gnome.evince/x86_64/master exists, runtime/org.gnome.evince/x86_64/master must not exist. This requirement is not enforced by libkaiming but is enforced by GNOME Software's use of libappstream, since Appstream IDs are assumed to be unique.

KaimingRef objects are immutable and can be passed freely between threads.

To uniquely identify a particular version of an application or runtime, you need a commit.

The subclasses KaimingInstalledRef and KaimingRemoteRef provide more information for artifacts that are locally installed or available from a remote repository.

Functions

kaiming_ref_format_ref ()

char *
kaiming_ref_format_ref (KaimingRef *self);

Convert an KaimingRef object into a string representation that can be parsed by kaiming_ref_parse().

Parameters

self

a KaimingRef

 

Returns

string representation.

[transfer full]


kaiming_ref_get_arch ()

const char *
kaiming_ref_get_arch (KaimingRef *self);

Gets the arch or the ref.

Parameters

self

a KaimingRef

 

Returns

the arch.

[transfer none]


kaiming_ref_get_branch ()

const char *
kaiming_ref_get_branch (KaimingRef *self);

Gets the branch of the ref.

Parameters

self

a KaimingRef

 

Returns

the branch.

[transfer none]


kaiming_ref_get_collection_id ()

const char *
kaiming_ref_get_collection_id (KaimingRef *self);

Gets the collection ID of the ref.

Parameters

self

a KaimingRef

 

Returns

the collection ID.

[transfer none]


kaiming_ref_get_commit ()

const char *
kaiming_ref_get_commit (KaimingRef *self);

Gets the commit of the ref.

Parameters

self

a KaimingRef

 

Returns

the commit.

[transfer none]


kaiming_ref_get_kind ()

KaimingRefKind
kaiming_ref_get_kind (KaimingRef *self);

Gets the kind of artifact that this ref refers to.

Parameters

self

a KaimingRef

 

Returns

the kind of artifact


kaiming_ref_get_name ()

const char *
kaiming_ref_get_name (KaimingRef *self);

Gets the name of the ref.

Parameters

self

a KaimingRef

 

Returns

the name.

[transfer none]


kaiming_ref_parse ()

KaimingRef *
kaiming_ref_parse (const char *ref,
                   GError **error);

Tries to parse a full ref name and return a KaimingRef (without a commit set) or fail if the ref is invalid somehow.

Parameters

ref

A string ref name, such as "app/org.test.App/x86_64/master"

 

error

return location for a GError

 

Returns

an KaimingRef, or NULL.

[transfer full]

Types and Values

struct KaimingRef

struct KaimingRef;

enum KaimingRefKind

The kind of artifact that a KaimingRef refers to.

Members

KAIMING_REF_KIND_APP

An application

 

KAIMING_REF_KIND_RUNTIME

A runtime that applications can use.

 

Property Details

The “arch” property

  “arch”                     char *

The architecture of the application or runtime.

Owner: KaimingRef

Flags: Read / Write / Construct Only

Default value: NULL


The “branch” property

  “branch”                   char *

The branch of the application or runtime.

Owner: KaimingRef

Flags: Read / Write / Construct Only

Default value: NULL


The “collection-id” property

  “collection-id”            char *

The collection ID.

Owner: KaimingRef

Flags: Read / Write / Construct Only

Default value: NULL


The “commit” property

  “commit”                   char *

The commit.

Owner: KaimingRef

Flags: Read / Write / Construct Only

Default value: NULL


The “kind” property

  “kind”                     KaimingRefKind

The kind of artifact.

Owner: KaimingRef

Flags: Read / Write / Construct Only

Default value: KAIMING_REF_KIND_APP


The “name” property

  “name”                     char *

The name of the application or runtime.

Owner: KaimingRef

Flags: Read / Write / Construct Only

Default value: NULL