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 AnsibleExecuteArgs
- type AnsibleExecuteResult
- 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 AnsibleExecuteArgs ¶ added in v0.0.6
type AnsibleExecuteResult ¶ added in v0.0.6
type AnsibleExecuteResult struct {
Stderr []byte
Stdout []byte
ExitCode int
Success bool
Result map[string]any
DebugTempDir string
}
func AnsibleExecute ¶ added in v0.0.6
func AnsibleExecute(args AnsibleExecuteArgs) (AnsibleExecuteResult, 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 `json:",omitempty"`
Size *int64 `json:",omitempty"`
FileMode *fs.FileMode `json:",omitempty"`
ModifiedTime *time.Time `json:",omitempty"`
// depends on FileInfo.Sys()
AccessTime *time.Time `json:",omitempty"`
CreateTime *time.Time `json:",omitempty"`
Dev *uint64 `json:",omitempty"`
Gid *uint64 `json:",omitempty"`
GroupName *string `json:",omitempty"`
Inode *uint64 `json:",omitempty"`
Nlink *uint64 `json:",omitempty"`
Uid *uint64 `json:",omitempty"`
UserName *string `json:",omitempty"`
// conditional on CalculateChecksum
SHA256Checksum *string `json:",omitempty"`
}
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" RPCAnsibleExecute RPCFunction = "AnsibleExecute" RPCClose RPCFunction = "Close" RPCExec RPCFunction = "Exec" RPCFileStat RPCFunction = "FileStat" )
Click to show internal directories.
Click to hide internal directories.