23 Commits

Author SHA1 Message Date
Maciej Borzecki
081926e057 interfaces: helpers for sorting plug/slot/connection refs
Add helpers for sorting slot/plug/connection refs.

Allows external packages to sort their collections without the necessity to
implement the actual ordering logic. Instead, it should be possible to directly
plug provided helpers into sort.Interface.Less().

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2019-01-17 11:00:50 +01:00
Zygmunt Krynicki
717c0a8017 interfaces: remove unused bySlotInfo sorting helper
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
2019-01-07 10:51:43 +01:00
Zygmunt Krynicki
4d9656eca6 interfaces: remove unused byPlugInfo sorting helper
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
2019-01-07 10:51:43 +01:00
Zygmunt Krynicki
c3f932b8a6 interfaces: remove unused byBackendName sorting helper
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
2019-01-07 10:51:43 +01:00
Zygmunt Krynicki
2e5f8c8414 interfaces: remove unused byPlugRef sorting helper
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
2019-01-07 10:51:43 +01:00
Zygmunt Krynicki
d350f254d0 interfaces: remove unused bySlotRef sorting helper
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
2019-01-07 10:51:43 +01:00
Maciej Borzecki
402b6371f9 interfaces: tweak sorting
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2018-08-13 14:25:30 +02:00
Maciej Borzecki
4a120b9fc8 interfaces: parallel instances support, extend unit tests
Allow adding slots/plugs from snaps with instance keys. Extend unit tests to
cover parallel instances of snaps.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2018-08-09 10:11:11 +02:00
Maciej Borzecki
ff216577f3 many: rename snap.Info.Name() to snap.Info.InstanceName(), leave parallel-install TODOs
In preparation for parallel installation of snaps, introduce the necessary
rename of snap.Info.Name() to snap.Info.InstanceName(). The change is benign and
will make subsequent parallel installs reviews easier and smaller.

Leave TODO notes about possible issues with parallel installation where
possible.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2018-06-13 12:23:44 +02:00
Pawel Stolowski
e7bab23f4c ConnRef sorting fix, plus test. 2017-10-30 12:59:43 +01:00
Pawel Stolowski
538b3dd1d5 Build JSON for plugs, slot, connections on the API side. 2017-10-06 18:46:42 +02:00
Pawel Stolowski
935c738b59 Use PlugInfo and SlotInfo in the repo (WIP). 2017-10-05 17:11:27 +02:00
Zygmunt Krynicki
c442e2d281 interfaces: improve sort code
This patch improves sort code (some silly copy-pasted, harmless but
needleess code is now removed) and adds full test coverage. Tests are
also in a _test package and are no longer polutting the main namespace.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
2017-06-06 10:57:16 +02:00
Zygmunt Krynicki
ccca959efc interfaces: add sort helpers for []snap.{Plug,Slot}Info
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
2017-06-05 15:14:35 +02:00
Zygmunt Krynicki
59dead6714 interfaces: add byInterfaceName helper for sorting []Interface
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
2017-06-05 15:14:35 +02:00
Zygmunt Krynicki
6ea380583c interfaces: add Repository.InterfaceInfos
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
2017-05-24 20:46:38 +02:00
Zygmunt Krynicki
aa3392f31c interfaces: add sort routines for []SecurityBackend
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
2017-01-20 01:29:54 +01:00
Samuele Pedroni
a6feab1164 refix: ZSummary to Summary, ZName to Name, ZDescription to Description 2016-04-06 22:33:45 +02:00
Samuele Pedroni
affd38b93b wip: use SideInfo embedded in Info instead of side Manifest struct 2016-04-06 22:20:35 +02:00
Zygmunt Krynicki
8fe4e4e765 interfaces: use snap.{Plug,Slot}Info natively
This patch changes interfaces.Plug and interfaces.Slot to be built upon
snap.PlugInfo and snap.PlugInfo. This cuts a lot of the duplicated data
and also gives us access to data that was previously provided via
side-channels, such as snap version and developer name.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
2016-03-22 03:16:24 +01:00
Zygmunt Krynicki
4cdbacb69b interfaces,daemon: use {Plug,Slot}.Name
This patch renames the last aspect of the slot/interface and plug.plug
vs plug.name rename. It attains parity with the client/ package. Both
plugs and slots have a .Name fields but that field is translated to
"plug" and "slot" in the type-less JSON representation.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
2016-03-01 12:49:47 +01:00
Zygmunt Krynicki
85408ba50d interfaces: move rest of the sorting code to sorting.go
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
2016-02-29 15:44:10 +01:00
Zygmunt Krynicki
5641effa59 interfaces: add implementation of sorting for PlugRef and SlotRef
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
2016-02-29 15:44:10 +01:00