client

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type SailClient

type SailClient struct {
	// contains filtered or unexported fields
}

func ProvideSailClient

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

func (*SailClient) Connect

func (s *SailClient) Connect(ctx context.Context, st store.RStore) error

func (*SailClient) OnChange

func (s *SailClient) OnChange(ctx context.Context, st store.RStore)

func (*SailClient) Teardown

func (s *SailClient) Teardown(ctx context.Context)

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) (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