mirror of
https://github.com/Rayzggz/server_torii.git
synced 2025-06-23 23:41:30 +08:00
feat Main HTTP Server; IP,URL Allowlist and Blocklist
This commit is contained in:
26
internal/action/action.go
Normal file
26
internal/action/action.go
Normal file
@ -0,0 +1,26 @@
|
||||
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
|
||||
}
|
Reference in New Issue
Block a user