base

package
v0.0.0-...-1234919 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: Apache-2.0 Imports: 12 Imported by: 6

Documentation

Index

Constants

View Source
const (
	ProcessType_Unknown         = "unknown"
	ProcessType_WaveSrv         = "wavesrv"
	ProcessType_WaveShellSingle = "wsh-1"
	ProcessType_WaveShellServer = "wsh-s"
)
View Source
const DebugFlag_LogRcFile = "logrc"
View Source
const DebugRcFileName = "debug.rcfile"
View Source
const DebugReturnStateFileName = "debug.returnstate"
View Source
const DefaultWaveshellHome = "~/.mshell"
View Source
const DefaultWaveshellInstallBinDir = "/opt/mshell/bin"
View Source
const DefaultWaveshellName = "mshell"
View Source
const ForceDebugLog = false
View Source
const HomeVarName = "HOME"
View Source
const LogFileName = "mshell.log"
View Source
const RcFilesDirBaseName = "rcfiles"
View Source
const RemoteIdFile = "remoteid"
View Source
const SSHCommandVarName = "SSH_COMMAND"
View Source
const SessionsDirBaseName = "sessions"
View Source
const WaveshellDebugVarName = "MSHELL_DEBUG"
View Source
const WaveshellHomeVarName = "MSHELL_HOME"
View Source
const WaveshellInstallBinVarName = "MSHELL_INSTALLBIN_PATH"
View Source
const WaveshellPathVarName = "MSHELL_PATH"
View Source
const WaveshellVersion = "v0.7.0"

Variables

View Source
var BuildTime string = "0"
View Source
var DebugLogEnabled = false
View Source
var DebugLogger *log.Logger

Functions

func BoundInt

func BoundInt(ival int, minVal int, maxVal int) int

func BoundInt64

func BoundInt64(ival int64, minVal int64, maxVal int64) int64

func CacheEnsureDir

func CacheEnsureDir(dirName string, cacheKey string, perm os.FileMode, dirDesc string) error

func EnsureRcFilesDir

func EnsureRcFilesDir() (string, error)

func ExpandHomeDir

func ExpandHomeDir(pathStr string) string

func GetDebugRcFileName

func GetDebugRcFileName() string

func GetDebugReturnStateFileName

func GetDebugReturnStateFileName() string

func GetErrorCode

func GetErrorCode(err error) string

func GetHomeDir

func GetHomeDir() string

func GetRemoteId

func GetRemoteId() (string, error)

func GetWaveshellHomeDir

func GetWaveshellHomeDir() string

func GetWaveshellPath

func GetWaveshellPath() (string, error)

func GoArchOptFile

func GoArchOptFile(version string, goos string, goarch string) string

func HasDebugFlag

func HasDebugFlag(envMap map[string]string, flagName string) bool

func InitDebugLog

func InitDebugLog(prefix string)

func IsOption

func IsOption(argStr string) bool

func IsWaveSrv

func IsWaveSrv() bool

func Logf

func Logf(fmtStr string, args ...interface{})

func SetBuildTime

func SetBuildTime(build string)

func SetEnableDebugLog

func SetEnableDebugLog(enable bool)

func TryMkdirs

func TryMkdirs(dirName string, perm os.FileMode, dirDesc string) error

func ValidGoArch

func ValidGoArch(goos string, goarch string) bool

Types

type CodedError

type CodedError struct {
	ErrorCode string
	Err       error
}

func CodedErrorf

func CodedErrorf(code string, format string, args ...interface{}) *CodedError

func MakeCodedError

func MakeCodedError(code string, err error) *CodedError

func (*CodedError) Error

func (c *CodedError) Error() string

func (*CodedError) Unwrap

func (c *CodedError) Unwrap() error

type CommandFileNames

type CommandFileNames struct {
	PtyOutFile    string
	StdinFifo     string
	RunnerOutFile string
}

type CommandKey

type CommandKey string

func MakeCommandKey

func MakeCommandKey(screenId string, lineId string) CommandKey

func (CommandKey) GetCmdId

func (ckey CommandKey) GetCmdId() string

func (CommandKey) GetGroupId

func (ckey CommandKey) GetGroupId() string

func (CommandKey) GetSessionId

func (ckey CommandKey) GetSessionId() string

deprecated (use GetGroupId instead)

func (CommandKey) IsEmpty

func (ckey CommandKey) IsEmpty() bool

func (CommandKey) Split

func (ckey CommandKey) Split() (string, string)

func (CommandKey) Validate

func (ckey CommandKey) Validate(typeStr string) error

type OptsIter

type OptsIter struct {
	Pos  int
	Opts []string
}

func MakeOptsIter

func MakeOptsIter(opts []string) *OptsIter

func (*OptsIter) Current

func (iter *OptsIter) Current() string

func (*OptsIter) HasNext

func (iter *OptsIter) HasNext() bool

func (*OptsIter) IsNextPlain

func (iter *OptsIter) IsNextPlain() bool

func (*OptsIter) Next

func (iter *OptsIter) Next() string

func (*OptsIter) Rest

func (iter *OptsIter) Rest() []string

Jump to

Keyboard shortcuts

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