config

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2023 License: MIT Imports: 9 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load added in v0.2.0

func Load()

Load configuration

func Parse

func Parse(cfg *Prest)

Parse pREST config todo: split config onto methods to simplify this

Types

type AccessConf

type AccessConf struct {
	Restrict    bool
	IgnoreTable []string
	Tables      []TablesConf
}

AccessConf informations

type Cache added in v1.0.13

type Cache struct {
	Enabled     bool            `mapstructure:"enabled"`
	Time        int             `mapstructure:"time"`
	StoragePath string          `mapstructure:"storagepath"`
	SufixFile   string          `mapstructure:"sufixfile"`
	Endpoints   []CacheEndpoint `mapstructure:"endpoints"`
}

Cache structure for storing cache system configuration

type CacheEndpoint added in v1.0.13

type CacheEndpoint struct {
	Enabled  bool   `mapstructure:"enabled"`
	Endpoint string `mapstructure:"endpoint"`
	Time     int    `mapstructure:"time"`
}

CacheEndpoint specific configuration for specific endpoint

type ExposeConf added in v1.1.6

type ExposeConf struct {
	Enabled         bool
	DatabaseListing bool
	SchemaListing   bool
	TableListing    bool
}

ExposeConf (expose data) information

type PluginMiddleware added in v1.3.0

type PluginMiddleware struct {
	File string
	Func string
}

type Prest

type Prest struct {
	Version              int
	AuthEnabled          bool
	AuthSchema           string
	AuthTable            string
	AuthUsername         string
	AuthPassword         string
	AuthEncrypt          string
	AuthMetadata         []string
	AuthType             string
	HTTPHost             string // HTTPHost Declare which http address the PREST used
	HTTPPort             int    // HTTPPort Declare which http port the PREST used
	HTTPTimeout          int
	PGHost               string
	PGPort               int
	PGUser               string
	PGPass               string
	PGDatabase           string
	PGURL                string
	PGSSLMode            string
	PGSSLCert            string
	PGSSLKey             string
	PGSSLRootCert        string
	ContextPath          string
	SSLMode              string
	SSLCert              string
	SSLKey               string
	SSLRootCert          string
	PGMaxIdleConn        int
	PGMaxOpenConn        int
	PGConnTimeout        int
	PGCache              bool
	JWTKey               string
	JWTAlgo              string
	JWTWhiteList         []string
	JSONAggType          string
	MigrationsPath       string
	QueriesPath          string
	AccessConf           AccessConf
	ExposeConf           ExposeConf
	CORSAllowOrigin      []string
	CORSAllowHeaders     []string
	CORSAllowMethods     []string
	CORSAllowCredentials bool
	Debug                bool
	Adapter              adapters.Adapter
	EnableDefaultJWT     bool
	SingleDB             bool
	HTTPSMode            bool
	HTTPSCert            string
	HTTPSKey             string
	Cache                Cache
	PluginPath           string
	PluginMiddlewareList []PluginMiddleware
}

Prest basic config

var (
	// PrestConf config variable
	PrestConf *Prest
)

type TablesConf

type TablesConf struct {
	Name        string   `mapstructure:"name"`
	Permissions []string `mapstructure:"permissions"`
	Fields      []string `mapstructure:"fields"`
}

TablesConf informations

Jump to

Keyboard shortcuts

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