database

package
v0.0.0-...-ca18e3e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LogDB = client.Database("WAF").Collection("RequestLogs")
View Source
var RuleDB = client.Database("WAF").Collection("Testing")

Functions

func FindOneQuery

func FindOneQuery(filter, projection interface{}, collection *mongo.Collection, checkvar bool) (map[string]string, bool)

func InsertOneQuery

func InsertOneQuery(todo Rule, collection *mongo.Collection) error

func RetrieveRule

func RetrieveRule(RuleName []Rule, checkvar bool) (map[string]string, bool)

Types

type CustomRules

type CustomRules struct {
	IP        string `json:"ip" bson:"ip"`
	Rules     []Rule `json:"rules" bson:"rules"`
	CreatedAt string `json:"createdat" bson:"createdat"`
	URL       string `json:"url" bson:"url"`
}

type Rule

type Rule struct {
	Rulename  string `json:"rulename,omitempty"`
	Field     string `json:"field" bson:"field"`
	FieldVal  string `json:"value" bson:"value"`
	Condition string `json:"condition" bson:"condition"`
	Action    string `json:"action" bson:"action"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL