• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

yarpc / yarpc-go / 1881
81%
master: %

Build:
Build:
LAST BUILD BRANCH: nooptrace
DEFAULT BRANCH: master
Ran 06 Oct 2016 05:24PM UTC
Jobs 2
Files 95
Run time 53s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
1881

push

travis-ci

web-flow
yarpc.InjectClients: automatic client injection (#371)

This implements `yarpc.InjectClients` which provides a mechanism to
automatically fill clients into structs from a Dispatcher.

```go
type myHandler struct {
    Cache cacheclient.Interface `service:"memcached"`
}

var handler myHandler
yarpc.InjectClients(dispatcher, &handler)

// Is equivalent to

handler = myHandler{
    Cache: cacheclient.New(dispatcher.Channel("memcached")),
}
```

A global map of types and their constructors is maintained and reflection is
used to fill the target struct with clients. `{json, raw}.Client`s are
registered into that map by default and generated Thrift clients register
themselves into the map in `init()`.

Note that as suggested in the original issue, this DOES NOT recursively walk
the object tree, and only updates the fields in the top-level object. This
makes this feature less surprising and drops any concerns around
instantiating/modifying user-owned objects.

Resolves #330

4321 of 4662 relevant lines covered (92.69%)

1.96 hits per line

Jobs
ID Job ID Ran Files Coverage
3 1881.3 (TYPE=test) 06 Oct 2016 05:24PM UTC 0
92.69
Travis Job 1881.3
4 1881.4 (TYPE=test) 06 Oct 2016 05:24PM UTC 0
92.69
Travis Job 1881.4
Source Files on build 1881
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #1881
  • 3a201e8b on github
  • Prev Build on dev (#1860)
  • Next Build on dev (#1892)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc