client

package
v0.10.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func ProvideSailClient

func ProvideSailClient(addr model.SailURL, roomer SailRoomer, dialer SailDialer) *sailClient

Types

type FakeSailClient added in v0.8.2

type FakeSailClient struct {
	ConnectCalls int
}

func NewFakeSailClient added in v0.8.2

func NewFakeSailClient() *FakeSailClient

func (*FakeSailClient) Connect added in v0.8.2

func (c *FakeSailClient) Connect(ctx context.Context, st store.RStore) error

func (*FakeSailClient) OnChange added in v0.8.2

func (c *FakeSailClient) OnChange(ctx context.Context, st store.RStore)

func (*FakeSailClient) SetUp added in v0.8.2

func (c *FakeSailClient) SetUp(ctx context.Context)

func (*FakeSailClient) TearDown added in v0.8.2

func (c *FakeSailClient) TearDown(ctx context.Context)

type SailClient

type SailClient interface {
	store.Subscriber
	store.SubscriberLifecycle

	Connect(ctx context.Context, st store.RStore) error
}

type SailConn

type SailConn interface {
	WriteJSON(v interface{}) error
	NextReader() (int, io.Reader, error)
	Close() error
}

type SailDialer

type SailDialer interface {
	DialContext(ctx context.Context, addr string, headers http.Header) (SailConn, error)
}

Helpers for stubbing out the network connection in sailClient

func ProvideSailDialer

func ProvideSailDialer() SailDialer

type SailRoomConnectedAction added in v0.8.1

type SailRoomConnectedAction struct {
	ViewURL string // URL to view the Sail room
	Err     error
}

func (SailRoomConnectedAction) Action added in v0.8.1

func (SailRoomConnectedAction) Action()

type SailRoomer added in v0.8.1

type SailRoomer interface {
	NewRoom(ctx context.Context, version model.WebVersion) (roomID model.RoomID, secret string, err error)
}

For injecting room creation logic (because the real way involves an HTTP request)

func ProvideSailRoomer added in v0.8.1

func ProvideSailRoomer(addr model.SailURL) SailRoomer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL