| Index: logdog/client/butler/streamserver/localclient/local.go
|
| diff --git a/logdog/client/butlerlib/streamclient/local.go b/logdog/client/butler/streamserver/localclient/local.go
|
| similarity index 70%
|
| rename from logdog/client/butlerlib/streamclient/local.go
|
| rename to logdog/client/butler/streamserver/localclient/local.go
|
| index cbfda96251f90de577c8fcbde44b460390bb2b5f..481e2bafd736db8ac9d0c88be3dc4d4d00cd17c6 100644
|
| --- a/logdog/client/butlerlib/streamclient/local.go
|
| +++ b/logdog/client/butler/streamserver/localclient/local.go
|
| @@ -2,12 +2,13 @@
|
| // Use of this source code is governed under the Apache License, Version 2.0
|
| // that can be found in the LICENSE file.
|
|
|
| -package streamclient
|
| +package localclient
|
|
|
| import (
|
| "io"
|
|
|
| "github.com/luci/luci-go/logdog/client/butler"
|
| + "github.com/luci/luci-go/logdog/client/butlerlib/streamclient"
|
| "github.com/luci/luci-go/logdog/client/butlerlib/streamproto"
|
| )
|
|
|
| @@ -17,17 +18,19 @@ type localClient struct {
|
| *butler.Butler
|
| }
|
|
|
| -// NewLocal creates a new Client instance bound to a local Butler instance. This
|
| +var _ streamclient.Client = (*localClient)(nil)
|
| +
|
| +// New creates a new Client instance bound to a local Butler instance. This
|
| // sidesteps the need for an actual server socket and negotiation protocol and
|
| // directly registers streams via Butler API calls.
|
| //
|
| // Internally, the Stream uses an io.PipeWriter and io.PipeReader to ferry
|
| // data from the Stream's owner to the Butler.
|
| -func NewLocal(b *butler.Butler) Client {
|
| +func New(b *butler.Butler) streamclient.Client {
|
| return &localClient{b}
|
| }
|
|
|
| -func (c *localClient) NewStream(f streamproto.Flags) (s Stream, err error) {
|
| +func (c *localClient) NewStream(f streamproto.Flags) (s streamclient.Stream, err error) {
|
| pr, pw := io.Pipe()
|
| defer func() {
|
| if err != nil {
|
| @@ -37,9 +40,9 @@ func (c *localClient) NewStream(f streamproto.Flags) (s Stream, err error) {
|
| }()
|
|
|
| props := f.Properties()
|
| - stream := streamImpl{
|
| + stream := streamclient.BaseStream{
|
| WriteCloser: pw,
|
| - props: props,
|
| + P: props,
|
| }
|
|
|
| // Add the Stream to the Butler.
|
|
|