Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Version string = "development"
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // DB contains database connection config. DB DB `json:"db"` // SocketFile contains path to socket. SocketFile string `json:"socket_file"` // Server contains API server config. Server *Server `json:"server"` // Invoker contains invoker config. Invoker *Invoker `json:"invoker"` // Storage contains configuration for storage. Storage *Storage `json:"storage"` // Security contains security config. Security *Security `json:"security"` // SMTP contains SMTP config. SMTP *SMTP `json:"smtp"` // LogLevel contains level of logging. // // You can use following values: // * debug // * info (default) // * warn // * error // * off LogLevel LogLevel `json:"log_level,omitempty"` }
Config stores configuration for Solve API and Invoker.
func LoadFromFile ¶
LoadFromFile loads configuration from json file.
type DB ¶
type DB struct { // Options contains options for database driver. // // For SQLiteDriver field should contains SQLiteOptions. // For PostgresDriver field should contains PostgresOptions. Options any }
DB stores configuration for database connection.
func (DB) MarshalJSON ¶
func (*DB) UnmarshalJSON ¶
UnmarshalJSON parses JSON to create appropriate connection configuration.
type Invoker ¶
type Invoker struct { // Workers contains amount of parallel workers. Workers int `json:"workers"` // Safeexec contains config for safeexec binary. Safeexec Safeexec `json:"safeexec"` }
Invoker contains invoker config.
type LocalStorageOptions ¶
type LocalStorageOptions struct {
FilesDir string `json:"files_dir"`
}
func (LocalStorageOptions) Driver ¶
func (o LocalStorageOptions) Driver() StorageDriver
type PostgresOptions ¶
type PostgresOptions struct { // Hosts contains list of hosts. Hosts []string `json:"hosts"` // User contains username of user. User string `json:"user"` // Password contains password of user. Password string `json:"password"` // Name contains name of database. Name string `json:"name"` // SSLMode contains sslmode configuration. SSLMode string `json:"sslmode"` }
PostgresOptions stores Postgres connection options.
type S3StorageOptions ¶
type S3StorageOptions struct { Region string `json:"region"` AccessKeyID string `json:"access_key_id"` SecretAccessKey string `json:"secret_access_key"` Endpoint string `json:"endpoint"` Bucket string `json:"bucket"` PathPrefix string `json:"path_prefix,omitempty"` UsePathStyle bool `json:"use_path_style,omitempty"` }
func (S3StorageOptions) Driver ¶
func (o S3StorageOptions) Driver() StorageDriver
type SQLiteOptions ¶
type SQLiteOptions struct { // Path contains path to SQLite database file. Path string `json:"path"` }
SQLiteOptions stores SQLite connection options.
type Security ¶
type Security struct { // PasswordSalt contains salt for password hashing. PasswordSalt string `json:"password_salt"` }
Security contains security config.
type Server ¶
type Server struct { // Host contains server host. Host string `json:"host"` // Port contains server port. Port int `json:"port"` // SiteURL contains site index url. SiteURL string `json:"site_url"` }
Server contains server config.
type Storage ¶
type Storage struct {
Options StorageOptions `json:"options"`
}
Storage contains storage config.
func (Storage) MarshalJSON ¶
func (*Storage) UnmarshalJSON ¶
type StorageDriver ¶
type StorageDriver string
const ( LocalStorageDriver StorageDriver = "local" S3StorageDriver StorageDriver = "s3" )
type StorageOptions ¶
type StorageOptions interface {
Driver() StorageDriver
}
Click to show internal directories.
Click to hide internal directories.