config

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package config provides configuration-driven adapter bootstrap helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildManager

func BuildManager(ctx context.Context, cfg Config) (*exchanges.Manager, error)

BuildManager constructs a manager from the provided parsed configuration.

func LoadManager

func LoadManager(ctx context.Context, path string) (*exchanges.Manager, error)

LoadManager loads a config file and constructs a populated adapter manager.

Types

type Config

type Config struct {
	Exchanges []ExchangeConfig `json:"exchanges" yaml:"exchanges"`
}

Config is the top-level YAML/JSON shape for adapter bootstrap files.

func Load

func Load(path string) (Config, error)

Load reads a YAML or JSON config file from disk and expands environment variables.

type ExchangeConfig

type ExchangeConfig struct {
	Name       string               `json:"name" yaml:"name"`
	Alias      string               `json:"alias,omitempty" yaml:"alias,omitempty"`
	MarketType exchanges.MarketType `json:"market_type" yaml:"market_type"`
	Options    map[string]string    `json:"options,omitempty" yaml:"options,omitempty"`
}

ExchangeConfig describes one adapter instance to construct from config.

Directories

Path Synopsis
Package all blank-imports every registered exchange package for config bootstrap.
Package all blank-imports every registered exchange package for config bootstrap.

Jump to

Keyboard shortcuts

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