25 lines
456 B
Go
25 lines
456 B
Go
package web
|
|
|
|
import "code.mrmelon54.com/melon/summer/pkg/utils"
|
|
|
|
type TcpRedirect struct {
|
|
Id uint64 `json:"id" xorm:"pk autoincr"`
|
|
Port int `json:"port"`
|
|
Target string `json:"target"`
|
|
Enabled *bool `json:"enabled"`
|
|
}
|
|
|
|
func (t TcpRedirect) GetId() uint64 {
|
|
return t.Id
|
|
}
|
|
|
|
func (t TcpRedirect) SetEnabled(v bool) TcpRedirect {
|
|
t.Enabled = utils.PBool(v)
|
|
return t
|
|
}
|
|
|
|
func (t TcpRedirect) ClearForNew() TcpRedirect {
|
|
t.Id = 0
|
|
return t
|
|
}
|