INNER CODE UNIT · Go
init
brexhq/substation · cmd/gcp/function/substation/main.go:21
func init() {
handler, ok := os.LookupEnv("SUBSTATION_FUNCTION_HANDLER")
if !ok {
panic(fmt.Errorf("init handler %s: %v", handler, errFunctionMissingHandler))
}
switch handler {
case "GCP_STORAGE":
if err := funcframework.RegisterCloudEventFunctionContext(context.Background(), "/", cloudStorageHandler); err != nil {
panic(fmt.Errorf("init handler %s: %v", handler, err))
}
default:
panic(fmt.Errorf("init handler %s: %v", handler, errFunctionMissingHandler))
}
}
type customConfig struct {
substation.Config