Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Client *mongo.Client Domains *mongo.Collection NotFound *mongo.Collection )
Functions ¶
func Insert ¶
Insert inserts the given domain d to the *domains* database. Checks if d is valid, do a Clean() and then splits into sub|domain|tld parts.
Returns true if d is new and inserted into the database. If domain is invalid, returns fault.ErrInvalidDomain. If failed to get parts of d (eg.: d is a TLD), returns ault.ErrGetPartsFailed.
func InsertNotFound ¶ added in v0.10.0
InsertNotFound inserts the given domain d to the *notFound* database. Checks if d is valid, do a Clean() and removes the subdomain from d.
If domain is invalid or failed to remove the subdomain, returns fault.ErrInvalidDomain.
Types ¶
type NotFoundSchema ¶ added in v0.10.0
type NotFoundSchema struct {
Domain string `bson:"domain" json:"domain"`
}
Schema used in *notFound* collection
Click to show internal directories.
Click to hide internal directories.