mirror of
https://github.com/Rayzggz/server_torii.git
synced 2025-06-22 23:11:30 +08:00
27 lines
426 B
Go
27 lines
426 B
Go
package action
|
||
|
||
type Action int
|
||
|
||
const (
|
||
Undecided Action = iota // 0:Undecided
|
||
Allow // 1:Pass
|
||
Block // 2:Deny
|
||
)
|
||
|
||
// Decision saves the result of the decision
|
||
type Decision struct {
|
||
result Action
|
||
}
|
||
|
||
func NewDecision() *Decision {
|
||
return &Decision{result: Undecided}
|
||
}
|
||
|
||
func (d *Decision) Get() Action {
|
||
return d.result
|
||
}
|
||
|
||
func (d *Decision) Set(new Action) {
|
||
d.result = new
|
||
}
|