imp

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvVarMasterPublicKey = "BIFROEST_MASTER_PUBLIC_KEY"

	DefaultInitPathUnix    = `/var/lib/engity/bifroest/init`
	DefaultInitPathWindows = `C:\ProgramData\Engity\Bifroest\init`
)
View Source
const (
	DefaultInitPath = DefaultInitPathUnix
)
View Source
const (
	ServicePort = 8683
)

Variables

View Source
var (
	ErrNoSuchProcess = protocol.ErrNoSuchProcess
)

Functions

This section is empty.

Types

type Imp

type Imp interface {
	io.Closer
	Open(context.Context, Ref) (Session, error)
	GetMasterPublicKey() (crypto.PublicKey, error)
}

func NewImp

func NewImp(ctx context.Context, bifroestPrivateKey crypto.PrivateKey) (Imp, error)

type Ref

type Ref interface {
	SessionId() session.Id
	PublicKey() crypto.PublicKey
	Dial(context.Context) (gonet.Conn, error)
}

type Service

type Service struct {
	Version                    sys.Version
	ExitCodeByConnectionIdPath string
	Addr                       string
	MasterPublicKey            crypto.PublicKey
	SessionId                  session.Id

	Logger log.Logger
}

func (*Service) Serve

func (this *Service) Serve(ctx context.Context) error

type Session

type Session interface {
	io.Closer
	Ping(ctx context.Context, connectionId connection.Id) error
	InitiateTcpForward(ctx context.Context, connectionId connection.Id, target net.HostPort) (gonet.Conn, error)
	InitiateNamedPipe(ctx context.Context, connectionId connection.Id, purpose net.Purpose) (net.NamedPipe, error)

	// GetConnectionExitCode will return either the exitCode (if found)
	// or [connection.ErrNotFound] if the corresponding connection can't be found.
	GetConnectionExitCode(ctx context.Context, connectionId connection.Id) (int, error)

	// Kill will try to kill the process with the given signal.
	// If pid is 0, the process will be resolved by its connection.EnvVar that is matching the provided
	// connectionId.
	Kill(ctx context.Context, connectionId connection.Id, pid int, signal sys.Signal) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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