2016-02-26 17:25:32 +00:00
|
|
|
// Copyright © 2016 Abcum Ltd
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
package cnf
|
|
|
|
|
2017-02-21 00:09:42 +00:00
|
|
|
import (
|
|
|
|
"net"
|
|
|
|
"time"
|
|
|
|
)
|
2017-02-09 11:16:59 +00:00
|
|
|
|
2016-09-06 10:19:29 +00:00
|
|
|
var Settings *Options
|
|
|
|
|
2016-04-08 17:55:15 +00:00
|
|
|
// Options defines global configuration options
|
2016-03-15 15:05:47 +00:00
|
|
|
type Options struct {
|
2016-04-08 17:55:15 +00:00
|
|
|
DB struct {
|
2018-01-11 14:57:10 +00:00
|
|
|
Key []byte // Data encryption key
|
|
|
|
Code string // Data encryption key string
|
|
|
|
Path string // Path to store the data file
|
|
|
|
Base string // Base key to use in KV stores
|
|
|
|
Proc struct {
|
2019-10-07 23:43:39 +00:00
|
|
|
Flush time.Duration // Timeframe for flushing data
|
2018-01-11 14:57:10 +00:00
|
|
|
Shrink time.Duration // Timeframe for shrinking data
|
|
|
|
}
|
2016-07-19 11:05:11 +00:00
|
|
|
Cert struct {
|
|
|
|
CA string
|
|
|
|
Crt string
|
|
|
|
Key string
|
|
|
|
SSL bool
|
|
|
|
}
|
2016-04-08 17:55:15 +00:00
|
|
|
}
|
2016-02-27 12:04:53 +00:00
|
|
|
|
2019-06-16 07:05:59 +00:00
|
|
|
Port int // Port as an number
|
2016-07-04 10:33:07 +00:00
|
|
|
|
2019-06-16 07:05:59 +00:00
|
|
|
Conn string // Port as a string
|
|
|
|
|
|
|
|
Bind string // Hostname of the node
|
2016-07-04 10:33:07 +00:00
|
|
|
|
2016-04-08 17:55:15 +00:00
|
|
|
Cert struct {
|
2016-07-04 10:33:07 +00:00
|
|
|
Crt string // File location of server crt
|
|
|
|
Key string // File location of server key
|
2016-04-08 17:55:15 +00:00
|
|
|
}
|
2016-02-27 12:04:53 +00:00
|
|
|
|
2016-04-08 17:55:15 +00:00
|
|
|
Auth struct {
|
2017-02-22 01:40:54 +00:00
|
|
|
Auth string // Master authentication user:pass
|
|
|
|
User string // Master authentication username
|
|
|
|
Pass string // Master authentication password
|
|
|
|
Addr []string // Allowed ip ranges for authentication
|
|
|
|
Nets []*net.IPNet // Allowed cidr ranges for authentication
|
2016-04-08 17:55:15 +00:00
|
|
|
}
|
2016-02-26 17:25:32 +00:00
|
|
|
|
2020-09-22 09:46:00 +00:00
|
|
|
Query struct {
|
|
|
|
Timeout time.Duration // Fixed query timeout
|
|
|
|
}
|
|
|
|
|
2016-04-08 17:55:15 +00:00
|
|
|
Logging struct {
|
2017-02-22 14:48:22 +00:00
|
|
|
Level string // Stores the configured logging level
|
|
|
|
Output string // Stores the configured logging output
|
|
|
|
Format string // Stores the configured logging format
|
2016-04-08 17:55:15 +00:00
|
|
|
}
|
2016-02-26 17:25:32 +00:00
|
|
|
}
|