Documentation
¶
Index ¶
- Constants
- Variables
- type AccessControlList
- type CLI
- type Factory
- type HttpServer
- type HttpsServer
- type SOCKET
- type Server
- type VConfig
- type ViperConfig
- func (c *ViperConfig) Get(key string) interface{}
- func (c *ViperConfig) GetBool(key string) bool
- func (c *ViperConfig) GetInt(key string) int
- func (c *ViperConfig) GetInt64(key string) int64
- func (c *ViperConfig) GetString(key string) string
- func (c *ViperConfig) GetUint32(key string) uint32
- func (c *ViperConfig) GetUint64(key string) uint64
- func (c *ViperConfig) IsSet(key string) bool
- func (c *ViperConfig) PrintConfigsToConsole()
- func (c *ViperConfig) ReadConfigsFromEnvs()
- type WebMux
- type XNDBServer
- func (srv *XNDBServer) CreateMux() *mux.Router
- func (srv *XNDBServer) HandlerDel(w http.ResponseWriter, r *http.Request)
- func (srv *XNDBServer) HandlerGetValByKey(w http.ResponseWriter, r *http.Request)
- func (srv *XNDBServer) HandlerSet(w http.ResponseWriter, r *http.Request)
- func (srv *XNDBServer) SetLogLvl(w http.ResponseWriter, r *http.Request)
Constants ¶
View Source
const ACK = string(0x06) // Acknowledge // 6
View Source
const BEL = string(0x07) // Bell, Alert // 7
View Source
const CAN = string(0x18) // Cancel // 24
View Source
const COM = ","
View Source
const CONFIG_DIR = "cfg"
View Source
const CR = "\r"
View Source
const CRLF = CR + LF
View Source
const CaseAdded = 0x69
View Source
const CaseDeleted = 0x00
View Source
const CaseDupes = 0xB8
View Source
const CasePass = 0xFF
View Source
const DATA_DIR = "dat"
View Source
const DEFAULT_CONFIG_FILE = "config.toml"
View Source
const DEFAULT_LOGLEVEL_INT = ilog.INFO
View Source
const DEFAULT_LOGLEVEL_STR = "INFO"
View Source
const DEFAULT_LOGS_FILE = "ndb.log"
View Source
const DEFAULT_PW_LEN = 32 // admin/username:password
View Source
const DEFAULT_SERVER_ADDR = "[::1]"
View Source
const DEFAULT_SERVER_SOCKET_PATH = "/tmp/ndb.socket"
View Source
const DEFAULT_SERVER_SOCKET_TCP_PORT = "3420"
View Source
const DEFAULT_SERVER_SOCKET_TLS_PORT = "4420"
View Source
const DEFAULT_SERVER_TCP_PORT = "2420"
View Source
const DEFAULT_SERVER_UDP_PORT = "2240"
View Source
const DEFAULT_SUB_DICKS = 1000
View Source
const DEFAULT_SUPERADMIN = "superadmin"
View Source
const DEFAULT_TLS_PRIVKEY = "privkey.pem"
View Source
const DEFAULT_TLS_PUBCERT = "fullchain.pem"
View Source
const DOT = "."
View Source
const ENQ = string(0x05) // Enquiry // 5
View Source
const EOM = string(0x19) // End of medium // 25
View Source
const EOT = string(0x04) // End of Transmission // 4
View Source
const ESC = string(0x1B) // Escape // 27
View Source
const ETB = string(0x17) // End of Trans. Block // 23
View Source
const ETX = string(0x03) // End of Text // 3
View Source
const EmptyStr = ""
View Source
const FlagSearch = 0x42
View Source
const KEY_LIMIT = 1024 * 1024 * 1024 // respond: CAN
socket proto flags
View Source
const KEY_PARAM = "key"
View Source
const LF = "\n"
View Source
const Magic1 = "1" // mem-prof
client proto flags
View Source
const Magic2 = "2" // cpu-prof
View Source
const MagicA = "A" // add
View Source
const MagicD = "D" // del
View Source
const MagicG = "G" // get
View Source
const MagicL = "L" // list
View Source
const MagicS = "S" // set
View Source
const MagicZ = "Z" // quit
View Source
const NUL = string(0x00) // Null character // 0
ASCII control characters [hex: 0 - 1F] // [DEC character code 0-31]
View Source
const SEM = ";"
View Source
const SOH = string(0x01) // Start of Heading // 1
View Source
const STX = string(0x02) // Start of Text // 2
View Source
const SUB = string(0x20) // Substitute // 26
View Source
const SYN = string(0x16) // Synchronous Idle // 22
View Source
const VAL_LIMIT = 1024 * 1024 * 1024 // respond: CAN
View Source
const VK_ACCESS_SUPERADMIN_PASS = "server.superadmin_pass"
View Source
const VK_ACCESS_SUPERADMIN_USER = "server.superadmin_user"
VIPER CONFIG KEYS
View Source
const VK_LOG_LOGFILE = "log.logfile"
View Source
const VK_LOG_LOGLEVEL = "log.loglevel"
View Source
const VK_NET_WEBSRV_IDLE_TIMEOUT = "network.websrv_idle_timeout"
View Source
const VK_NET_WEBSRV_READ_TIMEOUT = "network.websrv_read_timeout"
View Source
const VK_NET_WEBSRV_WRITE_TIMEOUT = "network.websrv_write_timeout"
View Source
const VK_SEC_TLS_ENABLED = "security.tls_enabled"
View Source
const VK_SEC_TLS_PRIVKEY = "security.tls_priv_key"
View Source
const VK_SEC_TLS_PUBCERT = "security.tls_pub_cert"
View Source
const VK_SERVER_HOST = "server.bindip"
View Source
const VK_SERVER_PORT_TCP = "server.port"
View Source
const VK_SERVER_PORT_UDP = "server.port_udp"
View Source
const VK_SERVER_SOCKET_ACL = "server.socket_acl"
View Source
const VK_SERVER_SOCKET_PATH = "server.socket_path"
View Source
const VK_SERVER_SOCKET_PORT_TCP = "server.socket_tcpport"
View Source
const VK_SERVER_SOCKET_PORT_TLS = "server.socket_tlsport"
View Source
const VK_SETTINGS_BASE_DIR = "settings.base_dir"
View Source
const VK_SETTINGS_DATA_DIR = "settings.data_dir"
View Source
const VK_SETTINGS_SETTINGS_DIR = "settings.settings_dir"
View Source
const VK_SETTINGS_SUB_DICKS = "settings.sub_dicks"
View Source
const V_DEFAULT_NET_WEBSRV_IDLE_TIMEOUT = 120
View Source
const V_DEFAULT_NET_WEBSRV_READ_TIMEOUT = 5
View Source
const V_DEFAULT_NET_WEBSRV_WRITE_TIMEOUT = 10
View Source
const V_DEFAULT_SERVER_SOCKET_ACL = "127.0.0.1,::1"
View Source
const V_DEFAULT_SUB_DICKS = "100"
View Source
const V_DEFAULT_TLS_ENABLED = false
Variables ¶
View Source
var ( RTO int // ReadTimeout: time.Duration(RTO) * time.Second, WTO int // WriteTimeout: time.Duration(WTO) * time.Second, ITO int // IdleTimeout: time.Duration(ITO) * time.Second, )
View Source
var AVAIL_SUBDICKS = []uint32{10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, 2000000000, 4000000000}
View Source
var (
DefaultACL map[string]bool // can be set before booting
)
View Source
var Prof *prof.Profiler
Functions ¶
This section is empty.
Types ¶
type AccessControlList ¶
type AccessControlList struct {
// contains filtered or unexported fields
}
func NewACL ¶
func NewACL() *AccessControlList
func (*AccessControlList) IsAllowed ¶
func (a *AccessControlList) IsAllowed(ip string) bool
func (*AccessControlList) SetACL ¶
func (a *AccessControlList) SetACL(ip string, val bool)
func (*AccessControlList) SetupACL ¶
func (a *AccessControlList) SetupACL()
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
func NewFactory ¶
func NewFactory() *Factory
type HttpServer ¶
type HttpServer struct { // contains filtered or unexported fields } // end struct HttpServer
func NewHttpServer ¶
func NewHttpServer(cfg VConfig, ndbServer WebMux, logs ilog.ILOG, stop_chan chan struct{}, wg sync.WaitGroup) (srv *HttpServer)
func (*HttpServer) Start ¶
func (server *HttpServer) Start()
func (*HttpServer) Stop ¶
func (server *HttpServer) Stop()
type HttpsServer ¶
type HttpsServer struct { // contains filtered or unexported fields } // end struct HttpsServer
func NewHttpsServer ¶
func NewHttpsServer(cfg VConfig, ndbServer WebMux, logs ilog.ILOG, stop_chan chan struct{}, wg sync.WaitGroup) (srv *HttpsServer)
func (*HttpsServer) Start ¶
func (server *HttpsServer) Start()
func (*HttpsServer) Stop ¶
func (server *HttpsServer) Stop()
type SOCKET ¶
func NewSocketHandler ¶
func (*SOCKET) CloseSocket ¶
func (sock *SOCKET) CloseSocket()
type VConfig ¶
type VConfig interface { Get(key string) interface{} GetString(key string) string GetInt(key string) int GetInt64(key string) int64 GetUint32(key string) uint32 GetUint64(key string) uint64 GetBool(key string) bool IsSet(key string) bool }
func NewViperConf ¶
type ViperConfig ¶
type ViperConfig struct {
// contains filtered or unexported fields
}
func (*ViperConfig) Get ¶
func (c *ViperConfig) Get(key string) interface{}
func (*ViperConfig) GetBool ¶
func (c *ViperConfig) GetBool(key string) bool
func (*ViperConfig) GetInt ¶
func (c *ViperConfig) GetInt(key string) int
func (*ViperConfig) GetInt64 ¶
func (c *ViperConfig) GetInt64(key string) int64
func (*ViperConfig) GetString ¶
func (c *ViperConfig) GetString(key string) string
func (*ViperConfig) GetUint32 ¶
func (c *ViperConfig) GetUint32(key string) uint32
func (*ViperConfig) GetUint64 ¶
func (c *ViperConfig) GetUint64(key string) uint64
func (*ViperConfig) IsSet ¶
func (c *ViperConfig) IsSet(key string) bool
func (*ViperConfig) PrintConfigsToConsole ¶
func (c *ViperConfig) PrintConfigsToConsole()
func (*ViperConfig) ReadConfigsFromEnvs ¶
func (c *ViperConfig) ReadConfigsFromEnvs()
type WebMux ¶
type WebMux interface { CreateMux() *mux.Router HandlerGetValByKey(w http.ResponseWriter, r *http.Request) HandlerSet(w http.ResponseWriter, r *http.Request) HandlerDel(w http.ResponseWriter, r *http.Request) }
type XNDBServer ¶
type XNDBServer struct {
// contains filtered or unexported fields
}
func NewXNDBServer ¶
func NewXNDBServer(db *database.XDatabase, logs ilog.ILOG) *XNDBServer
func (*XNDBServer) CreateMux ¶
func (srv *XNDBServer) CreateMux() *mux.Router
func (*XNDBServer) HandlerDel ¶
func (srv *XNDBServer) HandlerDel(w http.ResponseWriter, r *http.Request)
func (*XNDBServer) HandlerGetValByKey ¶
func (srv *XNDBServer) HandlerGetValByKey(w http.ResponseWriter, r *http.Request)
func (*XNDBServer) HandlerSet ¶
func (srv *XNDBServer) HandlerSet(w http.ResponseWriter, r *http.Request)
func (*XNDBServer) SetLogLvl ¶
func (srv *XNDBServer) SetLogLvl(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.