Skip to content
This repository has been archived by the owner on Jan 4, 2024. It is now read-only.

Commit

Permalink
💡
Browse files Browse the repository at this point in the history
  • Loading branch information
nlepage committed Apr 17, 2020
1 parent d2e720f commit d9979f2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions checkpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ type (

var _ Checkpoint = (*checkpoint)(nil)

// NewCheckpoint returns the Checkpoint from conn corresponding to path.
func NewCheckpoint(conn *dbus.Conn, path dbus.ObjectPath) Checkpoint {
return &checkpoint{dbusext.NewBusObject(conn, BusName, path)}
}

// NewCheckpoints returns the slice of Checkpoint from conn corresponding to paths.
func NewCheckpoints(conn *dbus.Conn, paths []dbus.ObjectPath) []Checkpoint {
checkpoints := make([]Checkpoint, len(paths))
for i, path := range paths {
Expand Down
2 changes: 2 additions & 0 deletions connection_active.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type (

var _ ConnectionActive = (*connectionActive)(nil)

// NewConnectionActive returns the ConnectionActive from conn corresponding to path.
func NewConnectionActive(conn *dbus.Conn, path dbus.ObjectPath) (ConnectionActive, error) {
ca := connectionActive{dbusext.NewBusObject(conn, BusName, path)}

Expand All @@ -46,6 +47,7 @@ func NewConnectionActive(conn *dbus.Conn, path dbus.ObjectPath) (ConnectionActiv
return &ca, nil
}

// NewConnectionActive returns the slice of ConnectionActive from conn corresponding to paths.
func NewConnectionActives(conn *dbus.Conn, paths []dbus.ObjectPath) ([]ConnectionActive, error) {
connectionActives := make([]ConnectionActive, len(paths))
var err error
Expand Down
2 changes: 2 additions & 0 deletions device.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,14 @@ type (

var _ Device = (*device)(nil)

// NewDevice returns the Device from conn corresponding to path.
func NewDevice(conn *dbus.Conn, path dbus.ObjectPath) Device {
// FIXME compose using device type

return &device{dbusext.NewBusObject(conn, BusName, path)}
}

// NewDevices returns the slice of Device from conn corresponding paths.
func NewDevices(conn *dbus.Conn, paths []dbus.ObjectPath) []Device {
devices := make([]Device, len(paths))
for i, path := range paths {
Expand Down
2 changes: 2 additions & 0 deletions network_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package netmgr

import (
"github.com/godbus/dbus/v5"

"github.com/nlepage/go-netmgr/internal/dbusext"
)

Expand Down Expand Up @@ -31,6 +32,7 @@ type (
DeactivateConnection(activeConnection interface{}) error

// Properties

Devices() ([]Device, error)
AllDevices() ([]Device, error)
Checkpoints() ([]Checkpoint, error)
Expand Down

0 comments on commit d9979f2

Please sign in to comment.