Skip to content

Commit

Permalink
Merge pull request #6 from polarismesh/main
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
andrewshan authored Sep 12, 2021
2 parents c2cf990 + 7daa1bf commit 4eba9d3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
25 changes: 14 additions & 11 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ package config
import (
"errors"
"fmt"
"github.com/polarismesh/polaris-server/apiserver"
"github.com/polarismesh/polaris-server/naming"
"github.com/polarismesh/polaris-server/naming/cache"
"os"

"github.com/polarismesh/polaris-server/apiserver"
"github.com/polarismesh/polaris-server/common/log"
"github.com/polarismesh/polaris-server/naming"
"github.com/polarismesh/polaris-server/naming/cache"
"github.com/polarismesh/polaris-server/plugin"
"github.com/polarismesh/polaris-server/store"
yaml "gopkg.in/yaml.v2"
)

/**
* @brief 配置
* Config 配置
*/
type Config struct {
Bootstrap Bootstrap `yaml:"bootstrap"`
Expand All @@ -44,7 +44,7 @@ type Config struct {
}

/**
* @brief 启动引导配置
* Bootstrap 启动引导配置
*/
type Bootstrap struct {
Logger log.Options
Expand All @@ -53,7 +53,7 @@ type Bootstrap struct {
}

/**
* @brief polaris-server的自注册配置
* PolarisService polaris-server的自注册配置
*/
type PolarisService struct {
EnableRegister bool `yaml:"enable_register"`
Expand All @@ -63,7 +63,7 @@ type PolarisService struct {
}

/**
* @brief 服务的自注册的配置
* Service 服务的自注册的配置
*/
type Service struct {
Name string `yaml:"name"`
Expand All @@ -72,21 +72,24 @@ type Service struct {
}

/**
* @brief 对外提供的apiServers
* APIEntries 对外提供的apiServers
*/
type APIEntries struct {
Name string `yaml:"name"`
Protocols []string `yaml:"protocols"`
}

const (
DefaultPolarisName = "polaris-server"
// DefaultPolarisName default polaris name
DefaultPolarisName = "polaris-server"
// DefaultPolarisNamespace default namespace
DefaultPolarisNamespace = "Polaris"
DefaultFilePath = "polaris-server.yaml"
// DefaultFilePath default file path
DefaultFilePath = "polaris-server.yaml"
)

/**
* @brief 加载配置
* Load 加载配置
*/
func Load(filePath string) (*Config, error) {
if filePath == "" {
Expand Down
4 changes: 2 additions & 2 deletions standalone/install/uninstall-darwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

function uninstallPolarisServer() {
echo -e "uninstall polaris server ... "
local polaris_server_dirname=$(find . -name "polaris-server-release*" | awk 'NR==1{print}')
local polaris_server_dirname=$(find . -name "polaris-server-release*" | grep -v "zip" | awk 'NR==1{print}')
if [ ! -e ${polaris_server_dirname} ]; then
echo -e "${polaris_server_dirname} not exists, skip"
return
Expand All @@ -33,7 +33,7 @@ function uninstallPolarisServer() {

function uninstallPolarisConsole() {
echo -e "uninstall polaris console ... "
local polaris_console_dirname=$(find . -name "polaris-console-release*" | awk 'NR==1{print}')
local polaris_console_dirname=$(find . -name "polaris-console-release*" | grep -v "zip" | awk 'NR==1{print}')
if [ ! -e ${polaris_console_dirname} ]; then
echo -e "${polaris_console_dirname} not exists, skip"
return
Expand Down
4 changes: 2 additions & 2 deletions tool/include
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function start() {
}

function stop() {
pids=$(ps -e -o pid,cmd | grep -w "$cmdline" | grep -v "grep" | awk '{print $1}')
pids=$(ps -ef | grep -w "$cmdline" | grep -v "grep" | awk '{print $2}')
array=($pids)
for pid in ${array[@]}; do
log_info "stop $server_name: pid=$pid"
Expand All @@ -48,7 +48,7 @@ function stop() {
}

function reload() {
pids=$(ps -e -o pid,cmd | grep -w "$cmdline" | grep -v "grep" | awk '{print $1}')
pids=$(ps -ef | grep -w "$cmdline" | grep -v "grep" | awk '{print $2}')
array=($pids)
for pid in ${array[@]}; do
log_info "reload $server_name: pid=$pid"
Expand Down

0 comments on commit 4eba9d3

Please sign in to comment.