Граф коммитов

661 Коммитов

Автор SHA1 Сообщение Дата
Adam Ryman a92b46447b Update middlewares documentation 2016-12-22 15:01:20 -08:00
Adam Ryman 155ede00a1 Update WrapAll endpoints to wrap in the order passed 2016-12-22 14:49:51 -08:00
Adam Ryman cfdbde3734 Move WrapAll functionality to generated code to remove ambiguity
With the WrapAll function now in the generated code we can have only one
exposed function to the truss user. `WrapEndpoints`

Then within this function they pass middlewares they want applied to all
endpoints to `in.WrapAll()`.

This removes our standstill on the names for the previous functions.
2016-12-22 02:53:09 -08:00
Leland Batey 6a5285aec7 Merge pull request #122 from hasLeland/shutdown-hook
Add hook for controlling shutdown in truss
2016-12-20 21:33:14 -08:00
Ian Molee b341b59948 Merge branch 'master' into granular_endpoint_middlewares 2016-12-20 18:30:27 -08:00
Leland Batey ff2ad82bd2 Add hook for controlling shutdown in truss 2016-12-20 16:18:30 -08:00
Leland Batey c248479dbc Merge pull request #120 from hasLeland/service-name-proposal
Implement service folder name change proposal #106
2016-12-20 15:18:08 -08:00
Leland Batey 3161f2d53d Clarify comments, add parsesvcname tests 2016-12-20 15:09:40 -08:00
Leland Batey 0e83330afc Remove old parsepkgname package 2016-12-19 18:15:21 -08:00
Leland Batey 7d15acfa62 Update all integration tests to svcname convention 2016-12-19 18:13:24 -08:00
Leland Batey 685a25b03f Migrate cli integration tests to svcname convention 2016-12-19 18:00:08 -08:00
Leland Batey 86968f8cb5 Migrate all components to new svcname convention 2016-12-19 17:54:55 -08:00
Leland Batey 92e523bb18 Substitute parsesvcname for parsepkgname 2016-12-19 17:14:54 -08:00
Leland Batey 43e814950b Add parsesvcname package for getting service name 2016-12-19 17:06:30 -08:00
Leland Batey 56ab033558 Merge pull request #118 from hasLeland/issue107-opaque-errors
Slightly improved error messages
2016-12-19 13:40:28 -08:00
Leland Batey 14683d35de Add suggestion to error message 2016-12-16 17:37:09 -08:00
Leland Batey a6148a3a52 Merge pull request #119 from hasLeland/update-genproto
Fix all references to broken google genproto locations
2016-12-16 17:23:49 -08:00
Leland Batey 875db65c13 Move everything to the new genproto location 2016-12-16 17:20:53 -08:00
Leland Batey 0157d43ed0 Add debugging info to svcdef errors 2016-12-16 15:24:29 -08:00
Ian Molee d0124ce367 Add additional endpoint middleware wrapping function
As it was, InjectEndpointMiddlewares was called for every endpoint on
the defined service. This is fine so long as you want these middlewares
applied to every single endpoint. This breaks down, though, when your
middleware desires are heterogeneous, like, for example, protecting
some endpoints from free access by enforcing some sort of authentication
and authorization, while allowing other endpoints to be freely
accessible (e.g., login, service status, ping).

This change introduces another function into the endpoint middlewares
template, which takes the entire set of endpoints as defined for the
service and returns another set of endpoints. This way, the programmer
has the flexibility wrap different endpoints differently.

This is how service middlewares work, since the middleware wrapping
function takes a service interface, and returns a service interface, but
we should not force a programmer to use Service middlewares if a
middleware would more appropriately be an endpoint middleware.

Additionally, the naming of the middleware application functions has
been changed from using the verb "inject" to the verb "wrap," which
makes more sense in the context of middlewares, which wrap a deeper
functionality.
2016-12-15 02:08:32 -08:00
Ian Molee 9caedc7a4f Merge branch 'master' of github.com:TuneLab/go-truss 2016-12-12 15:09:23 -08:00
Adam Ryman db9770283d Merge pull request #116 from hasAdamr/put-comment-back
Put comment back lost in pull #78
2016-12-12 12:38:07 -08:00
Adam Ryman 4f210d57b8 Put comment back lost in pull #78 2016-12-11 17:21:06 -08:00
Adam Ryman 580b3b6254 Merge pull request #115 from hasAdamr/fix-vendor-test
Fix vendor.json so that vendored tests are ignored
2016-12-10 07:00:28 -08:00
Adam Ryman 824bcba05f Fix vendor.json so that vendored tests are ignored
In a previous pull vendored tests got committed. This is because our ignore in
vendor.json was comma seperated, not space seperated like govendor expected.

This fixes that and removes the vendored tests.
2016-12-09 20:07:34 -08:00
Adam Ryman e840f522ea Merge pull request #114 from hasAdamr/move-flag-parse
Move flag Parse to main so flags can be defined by packages
2016-12-09 19:02:40 -08:00
Adam Ryman 0ec11f7491 Move flag Parse to main so flags can be defined by packages
If flag.Parse is called in main than the init function of imported packages can
define flags that will be picked up by the truss binary.

See this comment in the flags package.
https://golang.org/src/flag/example_test.go?s=2478:2520#L79
2016-12-09 18:55:34 -08:00
Adam Ryman 1e3077ba2b Merge pull request #113 from hasAdamr/pflag
Update truss cmd to pflag for POSIX flags
2016-12-09 16:52:30 -08:00
Adam Ryman d34cf1b5b0 Vendor pflag 2016-12-09 16:15:52 -08:00
Adam Ryman d3420abd18 Update truss cmd to pflag for POSIX flags 2016-12-09 16:15:34 -08:00
Ian Molee ec37df44ae Merge pull request #112 from hasIan/misc_cleanup
Small miscellaneous cleanup
2016-12-07 20:42:37 -05:00
Ian Molee f610ad57bb Update go-bindata-generated template.go 2016-12-07 17:08:42 -08:00
Ian Molee 3a22cd7a6e Update usage method; run goimports 2016-12-07 17:08:36 -08:00
Ian Molee b51f3c5f72 Update go-bindata-generated template.go 2016-12-07 16:29:23 -08:00
Ian Molee 616f35211a Update usage method; run goimports 2016-12-07 16:15:31 -08:00
Ian Molee 5cecfb2704 Merge pull request #110 from hasIan/add_version_tag
Add SHA and build date metadata to Truss binary
2016-12-07 18:07:41 -05:00
tuneliza e252012584 Merge pull request #111 from tuneliza/userdocs
Userdocs
2016-12-06 22:52:09 -08:00
Ian Molee 6c30ad79f8 Merge branch 'master' of github.com:TuneLab/go-truss into add_version_tag 2016-12-06 17:08:43 -08:00
Ian Molee 65d8067632 Simplify some minor items in main
More succinct usage message; capture binary name in variable to avoid
repeated calls to wordy filepath.Basename(os.Args[0]).
2016-12-06 17:00:55 -08:00
tuneliza 184778fc5a minor corrective edit 2016-12-06 15:54:35 -08:00
tuneliza 4a1b16228c finish getting-started tutorial (no middlewares, need more) 2016-12-06 15:49:07 -08:00
Zaq? Wiedmann 9865c0d880 Merge pull request #108 from zaquestion/brevity_readme
Brevity in readme and update make dependencies target
2016-12-06 15:44:05 -08:00
Zaq? Wiedmann cc37083739 Brevity in readme and update make dependencies target 2016-12-06 15:31:32 -08:00
Ian Molee 88aaa04bac Simplify building of metadata string 2016-12-06 15:27:21 -08:00
Ian Molee 9f6da34c52 Merge branch 'master' of github.com:TuneLab/go-truss into add_version_tag 2016-12-06 14:47:00 -08:00
Adam Ryman 375fce470a Merge pull request #109 from hasAdamr/verbose
Add flag for verbose output with strack traces for errors
2016-12-06 14:25:00 -08:00
Ian Molee 62f22cecba Add SHA and build date to Truss binary when built with Makefile
With Truss as an ever-moving target, it may be useful to know what
version you are running. This change will embed the Git SHA and the
build date into the Truss binary, if Truss is built with the Makefile.
If the SHA or build date are set in the binary, it will be displayed in
the usage message. If no SHA or build date are set, no banner will be
displayed.

Note that the Makefile is not used when fetching with `go get` or
building a fetched source repo with `go install`, so binaries built like
this will not have the SHA and build metadata embedded.
2016-12-06 12:22:06 -08:00
Adam Ryman 5e81044af1 Add flag for verbose output with strack traces for errors 2016-12-06 12:11:51 -08:00
Adam Ryman 69bffd93db Merge pull request #103 from hasAdamr/remove-truss-namedreadwriter
Refactor to remove truss.NamedReadWriter complexity
2016-12-06 10:53:22 -08:00
Adam Ryman 7ca3d227de Remove simpleFileConstructor 2016-12-05 17:08:29 -08:00