MustNew calls New and returns a new component or panics on an error. In most cases, you should just use New.
(logger log.Stack, config *Config, opts ...Option)
| 246 | // MustNew calls New and returns a new component or panics on an error. |
| 247 | // In most cases, you should just use New. |
| 248 | func MustNew(logger log.Stack, config *Config, opts ...Option) *Component { |
| 249 | c, err := New(logger, config, opts...) |
| 250 | if err != nil { |
| 251 | panic(err) |
| 252 | } |
| 253 | return c |
| 254 | } |
| 255 | |
| 256 | // Logger returns the logger of the component. |
| 257 | func (c *Component) Logger() log.Stack { |