Documentation ¶
Overview ¶
Package configfetcher provides a simple abstraction to fetch config values from a file or GCP Secrets Manager to populate a struct.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Data struct { ConfigData []byte GcloudVars ConfigStruct interface{} }
Data contains everything needed to interact with this abstraction
func (*Data) GetConfigStruct ¶ added in v0.2.0
GetConfigStruct populates the Data.ConfigStruct interface with the data from Data.ConfigData It expects either `ReadGCPSMSecret()` or `ReadFile()` has been ran to populate Data.ConfigData
func (*Data) ReadFile ¶ added in v0.2.0
ReadFile returns the Data struct after attempting to read the data from a file
func (*Data) ReadGCPSMSecret ¶ added in v0.2.0
ReadGCPSMSecret returns the Data struct and error after attempting to fetch the environment variables:
`PROJECT_ID` required `SECRET_NAME` required `SECRET_VERSION` optional
type GcloudVars ¶ added in v0.2.0
GcloudVars contains the data needed to connect to GCP Secret Manager