Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove redundent json files #606

Merged
merged 12 commits into from
May 26, 2022
2 changes: 1 addition & 1 deletion cmd/layotto/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ func NewRuntimeGrpcServer(data json.RawMessage, opts ...grpc.ServerOption) (mgrp

var cmdStart = cli.Command{
Name: "start",
Usage: "start runtime. For example: ./layotto start -c configs/config_in_memory.json",
Usage: "start runtime. For example: ./layotto start -c configs/config_standalone.json",
Flags: []cli.Flag{
cli.StringFlag{
Name: "config, c",
Expand Down
3 changes: 3 additions & 0 deletions cmd/layotto_multiple_api/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,7 @@ func main() {
log.Fatalf("could not greet: %v", err)
}
log.Printf("Greeting: %s", r.GetMessage())
if r.GetMessage() != "Hello world" {
panic("Response message is not `Hello world`. I don't know why!")
}
}
2 changes: 1 addition & 1 deletion cmd/layotto_multiple_api/helloworld/grpc_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
const kind = "helloworld"

// This demo will always use this component name.
const componentName = "in-memory"
const componentName = "demo"

func NewHelloWorldAPI(ac *grpc_api.ApplicationContext) grpc.GrpcAPI {
// 1. convert custom components
Expand Down
41 changes: 40 additions & 1 deletion cmd/layotto_multiple_api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ import (
"strconv"
"time"

"github.com/dapr/components-contrib/secretstores"
"github.com/dapr/components-contrib/secretstores/aws/parameterstore"
"github.com/dapr/components-contrib/secretstores/aws/secretmanager"
"github.com/dapr/components-contrib/secretstores/azure/keyvault"
gcp_secretmanager "github.com/dapr/components-contrib/secretstores/gcp/secretmanager"
"github.com/dapr/components-contrib/secretstores/hashicorp/vault"
sercetstores_kubernetes "github.com/dapr/components-contrib/secretstores/kubernetes"
secretstore_env "github.com/dapr/components-contrib/secretstores/local/env"
secretstore_file "github.com/dapr/components-contrib/secretstores/local/file"

secretstores_loader "mosn.io/layotto/pkg/runtime/secretstores"

"mosn.io/api"
_ "mosn.io/mosn/pkg/filter/stream/grpcmetric"
"mosn.io/mosn/pkg/stagemanager"
Expand Down Expand Up @@ -392,6 +404,33 @@ func NewRuntimeGrpcServer(data json.RawMessage, opts ...grpc.ServerOption) (mgrp
return sequencer_inmemory.NewInMemorySequencer()
}),
),
// secretstores
runtime.WithSecretStoresFactory(
secretstores_loader.NewFactory("kubernetes", func() secretstores.SecretStore {
return sercetstores_kubernetes.NewKubernetesSecretStore(loggerForDaprComp)
}),
secretstores_loader.NewFactory("azure.keyvault", func() secretstores.SecretStore {
return keyvault.NewAzureKeyvaultSecretStore(loggerForDaprComp)
}),
secretstores_loader.NewFactory("hashicorp.vault", func() secretstores.SecretStore {
return vault.NewHashiCorpVaultSecretStore(loggerForDaprComp)
}),
secretstores_loader.NewFactory("aws.secretmanager", func() secretstores.SecretStore {
return secretmanager.NewSecretManager(loggerForDaprComp)
}),
secretstores_loader.NewFactory("aws.parameterstore", func() secretstores.SecretStore {
return parameterstore.NewParameterStore(loggerForDaprComp)
}),
secretstores_loader.NewFactory("gcp.secretmanager", func() secretstores.SecretStore {
return gcp_secretmanager.NewSecreteManager(loggerForDaprComp)
}),
secretstores_loader.NewFactory("local.file", func() secretstores.SecretStore {
return secretstore_file.NewLocalSecretStore(loggerForDaprComp)
}),
secretstores_loader.NewFactory("local.env", func() secretstores.SecretStore {
return secretstore_env.NewEnvSecretStore(loggerForDaprComp)
}),
),
// Custom components
runtime.WithCustomComponentFactory("helloworld",
custom.NewComponentFactory("in-memory", component.NewInMemoryHelloWorld),
Expand All @@ -403,7 +442,7 @@ func NewRuntimeGrpcServer(data json.RawMessage, opts ...grpc.ServerOption) (mgrp

var cmdStart = cli.Command{
Name: "start",
Usage: "start runtime. For example: ./layotto start -c configs/config_in_memory.json",
Usage: "start runtime. For example: ./layotto start -c configs/config_standalone.json",
Flags: []cli.Flag{
cli.StringFlag{
Name: "config, c",
Expand Down
94 changes: 0 additions & 94 deletions configs/config_apollo_health.json

This file was deleted.

48 changes: 0 additions & 48 deletions configs/config_bindings.json

This file was deleted.

File renamed without changes.
Loading