Brian Picciano
dd2d601081
mcfg: refactor so as to use new mcmp.Component type, and use the option pattern to reduce number of arguments to parameters
2019-06-15 16:45:53 -06:00
Brian Picciano
e9b7f24dba
mcfg: update docs
2019-05-18 12:50:04 -06:00
Brian Picciano
a07df614d8
mcfg: make sure Populate never returns a nil context
2019-04-29 20:58:13 -04:00
Brian Picciano
8db9e78e08
mcfg: add WithFloat64 and WithRequiredFloat64
2019-04-20 16:49:12 -04:00
Brian Picciano
507c359997
mcfg: modify WithCLITail to allow modifying the Usage description
2019-04-06 15:07:37 -04:00
Brian Picciano
99387d89ac
mcfg: don't allow for empty sub-command, as that makes printing help weird
2019-04-06 14:20:01 -04:00
Brian Picciano
b35b44eb22
mcfg: implement WithCLISubCommand
2019-04-04 16:25:02 -04:00
Brian Picciano
2eb4a37533
mcfg: make Parse and Populate return a Context, to allow for sub-commands
2019-04-04 12:52:43 -04:00
Brian Picciano
c0afa3d126
mcfg: Parse now takes a Context, which allows for implementing WithCLITail
2019-04-04 12:20:40 -04:00
Brian Picciano
a596306d9e
mcfg: made SourceCLI and SourceEnv be pointers
2019-04-04 10:57:37 -04:00
Brian Picciano
ea72c49935
mcfg: implement SourceCLI.TailCallback (though I'm not convinced about the naming or necessity of it)
2019-04-02 23:21:21 -04:00
Brian Picciano
f5cea76cb7
mtest/massert: rename a bunch of functions
2019-03-10 19:23:37 -04:00
Brian Picciano
4536db8968
merr: refactor Wrap/WrapSkip/New to take multiple contexts rather than annotations
2019-02-27 13:05:51 -05:00
Brian Picciano
e1e52db208
refactor everything to use context's annotation system, making some significant changes to annotations themselves along the way
2019-02-24 15:36:07 -05:00
Brian Picciano
4b446a0efc
mctx: refactor so that contexts no longer carry mutable data
...
This change required refactoring nearly every package in this project,
but it does a lot to simplify mctx and make other code using it easier
to think about.
Other code, such as mlog and mcfg, had to be slightly modified for this
change to work as well.
2019-02-07 19:42:12 -05:00
Brian Picciano
f02f2904b0
mcfg: ensure all usages end in a period when printing help to cli
2019-02-02 19:35:30 -05:00
Brian Picciano
8e2cffd65b
mcfg: make ParamValue not embed Param, so that a Source which is []ParamValue makes sense, and can replace SourceMap
2019-01-25 17:33:36 -05:00
Brian Picciano
b33b157e15
mcfg: update docs to make running Populate more than once explicitly allowed
2019-01-25 16:46:39 -05:00
Brian Picciano
05a69589bc
mcfg: use merr for returned errors, and make help output prioritize required params towards the top
2019-01-24 22:02:04 -05:00
Brian Picciano
96db88b7d0
mcfg: allow Source param to Populate to be nil
2019-01-11 17:44:53 -05:00
Brian Picciano
6e8338a5f8
mcfg: refactor to remove Child and Hook stuff, and use mctx instead
2019-01-08 14:21:55 -05:00
Brian Picciano
132c51eaf0
mcfg: move Path out of ParamValue and into Param, which allows for shuffling around a whole bunch of code to make things make a bit more sense
2018-08-13 21:02:06 -04:00
Brian Picciano
3de30eb819
mcfg: centralize logic for fuzzy parsing strings, use it to implement SourceMap
2018-08-13 20:44:03 -04:00
Brian Picciano
8ff2abf02c
mcfg: implement Sources
2018-08-13 20:15:54 -04:00
Brian Picciano
be17ee942a
mcfg: simplify populateParams
2018-08-13 20:05:22 -04:00
Brian Picciano
2e9790451f
mcfg: implement SourceEnv, and move a bunch of code it shares with SourceCLI to source(_test).go
2018-08-13 19:40:41 -04:00
Brian Picciano
8084268bbf
mcfg: shuffle some code around so there's a common way of retrieving all ParamValues out of a Cfg
2018-08-13 18:44:46 -04:00
Brian Picciano
715b6c9491
mchk: move mtest.Checker to mtest/mchk, and refactor its types a little bit
2018-08-13 15:03:30 -04:00
Brian Picciano
1964add0ed
mcfg: refactor cli test to use mtest.Checker
2018-08-13 14:17:53 -04:00
Brian Picciano
7861cf148e
mcfg: always lowercase param and child names
2018-08-13 11:50:57 -04:00
Brian Picciano
196df2b739
mcfg: add ParamJSON and fix required params error message
2018-08-09 18:05:04 -06:00
Brian Picciano
1be0072701
mtest->mrand: move rand functionality from mtest into its own package
2018-07-03 00:20:00 +00:00
Brian Picciano
7db5197a1e
mcfg: add some helper methods to Cfg related to its Path
2018-05-28 03:10:57 +00:00
Brian Picciano
4e0d440d09
mcfg: refactor slightly to separate Run into StartRun and StopRun
2018-05-28 02:39:56 +00:00
Brian Picciano
c5c11dc067
mcfg: make Child set its hooks to happen _then_, not recursively/concurrently during the parents', otherwise you can't effect a child's behavior with parent configs (e.g. changing the handler being passed into an http server)
2018-05-27 07:58:51 +00:00
Brian Picciano
0feba17791
give mcfg.Cfg a TestRun method which can be used during tests
2018-02-15 22:46:32 +00:00
Brian Picciano
3d43caba18
implement mcfg package, which includes both configuration, runtime setup, and organizing both into heirarchies
2018-02-14 18:24:54 +00:00