sensitiveWord

package
v0.2.74 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionReject  = "reject"
	ActionReplace = "replace"
	ActionRecord  = "record"
)

Variables

This section is empty.

Functions

func Delete

func Delete(id uint64) error

func Save

func Save(e *Entity) error

Types

type Entity

type Entity struct {
	Id          uint64    `gorm:"primaryKey;column:id;autoIncrement;not null" json:"id"`
	Word        string    `gorm:"column:word;type:varchar(128);not null;uniqueIndex" json:"word"`
	Action      string    `gorm:"column:action;type:varchar(16);not null;default:'reject'" json:"action"`
	Replacement string    `gorm:"column:replacement;type:varchar(128);not null;default:''" json:"replacement"`
	Enabled     bool      `gorm:"column:enabled;not null;default:true;index" json:"enabled"`
	CreatedAt   time.Time `gorm:"column:created_at;autoCreateTime;<-:create" json:"createdAt"`
	UpdatedAt   time.Time `gorm:"column:updated_at;autoUpdateTime" json:"updatedAt"`
}

func Get

func Get(id uint64) (Entity, error)

func List

func List(enabledOnly bool) []Entity

func LoadEnabled

func LoadEnabled() ([]Entity, error)

func (*Entity) TableName

func (e *Entity) TableName() string

Jump to

Keyboard shortcuts

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