Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutoStart ¶ added in v0.3.20
type AutoStart interface {
AutoStart()
}
AutoStart identify a peripheral object can be started automatically. see AddPeripheral.
type Basic ¶
type Basic struct {
// contains filtered or unexported fields
}
Basic is a base type to simplify your codes since you're using Peripheral type.
func (*Basic) AddPeripheral ¶
func (s *Basic) AddPeripheral(peripherals ...Peripheral)
AddPeripheral adds a Peripheral object into Basic holder/host.
A peripheral represents an external resource such as redis manager which manages the links to remote redis server, etc.. A peripheral can be auto-started implicit by AddPeripheral while it implements AutoStart interface.
type Infrastructure ¶ added in v1.3.22
type Infrastructure interface { Peripheral // Open does initializing stuffs Open(ctx ctx.Context) (err error) }
type Peripheral ¶
type Peripheral interface {
// Close provides a closer to cleanup the peripheral gracefully
Close()
}
Peripheral represents a basic infrastructure which can be initialized and destroyed.
For a Peripheral, the host should add it into a list and destroy them while host is shutting down.