Documentation
¶
Index ¶
- func AnyToJSONT[T any](input any) (T, error)
- func ServerRoute(s *Server, rpcFunction RPCFunction, args any) (any, error)
- func ServerStart(s *Server) error
- func SlogJSON(key string, value any) slog.Attr
- type AgentPingArgs
- type AgentPingResult
- type ExecArgs
- type ExecResult
- type FileStatArgs
- type FileStatResult
- type RPCCall
- type RPCFunction
- type RPCResult
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnyToJSONT ¶
func ServerRoute ¶
func ServerRoute(s *Server, rpcFunction RPCFunction, args any) (any, error)
func ServerStart ¶
Types ¶
type AgentPingArgs ¶
type AgentPingArgs struct {
Ping string
}
type AgentPingResult ¶
func AgentPing ¶
func AgentPing(args AgentPingArgs) (AgentPingResult, error)
type ExecResult ¶
func Exec ¶
func Exec(args ExecArgs) (ExecResult, error)
type FileStatArgs ¶
type FileStatResult ¶
type FileStatResult struct {
// always returned
Path string
Exists bool
// usually returned
BaseName string
Size int64
FileMode fs.FileMode
ModifiedTime time.Time
// depends on FileInfo.Sys()
AccessTime time.Time
CreateTime time.Time
Dev uint64
Gid uint64
GroupName string
Inode uint64
Nlink uint64
Uid uint64
UserName string
// conditional on CalculateChecksum
SHA256Checksum string
}
func FileStat ¶
func FileStat(args FileStatArgs) (FileStatResult, error)
type RPCCall ¶
type RPCCall[T any] struct { UUID string RPCFunction RPCFunction Args T }
type RPCFunction ¶
type RPCFunction string
const ( RPCAgentPing RPCFunction = "AgentPing" RPCClose RPCFunction = "Close" RPCExec RPCFunction = "Exec" RPCFileStat RPCFunction = "FileStat" )
Click to show internal directories.
Click to hide internal directories.