|
1 | | -// Package com is the user-facing interface to the object registry. Since |
| 1 | +// Package com is a user-facing interface to the object registry. Since |
2 | 2 | // the only part of the API you need to use is Register, the rest of the API |
3 | | -// for interacting with an object registry is in its own package. This is used |
4 | | -// by other tooling building around com, for example the config subpackage. |
| 3 | +// for interacting with an object registry is in its own subpackage. This is used |
| 4 | +// by other tooling built around com, for example the config subpackage. |
5 | 5 | // |
6 | 6 | // When you register an object, it will populate fields based on the com struct |
7 | 7 | // tags used on them. The object will then also be used to populate fields |
|
14 | 14 | // } |
15 | 15 | // |
16 | 16 | // In the above example component, it has fields with all three possible struct |
17 | | -// tags. Singleton will pick the first object in the registry that implements |
18 | | -// that interface. You can also use pointers to concrete types, for example to |
19 | | -// other components. Extpoint is going to be a slice of all objects in the |
20 | | -// registry that implement that interface. Config is not populated, but is allowed |
21 | | -// to be populated via the registry API. If you're using the config package, it |
22 | | -// will do this for you and populate it based on configuration. In this case, |
23 | | -// the key would be "DB" and the value could be the name of any registered |
24 | | -// component that implements api.Store. |
| 17 | +// tags: |
| 18 | +// |
| 19 | +// Singleton will pick the first object in the registry that implements that |
| 20 | +// interface. You can also use pointers to concrete types, for example to other |
| 21 | +// component types. |
| 22 | +// |
| 23 | +// Extpoint is going to be a slice of all objects in the registry that implement |
| 24 | +// that interface. |
| 25 | +// |
| 26 | +// Config is not populated, but is allowed to be populated via the registry API. |
| 27 | +// If you're using the config package, it will do this for you and populate it |
| 28 | +// based on configuration. In this case, the key would be "DB" and the value |
| 29 | +// could be the name of any registered component that implements api.Store. |
25 | 30 | package com |
26 | 31 |
|
27 | 32 | import "github.com/gliderlabs/com/objects" |
|
0 commit comments