loader

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Server struct {
		Port           int      `yaml:"port"`
		Timeout        string   `yaml:"timeout"`
		AllowCORS      bool     `yaml:"allow_cors"`
		AllowedOrigins []string `yaml:"allowed_origins"`
		Cookie         struct {
			Secure   bool   `yaml:"secure"`
			HTTPOnly bool   `yaml:"http_only"`
			SameSite string `yaml:"same_site"`
		} `yaml:"cookie"`
	} `yaml:"server"`

	Framework string `yaml:"framework"`

	Middlewares struct {
		Global []string `yaml:"global"`
	} `yaml:"middlewares"`

	Routes struct {
		Groups []struct {
			Base   string `yaml:"base"`
			Routes []struct {
				Path       string `yaml:"path"`
				Handler    string `yaml:"handler"`
				Method     string `yaml:"method"`
				BodyParams []struct {
					Name string `yaml:"name"`
					Type string `yaml:"type"`
				} `yaml:"body_params"`
			} `yaml:"routes"`
		} `yaml:"groups"`
	} `yaml:"routes"`
}

Config struct for YAML parsing

func LoadConfig

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

LoadConfig loads the YAML file into a Config struct

Jump to

Keyboard shortcuts

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