livesharetest

package
v2.0.0-...-98537dd Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const SSHPublicKey = `` /* 204-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type RPCHandleFunc

type RPCHandleFunc func(conn *jsonrpc2.Conn, req *jsonrpc2.Request) (interface{}, error)

type Server

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

Server represents a LiveShare relay host server.

func NewServer

func NewServer(opts ...ServerOption) (*Server, error)

NewServer creates a new Server. ServerOptions can be passed to configure the SSH password, backing service, secrets and more.

func (*Server) Close

func (s *Server) Close()

Close closes the underlying httptest Server.

func (*Server) Err

func (s *Server) Err() <-chan error

func (*Server) URL

func (s *Server) URL() string

URL returns the httptest Server url.

type ServerOption

type ServerOption func(*Server) error

ServerOption is used to configure the Server.

func WithNonSecure

func WithNonSecure() ServerOption

WithNonSecure configures the Server as non-secure.

func WithPassword

func WithPassword(password string) ServerOption

WithPassword configures the Server password for SSH.

func WithRelaySAS

func WithRelaySAS(sas string) ServerOption

WithRelaySAS configures the relay SAS configuration key.

func WithService

func WithService(serviceName string, handler RPCHandleFunc) ServerOption

WithService accepts a mock RPC service for the Server to invoke.

func WithStream

func WithStream(name string, stream io.ReadWriter) ServerOption

WithStream allows you to specify a mock data stream for the server.

Jump to

Keyboard shortcuts

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