config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: Apache-2.0 Imports: 6 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 {
	Project struct {
		Name    string `default:"riposo"`
		Version string
		Docs    string `default:"https://github.com/riposo/riposo/"`
	}

	ID struct {
		Factory string `default:"nanoid"`
	}

	Storage struct {
		URL string `default:"memory:"`
	}
	Permission struct {
		URL string `default:"memory:"`
	}
	Cache struct {
		URL string `default:"memory:"`
	}

	Batch struct {
		MaxRequests int `default:"25" split_words:"true"`
	}
	Auth struct {
		Methods []string `default:"basic"`
		Hash    string   `default:"argon2id"`
	}
	CORS struct {
		Origins []string      `default:"*"`
		MaxAge  time.Duration `default:"1h" split_words:"true"`
	}
	Pagination struct {
		TokenValidity time.Duration `default:"10m"`
		MaxLimit      int           `default:"10000" split_words:"true"`
	}

	Server struct {
		Addr            string        `default:":8888"`
		ReadTimeout     time.Duration `default:"60s" split_words:"true"`
		WriteTimeout    time.Duration `default:"60s" split_words:"true"`
		ShutdownTimeout time.Duration `default:"5s" split_words:"true"`
	}

	Temp struct {
		Dir string
	}

	// End of Service
	EOS struct {
		Time    time.Time
		Message string
		URL     string
	}

	Plugins      []string
	Capabilities *plugin.Set `ignored:"true"`
}

Config configures the server.

func Parse

func Parse() (*Config, error)

Parse parses the config from environment.

func (*Config) APIConfig

func (c *Config) APIConfig() *api.Config

APIConfig returns an API config.

func (*Config) InitHelpers

func (c *Config) InitHelpers() (*riposo.Helpers, error)

InitHelpers inits rts helpers.

Jump to

Keyboard shortcuts

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