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

Unified 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, 1 month 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: common/eventlog/settings.go
diff --git a/common/eventlog/settings.go b/common/eventlog/settings.go
new file mode 100644
index 0000000000000000000000000000000000000000..d73e4c6bf6685f385561f89d1f8437cca554fa75
--- /dev/null
+++ b/common/eventlog/settings.go
@@ -0,0 +1,32 @@
+// Copyright 2016 The LUCI Authors. All rights reserved.
+// Use of this source code is governed under the Apache License, Version 2.0
+// that can be found in the LICENSE file.
+
+package eventlog
+
+import "net/http"
+
+// A ClientOption is an optional argument to NewClient.
+type ClientOption interface {
+ apply(*clientSettings)
+}
+
+type clientSettings struct {
+ HTTPClient *http.Client
+}
+
+func (cs *clientSettings) Populate(opts []ClientOption) {
+}
+
+type httpClientOption struct {
+ *http.Client
+}
+
+func (opt httpClientOption) apply(cs *clientSettings) {
+ cs.HTTPClient = opt.Client
+}
+
+// WithHTTPClient returns a ClientOption that specifies the HTTP client to use as the basis of communications.
+func WithHTTPClient(client *http.Client) ClientOption {
+ return httpClientOption{client}
+}
« 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