Versions in this module Expand all Collapse all v1 v1.2.1 Mar 31, 2021 v1.2.0 Mar 15, 2021 v1.1.0 Mar 14, 2021 Changes in this version + const MaxAlertAfter + const MaxAlertPeriod + const MinAlertAfter + const MinAlertPeriod + func Save(v interface{}) error type Agent + AlertAfter uint + AlertAt time.Time + AlertPeriod uint + SeenAt time.Time + func FindAgentsForAlert() ([]*Agent, error) + type AgentWritableFields struct + AlertAfter uint + AlertPeriod uint + ID uint + Name string + Rules []*firewall.Rule + User *User + func (f *AgentWritableFields) Validate() error v1.0.3 Feb 14, 2021 v1.0.2 Feb 14, 2021 v1.0.1 Feb 14, 2021 v1.0.0 Feb 13, 2021 Changes in this version + const MaxAgentRules + const MinAgentNameLength + const MinPasswordLength + func Delete(v interface{}) error + func Setup(config Config) (err error) + func ToJSONB(v interface{}) datatypes.JSON + func UpdateAgent(agent *Agent, name string, rules []*firewall.Rule) error + func VerifyUser(verification string) error + type Agent struct + Address string + CreatedAt time.Time + DeletedAt gorm.DeletedAt + ID uint + Name string + Rules datatypes.JSON + Token string + UpdatedAt time.Time + UserAgent string + UserID uint + func FindAgentByToken(token string) (*Agent, error) + func RegisterAgent(user *User, name string, rules []*firewall.Rule) (*Agent, error) + func (a *Agent) Save() error + type Config struct + Hostname string + Name string + Password string + Port int + User string + type JSONB map[string]interface + func (j *JSONB) Scan(value interface{}) error + func (j JSONB) Value() (driver.Value, error) + type User struct + Address string + Agents []Agent + CreatedAt time.Time + DeletedAt gorm.DeletedAt + Email string + Hash string + ID uint + UpdatedAt time.Time + Use2FA bool + Verification string + Verified bool + func FindUserByID(id int) (*User, error) + func LoginUser(address, email, password string) (*User, error) + func RegisterUser(address, email, password string) (*User, error) + func UpdateUser(user *User, ip string, newPassword string, use2FA bool) (*User, error)