configs

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigFileName = "api_node.yaml"

Variables

This section is empty.

Functions

This section is empty.

Types

type APIConfig

type APIConfig struct {
	OldRPC struct {
		Endpoints     []string `yaml:"endpoints" json:"endpoints"`
		DisableUpdate bool     `yaml:"disableUpdate" json:"disableUpdate"`
	} `yaml:"rpc,omitempty" json:"rpc"`

	RPCEndpoints     []string `yaml:"rpc.endpoints,flow" json:"rpc.endpoints"`
	RPCDisableUpdate bool     `yaml:"rpc.disableUpdate" json:"rpc.disableUpdate"`
	NodeId           string   `yaml:"nodeId" json:"nodeId"`
	Secret           string   `yaml:"secret" json:"secret"`
}

func LoadAPIConfig

func LoadAPIConfig() (*APIConfig, error)

func NewAPIConfig added in v0.5.8

func NewAPIConfig() *APIConfig

func (*APIConfig) Init added in v1.2.7

func (this *APIConfig) Init() error

func (*APIConfig) WriteFile

func (this *APIConfig) WriteFile(path string) error

WriteFile 保存到文件

type ClusterConfig

type ClusterConfig struct {
	OldRPC struct {
		Endpoints     []string `yaml:"endpoints" json:"endpoints"`
		DisableUpdate bool     `yaml:"disableUpdate" json:"disableUpdate"`
	} `yaml:"rpc,omitempty" json:"rpc"`

	RPCEndpoints     []string `yaml:"rpc.endpoints,flow" json:"rpc.endpoints"`
	RPCDisableUpdate bool     `yaml:"rpc.disableUpdate" json:"rpc.disableUpdate"`

	ClusterId string `yaml:"clusterId" json:"clusterId"`
	Secret    string `yaml:"secret" json:"secret"`
}

ClusterConfig 集群配置

func LoadClusterConfig added in v1.2.7

func LoadClusterConfig() (*ClusterConfig, error)

func (*ClusterConfig) Init added in v1.2.7

func (this *ClusterConfig) Init() error

Jump to

Keyboard shortcuts

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