config

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package config loads and validates krsec YAML configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountConfig

type AccountConfig struct {
	Name         string `yaml:"name"`
	Broker       string `yaml:"broker"` // currently supported: broker.CodeKIS, broker.CodeKiwoom, broker.CodeLS, broker.CodeToss
	Sandbox      bool   `yaml:"sandbox"`
	AppKey       string `yaml:"app_key"`
	AppSecret    string `yaml:"app_secret"`
	AppKeyEnv    string `yaml:"app_key_env,omitempty"`
	AppSecretEnv string `yaml:"app_secret_env,omitempty"`
	AccountID    string `yaml:"account_id"`
	AccountSeq   string `yaml:"account_seq,omitempty"`
	MACAddress   string `yaml:"mac_address,omitempty"`
}

AccountConfig represents a broker account configuration

type Config

type Config struct {
	Server   ServerConfig    `yaml:"server"`
	Storage  StorageConfig   `yaml:"storage,omitempty"`
	KISProxy KISProxyConfig  `yaml:"kis_proxy,omitempty"`
	Accounts []AccountConfig `yaml:"accounts,omitempty"`
}

Config represents the application configuration

func Load

func Load(filename string) (*Config, error)

Load loads configuration from a YAML file

func (*Config) Validate

func (c *Config) Validate() error

Validate validates and normalizes configuration values.

type KISProxyConfig added in v0.16.0

type KISProxyConfig struct {
	RateLimit KISProxyRateLimitConfig `yaml:"rate_limit,omitempty"`
}

KISProxyConfig represents KIS proxy behavior.

type KISProxyRateLimitConfig added in v0.16.0

type KISProxyRateLimitConfig struct {
	Enabled           *bool                             `yaml:"enabled,omitempty"`
	RequestsPerSecond float64                           `yaml:"requests_per_second,omitempty"`
	Burst             int                               `yaml:"burst,omitempty"`
	Overrides         []KISProxyRateLimitOverrideConfig `yaml:"overrides,omitempty"`
}

KISProxyRateLimitConfig limits outbound KIS upstream calls from the proxy.

type KISProxyRateLimitOverrideConfig added in v0.16.1

type KISProxyRateLimitOverrideConfig struct {
	Path              string  `yaml:"path,omitempty"`
	TRID              string  `yaml:"tr_id,omitempty"`
	RequestsPerSecond float64 `yaml:"requests_per_second,omitempty"`
	Burst             int     `yaml:"burst,omitempty"`
}

KISProxyRateLimitOverrideConfig applies a stricter limit to selected KIS proxy endpoints.

type ServerConfig

type ServerConfig struct {
	Host string `yaml:"host"`
	Port int    `yaml:"port"`
}

ServerConfig represents server configuration

type StorageConfig

type StorageConfig struct {
	TokenDir        string `yaml:"token_dir"`
	OrderContextDir string `yaml:"order_context_dir"`
}

StorageConfig represents local persistence paths.

Jump to

Keyboard shortcuts

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