Commit Graph

201 Commits

Author SHA1 Message Date
Brian Picciano
f4ad383c4a m: have log level depend on the kind of Context is being used (process or service) 2019-04-06 16:30:55 -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
7752b569c3 m: add ProcessContext and rework where configuration comes from a bit 2019-04-02 23:35:45 -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
2496b170d8 mtest/massert: ensure that values being asserted are captured at the moment the assertion is made 2019-03-09 12:14:00 -05:00
Brian Picciano
2343bda42a m: add log message in Start once the start hooks have finished 2019-03-03 15:35:49 -05:00
Brian Picciano
3d939a1e80 mrun: fix bug in retrieving set of hooks/children from a context, and simplify the logic a bit 2019-03-03 15:34:44 -05:00
Brian Picciano
015edcd69a mnet: fix PacketConn closing 2019-03-01 14:37:41 -05:00
Brian Picciano
a52230b972 mnet: fix PacketConn support again 2019-03-01 14:36:16 -05:00
Brian Picciano
5bd3bf1d6d mnet: fix PacketConn support 2019-03-01 14:21:43 -05:00
Brian Picciano
14de888300 mnet: use ListenerOpts pattern 2019-03-01 14:06:25 -05: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
4303da03cc merr/mctx: move stack code into merr 2019-02-27 12:18:56 -05:00
Brian Picciano
553a4854ea mrun: change WithThread to WithThreads 2019-02-24 17:38:05 -05:00
Brian Picciano
dc57aadb54 m: don't log before populating params 2019-02-24 17:25:53 -05:00
Brian Picciano
dd7bc43cf8 m: rename Start to StartWaitStop, Start is a different function which only populates config and runs start hooks 2019-02-24 17:23:38 -05:00
Brian Picciano
3aa69c5878 mdb/msql: add SQL.Context method 2019-02-24 17:07:35 -05:00
Brian Picciano
604da54903 mdb/msql: implement basic MySQL connector 2019-02-24 16:30:53 -05:00
Brian Picciano
12bddbf108 add go.mod file to the project 2019-02-24 15:48:36 -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
000a57689d mctx: implement beginnings of Annotations functionality 2019-02-08 18:44:20 -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
0c2c49501e mctx: refactor implementation of Context to not use a state stored as a value, but to just wrap a context.Context 2019-02-03 19:25:46 -05:00
Brian Picciano
5dc8d92987 mdb/mpubsub: refactor to use new mctx/mlog/mcfg stuff 2019-02-03 16:05:46 -05:00
Brian Picciano
8ddf1348db mdb/mdatastore: refactor to use new mctx/mlog/mcfg stuff 2019-02-03 16:05:33 -05:00
Brian Picciano
40794d83b8 mdb/mbigtable: refactor to use new mctx/mlog/merr stuff 2019-02-02 21:57:11 -05:00
Brian Picciano
a5446b0833 mdb/mbigquery: refactor to use new mctx/mlog/merr stuff 2019-02-02 21:56:54 -05:00
Brian Picciano
608eb90274 mdb: refactor to use new mctx stuff 2019-02-02 21:56:32 -05:00
Brian Picciano
f783b62f6f mtest: implement NewCtx and Run, and use them in mnet and mhttp's tests 2019-02-02 20:58:18 -05:00
Brian Picciano
c6e29715b0 merr: implement WithKV 2019-02-02 20:18:39 -05:00
Brian Picciano
526639041b mnet: make sure listen-addr param's usage starts with uppercase 2019-02-02 19:55:42 -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
6adfbdbcfb m: implement NewServiceCtx, use it in totp-proxy 2019-02-02 19:27:28 -05:00
Brian Picciano
15b84cb173 mlog: implement LevelFromString 2019-02-02 19:27:10 -05:00
Brian Picciano
20c6f95091 mlog: refactor to use Clone/Set instead of With pattern, implement CtxSetAll 2019-01-30 16:06:24 -05:00
Brian Picciano
5bd0790f6e mctx: implement BreadthFirstVisit 2019-01-30 16:04:58 -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
ddd26259b2 merr: make New take in optional key/value pairs for convenience 2019-01-25 17:32:53 -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
a24262f295 mlog: update function docs 2019-01-25 16:39:57 -05:00
Brian Picciano
e9416dbe2a mlog: update package doc example 2019-01-25 16:29:22 -05:00
Brian Picciano
79bf3d6f89 totp-proxy: update to use new mctx/mcfg/mrun framework 2019-01-24 22:05:17 -05:00
Brian Picciano
a00a268256 m: implement Run function, which glues together mcfg.Populate, mrun.Start, and mrun.Stop 2019-01-24 22:04:58 -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