config

package
v0.0.0-...-11b6202 Latest Latest
Warning

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

Go to latest
Published: May 18, 2025 License: MIT Imports: 31 Imported by: 0

Documentation

Overview

Package config build on top of https://github.com/anyproto/any-sync-tools/tree/72b131eaf4d6dc299ecf87dad60648e68054b35a/anyconf

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accounts

type Accounts struct {
	Coordinator accountservice.Config `yaml:"coordinator"`
	Consensus   accountservice.Config `yaml:"consensus"`
	Tree        accountservice.Config `yaml:"tree"`
	File        accountservice.Config `yaml:"file"`
}

type Config

type Config struct {
	BundleVersion string   `yaml:"bundleVersion"`
	BundleFormat  int      `yaml:"bundleFormat"`
	ExternalAddr  []string `yaml:"externalAddr"`
	ConfigID      string   `yaml:"configId"`
	NetworkID     string   `yaml:"networkId"`
	StoragePath   string   `yaml:"storagePath"`
	Accounts      Accounts `yaml:"accounts"`
	Nodes         Nodes    `yaml:"nodes"`
}

func CreateWrite

func CreateWrite(cfg *CreateOptions) *Config

func Load

func Load(cfgPath string) *Config

func (*Config) NodeConfigs

func (bc *Config) NodeConfigs() *NodeConfigs

NodeConfigs generates configurations for all node types based on the base config

func (*Config) YamlClientConfig

func (bc *Config) YamlClientConfig() ([]byte, error)

type CreateOptions

type CreateOptions struct {
	CfgPath       string
	StorePath     string
	MongoURI      string
	RedisURI      string
	ExternalAddrs []string
}

type NodeConfigs

type NodeConfigs struct {
	Coordinator *coordinatorconfig.Config
	Consensus   *consensusconfig.Config
	Filenode    *filenodeconfig.Config
	Sync        *syncconfig.Config

	// Used for our component and we can't add this into existing configs
	FilenodeStorePath string
}

NodeConfigs holds configuration for all node types in the system

type NodeConsensus

type NodeConsensus struct {
	NodeShared    `yaml:",inline"`
	MongoConnect  string `yaml:"mongoConnect"`
	MongoDatabase string `yaml:"mongoDatabase"`
}

type NodeCoordinator

type NodeCoordinator struct {
	NodeShared    `yaml:",inline"`
	MongoConnect  string `yaml:"mongoConnect"`
	MongoDatabase string `yaml:"mongoDatabase"`
}

type NodeFile

type NodeFile struct {
	NodeShared   `yaml:",inline"`
	RedisConnect string `yaml:"redisConnect"`
}

type NodeShared

type NodeShared struct {
	ListenTCPAddr string `yaml:"localTCPAddr"`
	ListenUDPAddr string `yaml:"localUDPAddr"`
}

type Nodes

type Nodes struct {
	Coordinator NodeCoordinator `yaml:"coordinator"`
	Consensus   NodeConsensus   `yaml:"consensus"`
	Tree        Tree            `yaml:"tree"`
	File        NodeFile        `yaml:"file"`
}

type Tree

type Tree struct {
	NodeShared `yaml:",inline"`
}

Jump to

Keyboard shortcuts

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