Skip to content

Commit 5bc5fb2

Browse files
authored
Merge branch 'main' into delete-go-sdk
2 parents 1c7c126 + 5db44ed commit 5bc5fb2

File tree

8 files changed

+48
-5
lines changed

8 files changed

+48
-5
lines changed

demo/configuration/common/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
You can run this demo with different component names.
2+
For example:
3+
```go
4+
go build -o client
5+
./client -s "config_demo"
6+
```

demo/secret/common/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
You can run this demo with different component names.
2+
For example:
3+
```go
4+
go build -o client
5+
./client -s "secret_demo"
6+
```

demo/secret/common/client.go

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"flag"
66
"fmt"
7+
78
"mosn.io/layotto/sdk/go-sdk/client"
89

910
runtimev1pb "mosn.io/layotto/spec/proto/runtime/v1"

demo/state/common/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
You can run this demo with different component names.
2+
For example:
3+
```go
4+
go build -o client
5+
./client -s "state_demo"
6+
```

docs/en/component_specs/secret/common.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This component can access secrets from local files, environment variables, k8s,
44

55
The json configuration file has the following structure:
66
```json
7-
"secretStores": {
7+
"secret_store": {
88
"<STORE NAME>": {
99
"metadata": {
1010
"<KEY>": "<VALUE>",
@@ -15,7 +15,7 @@ The json configuration file has the following structure:
1515
```
1616
Configuration examples of local file keys, local environment variables, and k8s keys:
1717
```
18-
"secretStores": {
18+
"secret_store": {
1919
"local.file": {
2020
"metadata": {
2121
"secretsFile": "../../configs/config_secret_local_file.json"

docs/zh/component_specs/secret/common.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
json配置文件有如下结构:
77
```json
8-
"secretStores": {
8+
"secret_store": {
99
"<STORE NAME>": {
1010
"metadata": {
1111
"<KEY>": "<VALUE>",
@@ -16,7 +16,7 @@ json配置文件有如下结构:
1616
```
1717
本地文件秘钥、本地环境变量、k8s秘钥的配置例子:
1818
```
19-
"secretStores": {
19+
"secret_store": {
2020
"local.file": {
2121
"metadata": {
2222
"secretsFile": "../../configs/config_secret_local_file.json"

pkg/runtime/config.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ package runtime
1919
import (
2020
"encoding/json"
2121

22+
"mosn.io/layotto/pkg/runtime/secretstores"
23+
2224
"mosn.io/layotto/components/custom"
2325

2426
"mosn.io/layotto/pkg/runtime/bindings"
@@ -50,7 +52,7 @@ type MosnRuntimeConfig struct {
5052
LockManagement map[string]lock.Config `json:"lock"`
5153
SequencerManagement map[string]sequencer.Config `json:"sequencer"`
5254
Bindings map[string]bindings.Metadata `json:"bindings"`
53-
SecretStoresManagement map[string]bindings.Metadata `json:"secret_store"`
55+
SecretStoresManagement map[string]secretstores.Metadata `json:"secret_store"`
5456
// <component type,component name,config>
5557
// e.g. <"super_pubsub","etcd",config>
5658
CustomComponent map[string]map[string]custom.Config `json:"custom_component,omitempty"`

pkg/runtime/secretstores/metadata.go

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright 2021 Layotto Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package secretstores
18+
19+
type Metadata struct {
20+
Version string
21+
Metadata map[string]string `json:"metadata"`
22+
}

0 commit comments

Comments
 (0)