WIP: implemented Ping, implemented Set and Shutdown in agent, and added umask
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user