Files
server_torii/internal/action/action.go

27 lines
426 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package action
type Action int
const (
Undecided Action = iota // 0Undecided
Allow // 1Pass
Block // 2Deny
)
// 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
}