mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-28 20:01:50 +01:00
fixed event name missing
This commit is contained in:
3
.vscode/settings.example.json
vendored
3
.vscode/settings.example.json
vendored
@@ -5,8 +5,7 @@
|
||||
"config.yml"
|
||||
],
|
||||
"https://github.com/yusing/go-proxy/raw/main/schema/providers.schema.json": [
|
||||
"providers.example.yml",
|
||||
"*.yml"
|
||||
"providers.example.yml"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -53,11 +53,21 @@ var DockerEventMap = map[dockerEvents.Action]Action{
|
||||
dockerEvents.ActionDie: ActionContainerDie,
|
||||
}
|
||||
|
||||
var dockerActionNameMap = func() (m map[Action]string) {
|
||||
var fileActionNameMap = map[Action]string{
|
||||
ActionFileWritten: "written",
|
||||
ActionFileCreated: "created",
|
||||
ActionFileDeleted: "deleted",
|
||||
ActionFileRenamed: "renamed",
|
||||
}
|
||||
|
||||
var actionNameMap = func() (m map[Action]string) {
|
||||
m = make(map[Action]string, len(DockerEventMap))
|
||||
for k, v := range DockerEventMap {
|
||||
m[v] = string(k)
|
||||
}
|
||||
for k, v := range fileActionNameMap {
|
||||
m[k] = v
|
||||
}
|
||||
return
|
||||
}()
|
||||
|
||||
@@ -66,7 +76,7 @@ func (e Event) String() string {
|
||||
}
|
||||
|
||||
func (a Action) String() string {
|
||||
return dockerActionNameMap[a]
|
||||
return actionNameMap[a]
|
||||
}
|
||||
|
||||
func (a Action) IsContainerWake() bool {
|
||||
|
||||
Reference in New Issue
Block a user