Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChecksToString ¶ added in v1.15.0
ChecksToString converts a slice of checks to a string
Types ¶
type LastRequests ¶ added in v1.16.0
type LastRequests struct {
// contains filtered or unexported fields
}
LastRequests keeps track of last N requests, thread-safe.
func NewLastRequests ¶ added in v1.16.0
func NewLastRequests(size int) *LastRequests
NewLastRequests creates new requests tracker
func (*LastRequests) Last ¶ added in v1.16.0
func (h *LastRequests) Last(n int) []Request
Last returns up to n last requests in chronological order (oldest to newest)
func (*LastRequests) Push ¶ added in v1.16.0
func (h *LastRequests) Push(req Request)
Push adds new request to the history
func (*LastRequests) Size ¶ added in v1.16.0
func (h *LastRequests) Size() int
Size returns the size of request history
type MetaData ¶ added in v1.9.0
type MetaData struct { Images int `json:"images"` // number of images in the message Links int `json:"links"` // number of links in the message HasVideo bool `json:"has_video"` // true if the message has a video or video note HasAudio bool `json:"has_audio"` // true if the message has an audio HasForward bool `json:"has_forward"` // true if the message has a forward }
MetaData is a meta-info about the message, provided by the client.
type Request ¶
type Request struct { Msg string `json:"msg"` // message to check UserID string `json:"user_id"` // user id UserName string `json:"user_name"` // user name Meta MetaData `json:"meta"` // meta-info, provided by the client CheckOnly bool `json:"check_only"` // if true, only check the message, do not write newly approved user to the database }
Request is a request to check a message for spam.
Click to show internal directories.
Click to hide internal directories.