Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(375)

Side by Side Diff: common/eventlog/settings.go

Issue 2517503002: luci-go: Basic support for event logging in Go. (Closed)
Patch Set: Add helpers for generating TypedTime Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « common/eventlog/proto/log_request_lite.pb.go ('k') | examples/eventlog/main.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file.
4
5 package eventlog
6
7 import "net/http"
8
9 // A ClientOption is an optional argument to NewClient.
10 type ClientOption interface {
11 apply(*clientSettings)
12 }
13
14 type clientSettings struct {
15 HTTPClient *http.Client
16 }
17
18 func (cs *clientSettings) Populate(opts []ClientOption) {
19 }
20
21 type httpClientOption struct {
22 *http.Client
23 }
24
25 func (opt httpClientOption) apply(cs *clientSettings) {
26 cs.HTTPClient = opt.Client
27 }
28
29 // WithHTTPClient returns a ClientOption that specifies the HTTP client to use a s the basis of communications.
30 func WithHTTPClient(client *http.Client) ClientOption {
31 return httpClientOption{client}
32 }
OLDNEW
« no previous file with comments | « common/eventlog/proto/log_request_lite.pb.go ('k') | examples/eventlog/main.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698