| 1 |
package types |
| 2 |
|
| 3 |
// MultiFileStrategy represents a strategy for taking file-based actions (e.g., |
| 4 |
// move, copy, delete) on messages that are represented by more than one file. |
| 5 |
// These strategies are only used by the notmuch backend but are defined in this |
| 6 |
// package to prevent import cycles. |
| 7 |
type MultiFileStrategy uint |
| 8 |
|
| 9 |
const ( |
| 10 |
Refuse MultiFileStrategy = iota |
| 11 |
ActAll |
| 12 |
ActOne |
| 13 |
ActOneDelRest |
| 14 |
ActDir |
| 15 |
ActDirDelRest |
| 16 |
) |
| 17 |
|
| 18 |
var StrToStrategy = map[string]MultiFileStrategy{ |
| 19 |
"refuse": Refuse, |
| 20 |
"act-all": ActAll, |
| 21 |
"act-one": ActOne, |
| 22 |
"act-one-delete-rest": ActOneDelRest, |
| 23 |
"act-dir": ActDir, |
| 24 |
"act-dir-delete-rest": ActDirDelRest, |
| 25 |
} |
| 26 |
|
| 27 |
func StrategyStrs() []string { |
| 28 |
strs := make([]string, 0, len(StrToStrategy)) |
| 29 |
for s := range StrToStrategy { |
| 30 |
strs = append(strs, s) |
| 31 |
} |
| 32 |
return strs |
| 33 |
} |