31 Commits

Author SHA1 Message Date
Waldemar Quevedo
62242a7215 Fix JSON compatibility in conf format
Signed-off-by: Waldemar Quevedo <wally@nats.io>
2023-08-22 12:47:51 -07:00
Waldemar Quevedo
412dee67f1 config: allow empty configs, but prevent bad configs
- Adds reporting the line with the bad key position
  that makes the config invalid.

- Fixes a few tests with trailing braces which were
  being handled as keys and ignored before.

Signed-off-by: Waldemar Quevedo <wally@nats.io>
2023-08-13 23:13:32 -07:00
Waldemar Quevedo
ba596f7de1 config: make parsing configurations without usable values invalid
This makes configuration files that are empty, or read and processed
by the parser but with no detected values now return an error.

Signed-off-by: Waldemar Quevedo <wally@nats.io>
2023-08-01 21:55:09 -07:00
Neil Twigg
14d0ba1c65 Fix some lint errors after move to golangci-lint 2022-12-30 20:00:08 +00:00
Ivan Kozlovic
3c9a7cc6e5 Move to Go 1.19, remote io/util, fix data race and a flapper
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2022-08-05 09:55:37 -06:00
Waldemar Quevedo
2047ed4537 Add support for base2 units in NATS config
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2020-10-28 13:52:35 -07:00
Derek Collison
ec0bc1dbec First pass account configuration for jetstream
Signed-off-by: Derek Collison <derek@nats.io>
2020-05-19 14:21:27 -07:00
Waldemar Quevedo
457c442198 Show parse errors from looked up env vars
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2019-02-06 08:57:08 -08:00
Ivan Kozlovic
7449e9ac53 Replace megacheck with staticcheck
Fixed issues reported by staticcheck

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
2019-01-09 14:14:47 -07:00
Derek Collison
2d54fc3ee7 Account lookup failures, account and client limits, options reload.
Changed account lookup and validation failures to be more understandable by users.
Changed limits to be -1 for unlimited to match jwt pkg.

The limits changed exposed problems with options holding real objects causing issues with reload tests under race mode.
Longer term this code should be reworked such that options only hold config data, not real structs, etc.

Signed-off-by: Derek Collison <derek@nats.io>
2018-12-05 14:25:40 -08:00
Waldemar Quevedo
18cb7ed49a Fix position reporting of variables and bcrypt values
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2018-10-03 15:02:49 -07:00
Waldemar Quevedo
18a62cdb60 Change style of reporting errors with line and pos
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2018-10-03 14:52:57 -07:00
Waldemar Quevedo
181b07ebc1 Config reporting with line and error position
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2018-10-02 11:38:15 -07:00
Waldemar Quevedo
df2364af26 Add -t pedantic config check to the server
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
2018-09-11 16:06:53 -07:00
Derek Collison
00901acc78 Update license to Apache 2 2018-03-15 22:31:07 -07:00
Peter Miron
d1f38f38a2 changes to support random ports for clusters and profiler. 2017-06-10 10:35:01 -04:00
Derek Collison
6b307af1eb Add more options for Booleans 2016-11-21 15:06:15 -08:00
Derek Collison
e57c949658 Add support for 'include' to configuration files 2016-11-21 14:58:05 -08:00
Derek Collison
6f9e4d6512 Added support for integer suffixes, e.g. 1k, 8mb 2016-11-20 17:39:04 -08:00
Derek Collison
8f4b31b5ed Special case raw bcrypted passwords 2016-05-22 10:41:16 -07:00
Derek Collison
832bac98be First pass variable support.
This allows blocked scoped variables to be set and retrieved as values using the $ prefix.
e.g. foo = 22; bar = $foo

Also supports env variables being used as variables and will properly parse to the correct type.
2016-05-22 10:21:00 -07:00
Derek Collison
df02bc0bcf Removed sublist, hash and hashmap, no longer needed. 2016-04-02 12:52:48 -07:00
Colin Sullivan
2baac47820 Address issues found by golint.
* No functional changes
* Did not address the ALL_CAPS issues
* Did not modify public APIs and field names.
2016-03-15 15:21:13 -06:00
Derek Collison
74ccae079e pkg comments 2013-10-24 10:46:54 -07:00
Peter Ohler
e6b5c41e54 fixed problem with parsing arrays 2013-08-21 08:51:25 -07:00
Derek Collison
377ade5e42 go fmt 2013-08-02 16:52:08 -07:00
Derek Collison
3ef0c2329a Fixed bug with block comments inside maps 2013-07-27 13:32:57 -07:00
Derek Collison
c6dcc8e945 Merge branch 'master' of https://github.com/apcera/gnatsd 2013-04-21 23:05:57 -07:00
Derek Collison
dcdcb84295 Allow non-quoted string values 2013-04-21 23:39:09 -04:00
Cameron Walters
2012c9a5bf Line length & a spelling correction. :) 2013-03-28 10:03:52 -07:00
Derek Collison
ee17979d6a Added first pass parser 2013-03-25 20:29:42 -07:00