Documentation ¶
Overview ¶
Package mask provides the service layer for managing masks that need to be applied to results before they are returned.
Index ¶
- Constants
- Variables
- func Delete(context interface{}, db *db.DB, collection string, field string) error
- func GetAll(context interface{}, db *db.DB, tags []string) (map[string]Mask, error)
- func GetByCollection(context interface{}, db *db.DB, collection string) (map[string]Mask, error)
- func Upsert(context interface{}, db *db.DB, mask Mask) error
- type Mask
Constants ¶
View Source
const ( Collection = "query_masks" CollectionHistory = "query_masks_history" )
Contains the name of Mongo collections.
View Source
const ( MaskRemove = "remove" // Field is removed. MaskAll = "all" // Everything is masked. MaskEmail = "email" // Email based masking. MaskRight = "right" // Mask everything except last n characters. Default 4. MaskLeft = "left" // Mask everything except first n characters. Default 4. )
Set of query types we expect to receive.
Variables ¶
View Source
var (
ErrNotFound = errors.New("Mask Not found")
)
Set of error variables.
Functions ¶
func GetByCollection ¶
GetByCollection retrieves the masks for the specified collection.
Types ¶
type Mask ¶
type Mask struct { Collection string `bson:"collection" json:"collection" validate:"required"` Field string `bson:"field" json:"field" validate:"required"` Type string `bson:"type" json:"type" validate:"required,min=3"` }
Mask contains information about what needs to be masked.
Click to show internal directories.
Click to hide internal directories.