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

Side by Side Diff: logdog/client/butlerlib/streamclient/client_namedPipe_windows.go

Issue 2456953003: LogDog: Update client/bootstrap to generate URLs. (Closed)
Patch Set: Winders 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package streamclient 5 package streamclient
6 6
7 import ( 7 import (
8 "errors" 8 "errors"
9 "fmt" 9 "fmt"
10 "io" 10 "io"
11 11
12 npipe "gopkg.in/natefinch/npipe.v2" 12 npipe "gopkg.in/natefinch/npipe.v2"
13 ) 13 )
14 14
15 // Register POSIX-only protocols. 15 // Register POSIX-only protocols.
16 func init() { 16 func init() {
17 registerProtocol("net.pipe", newNamedPipeClient) 17 registerProtocol("net.pipe", newNamedPipeClient)
18 } 18 }
19 19
20 // newNamedPipeClient creates a new Client instance bound to a named pipe stream 20 // newNamedPipeClient creates a new Client instance bound to a named pipe stream
21 // server. 21 // server.
22 func newNamedPipeClient(path string) (Client, error) { 22 func newNamedPipeClient(path string) (Client, error) {
23 if path == "" { 23 if path == "" {
24 return nil, errors.New("streamclient: cannot have empty named pi pe path") 24 return nil, errors.New("streamclient: cannot have empty named pi pe path")
25 } 25 }
26 26
27 » return &clientImpl{func() (io.WriteCloser, error) { 27 » return &clientImpl{
28 » » return npipe.Dial(fmt.Sprintf(`\\.\pipe\%s`, path)) 28 » » factory: func() (io.WriteCloser, error) {
29 » }}, nil 29 » » » return npipe.Dial(fmt.Sprintf(`\\.\pipe\%s`, path))
30 » » },
31 » }, nil
30 } 32 }
OLDNEW
« no previous file with comments | « logdog/client/butlerlib/streamclient/client_namedPipe_posix.go ('k') | logdog/client/butlerlib/streamclient/client_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698