cfg

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(dir string, funcMap template.FuncMap) error

Load loads the configuration from config.json.

Types

type API added in v0.12.0

type API struct {
	Secret string `json:"secret"`
}

API is the server API configuration.

type Analytics

type Analytics struct {
	Provider     string   `json:"provider"`
	ClientID     string   `json:"client_id"`
	ClientSecret string   `json:"client_secret"`
	Subnets      []string `json:"subnets"`
	Header       []string `json:"header"`
}

Analytics is the web analytics configuration.

type CORS

type CORS struct {
	Origins  string `json:"origins"`
	Loglevel string `json:"loglevel"`
}

CORS is the HTTP CORS configuration.

type Config

type Config struct {
	BaseDir string           `json:"-"`
	FuncMap template.FuncMap `json:"-"`

	Dev       bool      `json:"dev"`
	LogLevel  string    `json:"log_level"`
	Server    Server    `json:"server"`
	API       API       `json:"api"`
	Remote    Remote    `json:"remote"`
	Git       Git       `json:"git"`
	Content   Content   `json:"content"`
	CORS      CORS      `json:"cors"`
	Sass      Sass      `json:"sass"`
	JS        JS        `json:"js"`
	Analytics Analytics `json:"analytics"`
}

Config is the Oogway application config.

func Get

func Get() *Config

Get returns the configuration. This is not thread safe! In production, the watcher must be disabled!

type Content

type Content struct {
	Provider string            `json:"provider"`
	NotFound map[string]string `json:"not_found"`
}

Content is the content and source configuration.

type Git added in v0.12.0

type Git struct {
	UpdateSeconds int    `json:"update_seconds"`
	Repository    string `json:"repository"`
}

Git is the Git repository configuration for auto-updates.

type JS

type JS struct {
	Entrypoint string `json:"entrypoint"`
	Dir        string `json:"dir"`
	Watch      bool   `json:"watch"`
	Out        string `json:"out"`
	SourceMap  bool   `json:"source_map"`
}

JS is the JavaScript compiler configuration.

type Remote added in v0.12.0

type Remote struct {
	URL    string `json:"url"`
	Secret string `json:"secret"`
}

Remote is the configuration for a remote Shifu server.

type Sass

type Sass struct {
	Entrypoint   string `json:"entrypoint"`
	Dir          string `json:"dir"`
	Watch        bool   `json:"watch"`
	Out          string `json:"out"`
	OutSourceMap string `json:"out_source_map"`
}

Sass is the sass compiler configuration.

type Server

type Server struct {
	Host             string `json:"host"`
	Port             int    `json:"port"`
	ShutdownTimeout  int    `json:"shutdown_time"`
	WriteTimeout     int    `json:"write_timeout"`
	ReadTimeout      int    `json:"read_timeout"`
	TLSCertFile      string `json:"tls_cert_file"`
	TLSKeyFile       string `json:"tls_key_file"`
	Hostname         string `json:"hostname"`
	SecureCookies    bool   `json:"secure_cookies"`
	CookieDomainName string `json:"cookie_domain_name"`
}

Server is the HTTP server configuration.

Jump to

Keyboard shortcuts

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