1 // RPC primitives for safcm: message and additional types
3 // SPDX-License-Identifier: GPL-3.0-or-later
4 // Copyright (C) 2021-2024 Simon Ruderich
16 msg() // unused, only to implement interface
24 type MsgInfoReq struct {
29 type MsgInfoResp struct {
37 type MsgSyncReq struct {
39 Groups []string // for commands
41 Files map[string]*File
46 type MsgSyncResp struct {
47 FileChanges []FileChange
48 PackageChanges []PackageChange
49 ServiceChanges []ServiceChange
50 CommandChanges []CommandChange
55 type MsgQuitReq struct {
57 type MsgQuitResp struct {
60 func (MsgLog) msg() {}
61 func (MsgInfoReq) msg() {}
62 func (MsgInfoResp) msg() {}
63 func (MsgSyncReq) msg() {}
64 func (MsgSyncResp) msg() {}
65 func (MsgQuitReq) msg() {}
66 func (MsgQuitResp) msg() {}
69 // Necessary to receive "into" an interface type
70 gob.Register(MsgLog{})
71 gob.Register(MsgInfoReq{})
72 gob.Register(MsgInfoResp{})
73 gob.Register(MsgSyncReq{})
74 gob.Register(MsgSyncResp{})
75 gob.Register(MsgQuitReq{})
76 gob.Register(MsgQuitResp{})
79 // Types used in messages
82 OrigGroup string // group which provided this file
88 Uid int //lint:ignore ST1003 UID is too ugly
90 Gid int //lint:ignore ST1003 GID is too ugly
94 TriggerCommands []string
98 OrigGroup string // group which provided this command
102 type FileChange struct {
109 type FileChangeInfo struct {
112 Uid int //lint:ignore ST1003 UID is too ugly
114 Gid int //lint:ignore ST1003 GID is too ugly
117 type PackageChange struct {
121 type ServiceChange struct {
127 type CommandChange struct {
129 Trigger string // path which triggered this command (optional)
130 Output string // stdout and stderr combined