config

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AsyncConfig added in v0.2.1

type AsyncConfig struct {
	Name        string               `yaml:"name"`
	Version     string               `yaml:"version"`
	Description string               `yaml:"description"`
	Docs        []AsyncDocumentation `yaml:"docs"`
}

type AsyncDocumentation added in v0.2.1

type AsyncDocumentation struct {
	Type             string              `yaml:"type"`
	Description      string              `yaml:"description"`
	Servers          map[string][]string `yaml:"servers"`
	URLGroups        []URLGroup          `yaml:"url_groups"`
	ProtectedMethods []string            `yaml:"protected_methods"`
}

type Config

type Config struct {
	ExchangeDir  string                 `yaml:"exchange_dir"`
	Settings     Settings               `yaml:"settings"`
	RestConfigs  map[string]RestConfig  `yaml:"rest_configs"`
	AsyncConfigs map[string]AsyncConfig `yaml:"async_configs"`
}

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig loads the configuration from a YAML file

type Documentation

type Documentation struct {
	Type               string     `yaml:"type"`
	Description        string     `yaml:"description"`
	Servers            []string   `yaml:"servers"`
	URLGroups          []URLGroup `yaml:"url_groups"`
	ProtectedEndpoints []string   `yaml:"protected_endpoints"`
}

type RestConfig

type RestConfig struct {
	Name        string          `yaml:"name"`
	Version     string          `yaml:"version"`
	Description string          `yaml:"description"`
	Docs        []Documentation `yaml:"docs"`
}

type Settings

type Settings struct {
	UpdateInterval string `yaml:"update_interval"`
	OutputDir      string `yaml:"output_dir"`
	HistoryDir     string `yaml:"history_dir"`
	LogLevel       string `yaml:"log_level"`
}

type URLEntity

type URLEntity struct {
	GroupName    string `yaml:"group_name"`
	URL          string `yaml:"url"`
	DocType      string `yaml:"doc_type"`
	SecurityType string `yaml:"security_type"`
	Protected    bool   `yaml:"protected"`
	OperationID  string `yaml:"operation_id"`
}

type URLGroup

type URLGroup struct {
	Name         string    `yaml:"name"`
	Description  string    `yaml:"description"`
	URLs         []URLItem `yaml:"-"` // Custom unmarshaling
	DocType      string    `yaml:"doc_type"`
	SecurityType string    `yaml:"security_type"`
}

URLGroup is a group of URLs that are parsed by the same parser

func (URLGroup) MarshalYAML

func (g URLGroup) MarshalYAML() (interface{}, error)

MarshalYAML implements custom marshaling for URLGroup

func (*URLGroup) UnmarshalYAML

func (g *URLGroup) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML implements custom unmarshaling for URLGroup

type URLItem

type URLItem struct {
	StringURL string
	Entity    *URLEntity
}

URLItem represents either a string URL or a URLEntity

func (URLItem) URL

func (u URLItem) URL() string

URL returns the URL of the URLItem

Jump to

Keyboard shortcuts

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