mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-19 20:32:35 +02:00
fixed event name missing
This commit is contained in:
parent
b679655cd5
commit
31080edd59
2 changed files with 13 additions and 4 deletions
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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue