Documentation ¶
Overview ¶
The simplerelation package implements a generic simple relation where the provider units each make a set of attributes available, and the requirer units can see those attributes.
It allows only one provider service.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider represents the provider side of a simple relation.
type Requirer ¶
type Requirer struct {
// contains filtered or unexported fields
}
Requirer represents the requirer side of a simple relation. It allows only one provider service. it makes all attributes set by units on the provider side of the relation available through the Values method.
func (*Requirer) Register ¶
Register registers a requirer relation with the given relation name and interface with the given hook registry.
To find out when the provider values change, register a wildcard ("*") hook, which will trigger when any value changes.
func (*Requirer) Strings ¶
Strings is a convenience method that converts the values returned by Values into a slice of strings by calling the given convert function for each unit.
Errors found when doing the conversion are logged but otherwise ignored. If the convert function returns an empty string with no error, that string will be omitted too.
The result is stable across calls.