Validator

class Validator @JvmOverloads constructor(rule: Rule, cacheSize: Long? = null) : Server.Plugin

Validator is a Server.Plugin that validates the Bolt.Run.query and Bolt.Run.parameters in a Bolt.Run message. If the data in the Bolt.Message is invalid, according to the rule, then a Bolt.Failure and Bolt.Ignored is returned upon the next Bolt.Pull.

Parameters

rule

the Rule to validate

cacheSize

the maximum entries in the cache of validated queries

Constructors

Link copied to clipboard
constructor(rule: Rule, cacheSize: Long? = null)

Functions

Link copied to clipboard
open suspend override fun intercept(session: Bolt.Session, message: Bolt.Message): Bolt.Message

Intercept, and optionally transform, the message.

Link copied to clipboard
open suspend override fun observe(event: Server.Event)

Observe the event.

Link copied to clipboard
open infix fun then(that: Server.Plugin): Server.Plugin

Run this Server.Plugin then that.