WIP: implemented Ping, implemented Set and Shutdown in agent, and added umask

This commit is contained in:
2025-06-23 16:43:53 +10:00
parent cfdfcb6ed5
commit b22529be7b
10 changed files with 243 additions and 60 deletions

View File

@@ -16,17 +16,22 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import "sync"
import (
"context"
"sync"
)
type InMap struct {
mtx *sync.Mutex
stor map[string]string
mtx *sync.Mutex
stor map[string]string
cancel context.CancelFunc
}
func NewInMap() *InMap {
func NewInMap(ctxCancel context.CancelFunc) *InMap {
return &InMap{
mtx: new(sync.Mutex),
stor: make(map[string]string),
mtx: new(sync.Mutex),
stor: make(map[string]string),
cancel: ctxCancel,
}
}
@@ -56,5 +61,6 @@ func (i *InMap) Get(key string) (string, error) {
}
func (i *InMap) Shutdown() error {
i.cancel()
return nil
}