settings

package
v0.0.0-...-685c49b Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Settings = Configuration{}
)

Functions

func LoadSettings

func LoadSettings()

func SaveSettings

func SaveSettings()

Types

type AtlasMongoConfig

type AtlasMongoConfig struct {
	Config           DatabaseConfig `json:"config"`
	Host             string         `json:"host"`
	Enabled          bool           `json:"enabled"`
	ConnectionString string         `json:"connection_string"`
}

type AuthConfig

type AuthConfig struct {
	Enabled      bool             `json:"enabled"`
	DefaultRoles []RoleConfig     `json:"default_roles"`
	SuperAdmin   SuperAdminConfig `json:"super_admin"`
}

type Configuration

type Configuration struct {
	HttpServer http.HttpServer `json:"http_server"`
	DB         DBConfig        `json:"db"`
	Auth       AuthConfig      `json:"auth"`
}

type DBConfig

type DBConfig struct {
	Local LocalMongoConfig `json:"local"`
	Atlas AtlasMongoConfig `json:"atlas"`
}

type DatabaseConfig

type DatabaseConfig struct {
	Username string `json:"username"`
	Password string `json:"password"`
	Database string `json:"database"`
}

type LocalMongoConfig

type LocalMongoConfig struct {
	Config  DatabaseConfig `json:"config"`
	Host    string         `json:"host"`
	Enabled bool           `json:"enabled"`
}

type ParamConfig

type ParamConfig struct {
	Name  string   `json:"name"`
	Rules []string `json:"rules"`
}

type PermissionConfig

type PermissionConfig struct {
	URL    string        `json:"url"`
	Rights auth.Rights   `json:"rights"`
	Params []ParamConfig `json:"params"`
}

type RightsConfig

type RightsConfig struct {
	Read  int `json:"read"`
	Write int `json:"write"`
}

type RoleConfig

type RoleConfig struct {
	Name        string             `json:"name" bson:"name"`
	Permissions []PermissionConfig `json:"permissions" bson:"permissions"`
}

type SuperAdminConfig

type SuperAdminConfig struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

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