diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2020-03-10 18:18:58 +0100 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2020-03-10 18:34:55 +0100 |
commit | 450361fc640751c2a33210a02ceff0874c9f449b (patch) | |
tree | eb0f958a0c46f769e344faf8732e5327b9458ca0 /vendor/github.com/godbus/dbus/v5/match.go | |
parent | 3d48940927b1133e2bfd1c3accba84345cc56ee6 (diff) | |
download | podman-450361fc640751c2a33210a02ceff0874c9f449b.tar.gz podman-450361fc640751c2a33210a02ceff0874c9f449b.tar.bz2 podman-450361fc640751c2a33210a02ceff0874c9f449b.zip |
update systemd & dbus dependencies
Update the outdated systemd and dbus dependencies which are now provided
as go modules. This will further tighten our dependencies and releases
and pave the way for the upcoming auto-update feature.
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'vendor/github.com/godbus/dbus/v5/match.go')
-rw-r--r-- | vendor/github.com/godbus/dbus/v5/match.go | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/vendor/github.com/godbus/dbus/v5/match.go b/vendor/github.com/godbus/dbus/v5/match.go new file mode 100644 index 000000000..086ee336a --- /dev/null +++ b/vendor/github.com/godbus/dbus/v5/match.go @@ -0,0 +1,62 @@ +package dbus + +import ( + "strings" +) + +// MatchOption specifies option for dbus routing match rule. Options can be constructed with WithMatch* helpers. +// For full list of available options consult +// https://dbus.freedesktop.org/doc/dbus-specification.html#message-bus-routing-match-rules +type MatchOption struct { + key string + value string +} + +func formatMatchOptions(options []MatchOption) string { + items := make([]string, 0, len(options)) + for _, option := range options { + items = append(items, option.key+"='"+option.value+"'") + } + return strings.Join(items, ",") +} + +// WithMatchOption creates match option with given key and value +func WithMatchOption(key, value string) MatchOption { + return MatchOption{key, value} +} + +// doesn't make sense to export this option because clients can only +// subscribe to messages with signal type. +func withMatchType(typ string) MatchOption { + return WithMatchOption("type", typ) +} + +// WithMatchSender sets sender match option. +func WithMatchSender(sender string) MatchOption { + return WithMatchOption("sender", sender) +} + +// WithMatchSender sets interface match option. +func WithMatchInterface(iface string) MatchOption { + return WithMatchOption("interface", iface) +} + +// WithMatchMember sets member match option. +func WithMatchMember(member string) MatchOption { + return WithMatchOption("member", member) +} + +// WithMatchObjectPath creates match option that filters events based on given path +func WithMatchObjectPath(path ObjectPath) MatchOption { + return WithMatchOption("path", string(path)) +} + +// WithMatchPathNamespace sets path_namespace match option. +func WithMatchPathNamespace(namespace ObjectPath) MatchOption { + return WithMatchOption("path_namespace", string(namespace)) +} + +// WithMatchDestination sets destination match option. +func WithMatchDestination(destination string) MatchOption { + return WithMatchOption("destination", destination) +} |