Skip to content

Commit

Permalink
Merge branch 'fix_make_all_goimports' of github.com:rayowang/layotto …
Browse files Browse the repository at this point in the history
…into fix_make_all_goimports
  • Loading branch information
rayowang committed May 19, 2022
2 parents a826ad7 + ab0f99b commit 47d1f86
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 5 deletions.
6 changes: 6 additions & 0 deletions demo/configuration/common/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
You can run this demo with different component names.
For example:
```go
go build -o client
./client -s "config_demo"
```
6 changes: 6 additions & 0 deletions demo/secret/common/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
You can run this demo with different component names.
For example:
```go
go build -o client
./client -s "secret_demo"
```
1 change: 1 addition & 0 deletions demo/secret/common/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"flag"
"fmt"

"mosn.io/layotto/sdk/go-sdk/client"

runtimev1pb "mosn.io/layotto/spec/proto/runtime/v1"
Expand Down
6 changes: 6 additions & 0 deletions demo/state/common/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
You can run this demo with different component names.
For example:
```go
go build -o client
./client -s "state_demo"
```
4 changes: 2 additions & 2 deletions docs/en/component_specs/secret/common.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This component can access secrets from local files, environment variables, k8s,

The json configuration file has the following structure:
```json
"secretStores": {
"secret_store": {
"<STORE NAME>": {
"metadata": {
"<KEY>": "<VALUE>",
Expand All @@ -15,7 +15,7 @@ The json configuration file has the following structure:
```
Configuration examples of local file keys, local environment variables, and k8s keys:
```
"secretStores": {
"secret_store": {
"local.file": {
"metadata": {
"secretsFile": "../../configs/config_secret_local_file.json"
Expand Down
4 changes: 2 additions & 2 deletions docs/zh/component_specs/secret/common.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

json配置文件有如下结构:
```json
"secretStores": {
"secret_store": {
"<STORE NAME>": {
"metadata": {
"<KEY>": "<VALUE>",
Expand All @@ -16,7 +16,7 @@ json配置文件有如下结构:
```
本地文件秘钥、本地环境变量、k8s秘钥的配置例子:
```
"secretStores": {
"secret_store": {
"local.file": {
"metadata": {
"secretsFile": "../../configs/config_secret_local_file.json"
Expand Down
4 changes: 3 additions & 1 deletion pkg/runtime/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ package runtime
import (
"encoding/json"

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

"mosn.io/layotto/components/custom"

"mosn.io/layotto/pkg/runtime/bindings"
Expand Down Expand Up @@ -50,7 +52,7 @@ type MosnRuntimeConfig struct {
LockManagement map[string]lock.Config `json:"lock"`
SequencerManagement map[string]sequencer.Config `json:"sequencer"`
Bindings map[string]bindings.Metadata `json:"bindings"`
SecretStoresManagement map[string]bindings.Metadata `json:"secret_store"`
SecretStoresManagement map[string]secretstores.Metadata `json:"secret_store"`
// <component type,component name,config>
// e.g. <"super_pubsub","etcd",config>
CustomComponent map[string]map[string]custom.Config `json:"custom_component,omitempty"`
Expand Down
22 changes: 22 additions & 0 deletions pkg/runtime/secretstores/metadata.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright 2021 Layotto Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package secretstores

type Metadata struct {
Version string
Metadata map[string]string `json:"metadata"`
}

0 comments on commit 47d1f86

Please sign in to comment.