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

yarpc / yarpc-go / 3506
85%
master: %

Build:
Build:
LAST BUILD BRANCH: nooptrace
DEFAULT BRANCH: master
Ran 23 Dec 2016 01:33AM UTC
Jobs 2
Files 120
Run time 37s
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
3506

push

travis-ci

abhinav
Add CallOption for call-site options

This adds a `CallOption` type and a bunch of constructors for it in the
`yarpc` package. Call options affect per-call options for a request at the
call site.

Client implementations in encodings will apply call options to a call and use
that to hydrate a `transport.Request`. For example, consider,

```
func Call(
    ctx context.Context,
    reqBody MyRequest,
    opts ...yarpc.CallOption,
) (resBody MyResponse, error) {
    // ...
}
```

Where `MyRequest` and `MyResponse` are encoding-specific representations of
request and response bodies. The implementation will simply do,

```
var call yarpc.Call
yarpc.ApplyCallOptions(&call, opts...)

req := transport.Request{
    // Fill with client-level information
    Caller: ...,
    Service: ...,
    // And the encoded request body
    Body: serialize(reqBody),
}
call.WriteToRequest(ctx, &req) // apply options

// Call the outbound
res, err := outbound.Call(ctx, req)
if err != nil {
    // ..
}

call.ReadFromResponse(ctx, res)
```

5752 of 6716 relevant lines covered (85.65%)

1.81 hits per line

Jobs
ID Job ID Ran Files Coverage
3 3506.3 (TYPE=test) 23 Dec 2016 01:33AM UTC 0
85.65
Travis Job 3506.3
4 3506.4 (TYPE=test) 23 Dec 2016 01:33AM UTC 0
85.65
Travis Job 3506.4
Source Files on build 3506
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #3506
  • 3a46c388 on github
  • Next Build on rm-meta (#3525)
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