📐Handler

Handler is the interface for you to process the policy data

The Handler interface of the pps package is very simple and consists only of one method. When starting a new policy service on your Server instance, the Run() method requires a type that satisfies the Handler interface.

This provides and easy way for your program to handle the dataset provided by the Postfix server. Once the dataset has been provided and processed by the pps server, it will hand the PolicySet to the Handle() method of the Handler interface type you provided. All it expects back is a proper response of the type PostfixResp that it can write back to Postfix. What you do with the PolicySet in your Handle() method is totally up to you.

type Handler interface {
	Handle(*PolicySet) PostfixResp
}

Last updated