2022-07-06 23:19:05 +02:00
|
|
|
package models
|
|
|
|
|
|
|
|
import "github.com/pocketbase/pocketbase/tools/types"
|
|
|
|
|
|
|
|
var _ Model = (*Request)(nil)
|
|
|
|
|
|
|
|
// list with the supported values for `Request.Auth`
|
|
|
|
const (
|
2022-10-30 10:28:14 +02:00
|
|
|
RequestAuthGuest = "guest"
|
|
|
|
RequestAuthAdmin = "admin"
|
|
|
|
RequestAuthRecord = "auth_record"
|
2022-07-06 23:19:05 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
type Request struct {
|
|
|
|
BaseModel
|
|
|
|
|
|
|
|
Url string `db:"url" json:"url"`
|
|
|
|
Method string `db:"method" json:"method"`
|
|
|
|
Status int `db:"status" json:"status"`
|
|
|
|
Auth string `db:"auth" json:"auth"`
|
2022-08-18 14:27:45 +02:00
|
|
|
UserIp string `db:"userIp" json:"userIp"`
|
|
|
|
RemoteIp string `db:"remoteIp" json:"remoteIp"`
|
2022-07-06 23:19:05 +02:00
|
|
|
Referer string `db:"referer" json:"referer"`
|
|
|
|
UserAgent string `db:"userAgent" json:"userAgent"`
|
|
|
|
Meta types.JsonMap `db:"meta" json:"meta"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *Request) TableName() string {
|
|
|
|
return "_requests"
|
|
|
|
}
|