middleware

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTTPPort  = 5985
	HTTPSPort = 5986
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Middleware

type Middleware interface {
	Execute(cmd string) (string, string, error)
	Exit()
}

Middleware is the interface implemented by different session types

func NewSession

func NewSession(upstream Middleware, config *SessionConfig) (Middleware, error)

NewSession starts a PowerShell session (i.e. New-PSSession)

func NewUTF8

func NewUTF8(upstream Middleware) (Middleware, error)

type SessionConfig

type SessionConfig struct {
	ComputerName          string
	AllowRedirection      bool
	Authentication        string
	CertificateThumbprint string
	Credential            interface{}
	Port                  int
	UseSSL                bool
}

SessionConfig provides the properties for configuring a remote session

func NewSessionConfig

func NewSessionConfig() *SessionConfig

NewSessionConfig returns an empty SessionConfig

func (*SessionConfig) ToArgs

func (c *SessionConfig) ToArgs() []string

ToArgs emits the SessionConfig properties as a slice of arguments for the New-PSSession command

type UserPasswordCredential

type UserPasswordCredential struct {
	Username string
	Password string
}

UserPasswordCredential specifies credentials to connect to a remote computer

Jump to

Keyboard shortcuts

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