nacosserver

package module
v0.0.0-...-dce2b97 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 12 Imported by: 0

README

apiserver-nacos

如何使用

构建
# ${nacos_server_plugin_version}: nacosserver 插件版本,默认为 main 的最新 commit
# ${polaris_server_tag}: 北极星服务端版本信息,默认为 main 分支
make build ${nacos_server_plugin_version} ${polaris_server_tag}
配置文件调整

修改 conf/polaris-server.yaml 文件,参考下列配置补充

bootstrap:
  # Global log
  logger:
    nacos-apiserver:
      rotateOutputPath: log/runtime/nacos-apiserver.log
      errorRotateOutputPath: log/runtime/nacos-apiserver-error.log
      rotationMaxSize: 100
      rotationMaxBackups: 10
      rotationMaxAge: 7
      outputLevel: info
      # outputPaths:
      # - stdout
      # errorOutputPaths:
      # - stderr
apiservers:
  - name: service-nacos
    option:
      listenIP: "0.0.0.0"
      listenPort: 8848
      connLimit:
        openConnLimit: false
        maxConnPerHost: 128
        maxConnLimit: 10240

其他

  • NACOS 中的 struct 数据结构定义大部份引用自 nacos-sdk-go

Documentation

Index

Constants

View Source
const (
	ProtooclName = "service-nacos"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NacosServer

type NacosServer struct {
	// contains filtered or unexported fields
}

func (*NacosServer) GetPort

func (n *NacosServer) GetPort() uint32

GetPort API的监听端口

func (*NacosServer) GetProtocol

func (n *NacosServer) GetProtocol() string

GetProtocol API协议名

func (*NacosServer) Initialize

func (n *NacosServer) Initialize(ctx context.Context, option map[string]interface{},
	apiConf map[string]apiserver.APIConfig) error

Initialize API初始化逻辑

func (*NacosServer) Restart

func (n *NacosServer) Restart(option map[string]interface{}, api map[string]apiserver.APIConfig,
	errCh chan error) error

Restart 重启API

func (*NacosServer) Run

func (n *NacosServer) Run(errCh chan error)

Run API服务的主逻辑循环

func (*NacosServer) Stop

func (n *NacosServer) Stop()

Stop 停止API端口监听

Directories

Path Synopsis
v2
pb

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL