config

package
v0.0.0-...-e10d84e Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(dir string) error

Init prepare necessary files

func ParseInit

func ParseInit()

Types

type CDN

type CDN struct {
	Root     string   `yaml:"root"`
	JsonURL  []string `yaml:"json_url"`
	Redirect string   `yaml:"redirect"`
}

CDN config

type Config

type Config struct {
	Mode       string      `yaml:"mode"`
	Listen     string      `yaml:"listen"`
	Level      string      `yaml:"level"`
	PostgreSQL *PostgreSQL `yaml:"postgresql"`
	Redis      *Redis      `yaml:"redis"`
	*Server
	*CDN
	*Root
}

Config config struct

var (
	Conf Config
)

func Parse

func Parse() (*Config, error)

type Network

type Network struct {
	Name      string     `yaml:"name"`
	Owner     string     `yaml:"owner"`
	StartTime string     `yaml:"start_time"`
	RateLimit *RateLimit `yaml:"rate_limit"`
}

Network config

type PostgreSQL

type PostgreSQL struct {
	Host   string `yaml:"host"`
	Port   string `yaml:"port"`
	DBName string `yaml:"db_name"`
	DBUser string `yaml:"db_user"`
	DBPass string `yaml:"db_pass"`
}

PostgreSQL config

type RateLimit

type RateLimit struct {
	Minute string `yaml:"minute"`
	Hour   string `yaml:"hour"`
	Day    string `yaml:"day"`
}

RateLimit config

type Redis

type Redis struct {
	Host string `yaml:"host"`
	Port string `yaml:"port"`
	User string `yaml:"user"`
	Pass string `yaml:"pass"`
}

Redis config

type Root

type Root struct {
	Network *Network `yaml:"network"`
}

Root config

type Server

type Server struct {
	Root     string   `yaml:"root"`
	JsonURL  []string `yaml:"json_url"`
	Redirect string   `yaml:"redirect"`
}

Server config

Jump to

Keyboard shortcuts

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