Jiri Simsa | 574ec4b | 2015-08-11 09:31:37 -0700 | [diff] [blame] | 1 | // Copyright 2015 The Vanadium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | // Package pubsub defines interfaces for accessing dynamically changing |
| 6 | // process configuration information. |
| 7 | // |
| 8 | // Settings represent configuration parameters and their value. Settings |
| 9 | // are published to named Streams. Streams are forked to add additional |
| 10 | // consumers, i.e. readers of the Settings published to the Stream. |
| 11 | // |
| 12 | // Settings are represented by an interface type that wraps the data and |
| 13 | // provides a name and description for each Settings. Streams are similarly |
| 14 | // named and also have a description. When streams are 'forked' the latest |
| 15 | // value of all Settings that have been sent over the Stream are made |
| 16 | // available to the caller. This allows for a rendezvous between the single |
| 17 | // producer of Settings and multiple consumers of those Settings that |
| 18 | // may be added at arbitrary points in time. |
| 19 | // |
| 20 | // Streams are hosted by a Publisher type, which in addition to the methods |
| 21 | // required for managing Streams provides a means to shut down all of the |
| 22 | // Streams it hosts. |
| 23 | package pubsub |
| 24 | |
| 25 | // Setting must be implemented by all data types to sent over Publisher |
| 26 | // streams. |
| 27 | type Setting interface { |
| 28 | String() string |
| 29 | // Name returns the name of the Setting |
| 30 | Name() string |
| 31 | // Description returns the description of the Setting |
| 32 | Description() string |
| 33 | // Value returns the value of the Setting. |
| 34 | Value() interface{} |
| 35 | } |