Skip to content

Commit

Permalink
Move frame work constant value to a single file (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
humingcheng authored and tianxiaoliang committed Feb 9, 2018
1 parent eeb927b commit a0e5958
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 17 deletions.
11 changes: 11 additions & 0 deletions core/metadata/framework.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Do not edit this file.

// Package metadata provides framework info registered to registry.
package metadata

// constant for sdk version, name, registration component
const (
SdkVersion = "0.1"
SdkName = "Go-Chassis"
SdkRegistrationComponent = "SDK"
)
7 changes: 0 additions & 7 deletions core/metadata/framework_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ import (
"sync"
)

// constant for sdk version, name, registration component
const (
SdkVersion = "0.1"
SdkName = "Go-Chassis"
SdkRegistrationComponent = "SDK"
)

// variables of micro-service framework, mutex variable
var (
msFramework *Framework
Expand Down
2 changes: 0 additions & 2 deletions examples/discovery/client/conf/chassis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ cse:
#register: manual optional:register不配置时默认为自动注册,可选参数有自动注册auto和手动注册manual
refeshInterval : 30s
watch: true
api:
version: v3
protocols:
highway:
listenAddress: 127.0.0.1:8080
Expand Down
8 changes: 0 additions & 8 deletions metrics/metric_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ import (
func initialize() {
p := filepath.Join(os.Getenv("GOPATH"), "src", "github.com", "ServiceComb", "go-chassis", "examples", "discovery", "server")
os.Setenv("CHASSIS_HOME", p)
chassisConf := filepath.Join(p, "conf")
os.MkdirAll(chassisConf, 0600)

chassisFilePath := filepath.Join(chassisConf, "chassis.yaml")
microserviceFilePath := filepath.Join(chassisConf, "microservice.yaml")
os.Create(chassisFilePath)
os.Create(microserviceFilePath)

config.Init()
lager.Initialize("", "INFO", "", "size", true, 1, 10, 7)
}
Expand Down
28 changes: 28 additions & 0 deletions scripts/version_set.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
set -e
set -x

CURRENT_DIR=$(cd $(dirname $0);pwd)
CHASSIS_DIR=$(dirname $CURRENT_DIR)

FRAMEWORK_FILE="$CHASSIS_DIR/core/metadata/framework.go"

if [ ! -f "$FRAMEWORK_FILE" ]; then
echo "$FRAMEWORK_FILE not exist!"
exit 1
fi

version=${1:-"0.1"}
cat << EOF > $FRAMEWORK_FILE
// Do not edit this file.
// Package metadata provides framework info registered to registry.
package metadata
// constant for sdk version, name, registration component
const (
SdkVersion = "$version"
SdkName = "Go-Chassis"
SdkRegistrationComponent = "SDK"
)
EOF

0 comments on commit a0e5958

Please sign in to comment.