cmd

package
v0.0.0-...-18b9f3e Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2025 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CRLFChannel

func CRLFChannel(ch chan types.WebSocketMessage) chan types.WebSocketMessage

func CmdWebhook

func CmdWebhook(
	filestore filesystem.Store,
	sessionStore *types.SessionStore,
	apiKey chatbot.APIKey,
	jsonConn *jsonrpc2.Conn,
	mqttEvents *util.EventHandler[types.MQTTMessage],
	flux_cfg *influx.InfluxDBConfig,
	uazapi_cfg uazapi.UazapiConfig,
	email_cfg email.EmailConfig,
) gin.HandlerFunc

func InitCommands

func InitCommands(
	filestore filesystem.Store,
	fsctx filesystem.FSContext,
	socketSession *types.SocketSession,
	sessionStore *types.SessionStore,
	apiKey chatbot.APIKey,
	jsonConn *jsonrpc2.Conn,
	mqttEvents *util.EventHandler[types.MQTTMessage],
	flux_cfg *influx.InfluxDBConfig,
	uazapi_cfg uazapi.UazapiConfig,
	email_cfg email.EmailConfig,
) []sh.Command

func NormCRLF

func NormCRLF(s string) string

func ParseCommand

func ParseCommand(input string) ([]string, error)

ParseCommand splits a string into args with shell-like escaping rules

func RunClient

func RunClient(info types.ClientInfo, commands []sh.Command, filestore filesystem.Store, wg *sync.WaitGroup)

Types

type ChannelReader

type ChannelReader struct {
	Chan   chan string
	Buffer []byte
}

func (*ChannelReader) Read

func (c *ChannelReader) Read(p []byte) (n int, err error)

type ChannelWriter

type ChannelWriter chan string

func (ChannelWriter) Write

func (c ChannelWriter) Write(p []byte) (n int, err error)

type CmdActivate

type CmdActivate struct {
	APIKey    chatbot.APIKey
	Commands  []sh.Command
	FileStore filesystem.Store
}

func (*CmdActivate) Identifier

func (c *CmdActivate) Identifier() string

func (*CmdActivate) Run

func (c *CmdActivate) Run(ctx sh.CommandContext) int

type CmdB64

type CmdB64 struct{}

func (CmdB64) Identifier

func (CmdB64) Identifier() string

func (CmdB64) Run

func (CmdB64) Run(ctx sh.CommandContext) int

type CmdCat

type CmdCat struct {
	FSCtx filesystem.FSContext
}

func (*CmdCat) Identifier

func (*CmdCat) Identifier() string

func (*CmdCat) Run

func (c *CmdCat) Run(ctx sh.CommandContext) int

type CmdChangePassword

type CmdChangePassword struct {
	FileStore filesystem.Store
}

func (*CmdChangePassword) Identifier

func (c *CmdChangePassword) Identifier() string

func (*CmdChangePassword) Run

func (c *CmdChangePassword) Run(ctx sh.CommandContext) int

type CmdChmod

type CmdChmod struct {
	FileStore filesystem.Store
}

func (*CmdChmod) Identifier

func (c *CmdChmod) Identifier() string

func (*CmdChmod) Run

func (c *CmdChmod) Run(ctx sh.CommandContext) int

type CmdClients

type CmdClients struct {
	Socket *types.SocketSession
}

func (*CmdClients) Identifier

func (c *CmdClients) Identifier() string

func (*CmdClients) Run

func (c *CmdClients) Run(ctx sh.CommandContext) int

type CmdCopy

type CmdCopy struct {
	FileStore filesystem.Store
}

func (*CmdCopy) Identifier

func (c *CmdCopy) Identifier() string

func (*CmdCopy) Run

func (c *CmdCopy) Run(ctx sh.CommandContext) int

type CmdCryptoRand

type CmdCryptoRand struct{}

func (CmdCryptoRand) Identifier

func (CmdCryptoRand) Identifier() string

func (CmdCryptoRand) Run

type CmdEcho

type CmdEcho struct{}

func (CmdEcho) Identifier

func (CmdEcho) Identifier() string

func (CmdEcho) Run

func (CmdEcho) Run(ctx sh.CommandContext) int

type CmdEdgeNodes

type CmdEdgeNodes struct {
	FileStore filesystem.Store
}

func (*CmdEdgeNodes) Identifier

func (c *CmdEdgeNodes) Identifier() string

func (*CmdEdgeNodes) Run

func (c *CmdEdgeNodes) Run(ctx sh.CommandContext) int

type CmdEmail

type CmdEmail struct {
	EmailConfig email.EmailConfig
}

func (CmdEmail) Identifier

func (c CmdEmail) Identifier() string

func (CmdEmail) Run

func (c CmdEmail) Run(ctx sh.CommandContext) int

type CmdEmbed

type CmdEmbed struct {
	Conn      *jsonrpc2.Conn
	FileStore filesystem.Store
}

func (*CmdEmbed) Identifier

func (c *CmdEmbed) Identifier() string

func (*CmdEmbed) Run

func (c *CmdEmbed) Run(ctx sh.CommandContext) int

type CmdError

type CmdError struct{}

func (CmdError) Identifier

func (CmdError) Identifier() string

func (CmdError) Run

func (CmdError) Run(ctx sh.CommandContext) int

type CmdFinishFlight

type CmdFinishFlight struct {
	FileStore filesystem.Store
}

func (*CmdFinishFlight) Identifier

func (c *CmdFinishFlight) Identifier() string

func (*CmdFinishFlight) Run

func (c *CmdFinishFlight) Run(ctx sh.CommandContext) int

type CmdFluxStream

type CmdFluxStream struct {
	FluxCfg *influx.InfluxDBConfig
}

func (CmdFluxStream) Identifier

func (c CmdFluxStream) Identifier() string

func (CmdFluxStream) Run

func (c CmdFluxStream) Run(ctx sh.CommandContext) int

type CmdHeartbeat

type CmdHeartbeat struct{}

func (CmdHeartbeat) Identifier

func (CmdHeartbeat) Identifier() string

func (CmdHeartbeat) Run

func (CmdHeartbeat) Run(ctx sh.CommandContext) int

type CmdHelp

type CmdHelp struct{}

func (CmdHelp) Identifier

func (CmdHelp) Identifier() string

func (CmdHelp) Run

func (CmdHelp) Run(ctx sh.CommandContext) int

type CmdHex

type CmdHex struct{}

func (CmdHex) Identifier

func (CmdHex) Identifier() string

func (CmdHex) Run

func (CmdHex) Run(ctx sh.CommandContext) int

type CmdLogout

type CmdLogout struct {
	FileStore filesystem.Store
}

func (*CmdLogout) Identifier

func (c *CmdLogout) Identifier() string

func (*CmdLogout) Run

func (c *CmdLogout) Run(ctx sh.CommandContext) int

type CmdLs

type CmdLs struct {
	FileStore filesystem.Store
}

func (*CmdLs) Identifier

func (*CmdLs) Identifier() string

func (*CmdLs) Run

func (c *CmdLs) Run(ctx sh.CommandContext) int

type CmdMLRPC

type CmdMLRPC struct {
	Conn *jsonrpc2.Conn
}

func (CmdMLRPC) Identifier

func (c CmdMLRPC) Identifier() string

func (CmdMLRPC) Run

func (c CmdMLRPC) Run(ctx sh.CommandContext) int

type CmdMQTT

type CmdMQTT struct {
	Events *util.EventHandler[types.MQTTMessage]
}

func (*CmdMQTT) Identifier

func (c *CmdMQTT) Identifier() string

func (*CmdMQTT) Run

func (c *CmdMQTT) Run(ctx sh.CommandContext) int

type CmdMkdir

type CmdMkdir struct {
	FileStore filesystem.Store
}

func (*CmdMkdir) Identifier

func (*CmdMkdir) Identifier() string

func (*CmdMkdir) Run

func (c *CmdMkdir) Run(ctx sh.CommandContext) int

type CmdMv

type CmdMv struct {
	FileStore filesystem.Store
}

func (*CmdMv) Identifier

func (c *CmdMv) Identifier() string

func (*CmdMv) Run

func (c *CmdMv) Run(ctx sh.CommandContext) int

type CmdPilots

type CmdPilots struct {
	FileStore filesystem.Store
}

func (*CmdPilots) Identifier

func (c *CmdPilots) Identifier() string

func (*CmdPilots) Run

func (c *CmdPilots) Run(ctx sh.CommandContext) int

type CmdRm

type CmdRm struct {
	FileStore filesystem.Store
}

func (*CmdRm) Identifier

func (c *CmdRm) Identifier() string

func (*CmdRm) Run

func (c *CmdRm) Run(ctx sh.CommandContext) int

type CmdSendText

type CmdSendText struct {
	UazapiConfig uazapi.UazapiConfig
}

func (*CmdSendText) Identifier

func (c *CmdSendText) Identifier() string

func (*CmdSendText) Run

func (c *CmdSendText) Run(ctx sh.CommandContext) int

type CmdSockets

type CmdSockets struct {
	SessionStore *types.SessionStore
}

func (*CmdSockets) Identifier

func (c *CmdSockets) Identifier() string

func (*CmdSockets) Run

func (c *CmdSockets) Run(ctx sh.CommandContext) int

type CmdTee

type CmdTee struct {
	FileStore filesystem.Store
}

func (*CmdTee) Identifier

func (*CmdTee) Identifier() string

func (*CmdTee) Run

func (c *CmdTee) Run(ctx sh.CommandContext) int

type CmdWhoami

type CmdWhoami struct {
	FileStore filesystem.Store
	Session   *types.SocketSession
}

func (*CmdWhoami) Identifier

func (*CmdWhoami) Identifier() string

func (*CmdWhoami) Run

func (c *CmdWhoami) Run(ctx sh.CommandContext) int

Jump to

Keyboard shortcuts

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