Documentation
¶
Overview ¶
Package component provides object storage lifecycle integration for bootstrap.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Component ¶
func Component() bootstrap.IComponent
Component wraps loadFromEnv as a bootstrap.IComponent. Close is a no-op: the S3 client holds no resources that need releasing.
Example ¶
ExampleComponent shows how Component() is used in a bootstrap registration chain. It reads the storage.* keys from env during Init() and stores the result in storage.Default(). Init fails when a required key is empty or still "TOBE_REPLACED"; it does not contact the store, so call storage.Default().Check to test connectivity.
bootstrap.New().
Add(envComp.Component("config/app.toml", &configFS)).
Add(logComp.Component()).
Add(storageComp.Component()).
Run()
package main
import (
"fmt"
storageComp "github.com/phcp-tech/common-library-golang/storage/component"
)
func main() {
c := storageComp.Component()
fmt.Println(c.Name())
}
Output: storage
Types ¶
This section is empty.