chore: Mostly ports SSHBackend.

This commit is contained in:
Tera << 8 2025-01-12 11:35:26 -05:00
parent 0d92d27427
commit 2c6b5eb5b9
Signed by: imterah
GPG key ID: 8FA7DD57BA6CEA37
5 changed files with 98 additions and 62 deletions

View file

@ -1,6 +1,9 @@
package backendutil
import "git.terah.dev/imterah/hermes/backend/commonbackend"
import (
"capnproto.org/go/capnp/v3"
"git.terah.dev/imterah/hermes/backend/commonbackend"
)
type BackendInterface interface {
StartBackend(arguments []byte) (bool, error)
@ -8,7 +11,15 @@ type BackendInterface interface {
GetBackendStatus() (bool, error)
StartProxy(command *commonbackend.AddProxy) (bool, error)
StopProxy(command *commonbackend.RemoveProxy) (bool, error)
GetAllClientConnections() []*commonbackend.ProxyClientConnection
CheckParametersForConnections(clientParameters *commonbackend.CheckClientParameters) *commonbackend.CheckParametersResponse
CheckParametersForBackend(arguments []byte) *commonbackend.CheckParametersResponse
GetAllClientConnections(seg *capnp.Segment) []*commonbackend.Connection
CheckParametersForConnections(clientParameters *commonbackend.CheckClientParameters) *CheckParametersResponse
CheckParametersForBackend(arguments []byte) *CheckParametersResponse
}
// Sent as a response to either CheckClientParameters or CheckBackendParameters
type CheckParametersResponse struct {
Type string // Will be 'checkParametersResponse' always
InResponseTo string // Will be either 'checkClientParameters' or 'checkServerParameters'
IsValid bool // If true, valid, and if false, invalid
Message string // String message from the client (ex. failed to unmarshal JSON: x is not defined)
}