daemon

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 18, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostState

type HostState struct {
	UserState
	// contains filtered or unexported fields
}

HostState represents the state of the host, in particular the host session, along with its UserState.

func (*HostState) User

func (h *HostState) User(
	ctx context.Context,
) warp.User

User returns a warp.User from the current HostState.

type Session

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

Session represents a client session connected to the warp.

func NewSession

func NewSession(
	ctx context.Context,
	cancel func(),
	conn net.Conn,
) (*Session, error)

NewSession sets up a session, opens the associated channels and return a Session object.

func (*Session) SendError

func (ss *Session) SendError(
	ctx context.Context,
	code string,
	message string,
)

SendError sends an error to the client which should trigger a disconnection on its end.

func (*Session) SendInternalError

func (ss *Session) SendInternalError(
	ctx context.Context,
)

SendInternalError sends an internal error to the client which should trigger a disconnection on its end.

func (*Session) TearDown

func (ss *Session) TearDown()

TearDown tears down a session, closing and reclaiming channels.

func (*Session) ToString

func (ss *Session) ToString() string

ToStering returns a string that identifies the session for logging.

type Srv

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

Srv represents a running warpd server.

func NewSrv

func NewSrv(
	ctx context.Context,
	address string,
	certFile string,
	keyFile string,
) *Srv

NewSrv constructs a Srv ready to start serving requests.

func (*Srv) Run

func (s *Srv) Run(
	ctx context.Context,
) error

Run starts the server.

type UserState

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

UserState represents the state of a user along with a list of all his sessions.

func (*UserState) User

func (u *UserState) User(
	ctx context.Context,
) warp.User

User returns a warp.User from the current UserState.

type Warp

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

Warp represents a pty served from a remote host attached to a token.

func (*Warp) CientSessions

func (w *Warp) CientSessions(
	ctx context.Context,
) []*Session

CientSessions return all connected sessions that are not the host session.

func (*Warp) State

func (w *Warp) State(
	ctx context.Context,
) warp.State

State computes a warp.State from the current warp. It acquires the warp lock.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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