diff --git a/sdk/component/examples/enricher/.env b/sdk/component/examples/enricher/.env new file mode 100644 index 000000000..159cd0e76 --- /dev/null +++ b/sdk/component/examples/enricher/.env @@ -0,0 +1,4 @@ +SMITHY_COMPONENT_NAME=sample-enricher +SMITHY_INSTANCE_ID=8d719c1c-c569-4078-87b3-4951bd4012ee +SMITHY_LOG_LEVEL=debug +SMITHY_BACKEND_STORE_TYPE=local diff --git a/sdk/component/examples/enricher/main.go b/sdk/component/examples/enricher/main.go index c2fd5a424..4b1fad31a 100644 --- a/sdk/component/examples/enricher/main.go +++ b/sdk/component/examples/enricher/main.go @@ -6,8 +6,6 @@ import ( "time" "github.com/smithy-security/smithy/sdk/component" - "github.com/smithy-security/smithy/sdk/component/internal/storer/local" - "github.com/smithy-security/smithy/sdk/component/internal/uuid" ocsf "github.com/smithy-security/smithy/sdk/gen/com/github/ocsf/ocsf_schema/v1" ) @@ -22,18 +20,7 @@ func main() { ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) defer cancel() - storageManager, err := local.NewStoreManager() - if err != nil { - log.Fatalf("failed to create storage manager: %v", err) - } - - if err := component.RunEnricher( - ctx, - sampleEnricher{}, - component.RunnerWithComponentName("sample-enricher"), - component.RunnerWithStorer("local", storageManager), - component.RunnerWithWorkflowID(uuid.New()), - ); err != nil { + if err := component.RunEnricher(ctx, sampleEnricher{}); err != nil { log.Fatalf("unexpected run error: %v", err) } } diff --git a/sdk/component/examples/filter/.env b/sdk/component/examples/filter/.env new file mode 100644 index 000000000..117569576 --- /dev/null +++ b/sdk/component/examples/filter/.env @@ -0,0 +1,4 @@ +SMITHY_COMPONENT_NAME=sample-filter +SMITHY_INSTANCE_ID=8d719c1c-c569-4078-87b3-4951bd4012ee +SMITHY_LOG_LEVEL=debug +SMITHY_BACKEND_STORE_TYPE=local diff --git a/sdk/component/examples/filter/main.go b/sdk/component/examples/filter/main.go index 7d8efb023..54d520d8f 100644 --- a/sdk/component/examples/filter/main.go +++ b/sdk/component/examples/filter/main.go @@ -6,8 +6,6 @@ import ( "time" "github.com/smithy-security/smithy/sdk/component" - "github.com/smithy-security/smithy/sdk/component/internal/storer/local" - "github.com/smithy-security/smithy/sdk/component/internal/uuid" ocsf "github.com/smithy-security/smithy/sdk/gen/com/github/ocsf/ocsf_schema/v1" ) @@ -22,18 +20,7 @@ func main() { ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) defer cancel() - storageManager, err := local.NewStoreManager() - if err != nil { - log.Fatalf("failed to create storage manager: %v", err) - } - - if err := component.RunFilter( - ctx, - sampleFilter{}, - component.RunnerWithComponentName("sample-filter"), - component.RunnerWithStorer("local", storageManager), - component.RunnerWithWorkflowID(uuid.New()), - ); err != nil { + if err := component.RunFilter(ctx, sampleFilter{}); err != nil { log.Fatalf("unexpected run error: %v", err) } } diff --git a/sdk/component/examples/reporter/.env b/sdk/component/examples/reporter/.env new file mode 100644 index 000000000..4d2370a31 --- /dev/null +++ b/sdk/component/examples/reporter/.env @@ -0,0 +1,4 @@ +SMITHY_COMPONENT_NAME=sample-reporter +SMITHY_INSTANCE_ID=8d719c1c-c569-4078-87b3-4951bd4012ee +SMITHY_LOG_LEVEL=debug +SMITHY_BACKEND_STORE_TYPE=local diff --git a/sdk/component/examples/reporter/main.go b/sdk/component/examples/reporter/main.go index c9ce49c5c..cf8d271df 100644 --- a/sdk/component/examples/reporter/main.go +++ b/sdk/component/examples/reporter/main.go @@ -6,8 +6,6 @@ import ( "time" "github.com/smithy-security/smithy/sdk/component" - "github.com/smithy-security/smithy/sdk/component/internal/storer/local" - "github.com/smithy-security/smithy/sdk/component/internal/uuid" ocsf "github.com/smithy-security/smithy/sdk/gen/com/github/ocsf/ocsf_schema/v1" ) @@ -22,18 +20,7 @@ func main() { ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) defer cancel() - storageManager, err := local.NewStoreManager() - if err != nil { - log.Fatalf("failed to create storage manager: %v", err) - } - - if err := component.RunReporter( - ctx, - sampleReporter{}, - component.RunnerWithComponentName("sample-reporter"), - component.RunnerWithStorer("local", storageManager), - component.RunnerWithWorkflowID(uuid.New()), - ); err != nil { + if err := component.RunReporter(ctx, sampleReporter{}); err != nil { log.Fatalf("unexpected run error: %v", err) } } diff --git a/sdk/component/examples/scanner/.env b/sdk/component/examples/scanner/.env new file mode 100644 index 000000000..6622f5936 --- /dev/null +++ b/sdk/component/examples/scanner/.env @@ -0,0 +1,4 @@ +SMITHY_COMPONENT_NAME=sample-scanner +SMITHY_INSTANCE_ID=8d719c1c-c569-4078-87b3-4951bd4012ee +SMITHY_LOG_LEVEL=debug +SMITHY_BACKEND_STORE_TYPE=local diff --git a/sdk/component/examples/scanner/main.go b/sdk/component/examples/scanner/main.go index 432e97055..408fc20f4 100644 --- a/sdk/component/examples/scanner/main.go +++ b/sdk/component/examples/scanner/main.go @@ -6,8 +6,6 @@ import ( "time" "github.com/smithy-security/smithy/sdk/component" - "github.com/smithy-security/smithy/sdk/component/internal/storer/local" - "github.com/smithy-security/smithy/sdk/component/internal/uuid" ocsf "github.com/smithy-security/smithy/sdk/gen/com/github/ocsf/ocsf_schema/v1" ) @@ -22,18 +20,7 @@ func main() { ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) defer cancel() - storageManager, err := local.NewStoreManager() - if err != nil { - log.Fatalf("failed to create storage manager: %v", err) - } - - if err := component.RunScanner( - ctx, - sampleScanner{}, - component.RunnerWithComponentName("sample-scanner"), - component.RunnerWithStorer("local", storageManager), - component.RunnerWithWorkflowID(uuid.New()), - ); err != nil { + if err := component.RunScanner(ctx, sampleScanner{}); err != nil { log.Fatalf("unexpected run error: %v", err) } } diff --git a/sdk/component/examples/target/.env b/sdk/component/examples/target/.env new file mode 100644 index 000000000..f552ba404 --- /dev/null +++ b/sdk/component/examples/target/.env @@ -0,0 +1,4 @@ +SMITHY_COMPONENT_NAME=sample-target +SMITHY_INSTANCE_ID=8d719c1c-c569-4078-87b3-4951bd4012ee +SMITHY_LOG_LEVEL=debug +SMITHY_BACKEND_STORE_TYPE=local diff --git a/sdk/component/examples/target/main.go b/sdk/component/examples/target/main.go index b0fcdd414..2cfed4a27 100644 --- a/sdk/component/examples/target/main.go +++ b/sdk/component/examples/target/main.go @@ -6,7 +6,6 @@ import ( "time" "github.com/smithy-security/smithy/sdk/component" - "github.com/smithy-security/smithy/sdk/component/internal/uuid" ) type sampleTarget struct{} @@ -20,12 +19,7 @@ func main() { ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) defer cancel() - if err := component.RunTarget( - ctx, - sampleTarget{}, - component.RunnerWithComponentName("sample-target"), - component.RunnerWithWorkflowID(uuid.New()), - ); err != nil { + if err := component.RunTarget(ctx, sampleTarget{}); err != nil { log.Fatalf("unexpected run error: %v", err) } }