# Handler

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](https://pps-docs.pebcak.de/api/server) instance, the `Run()` method requires a type that satisfies the `Handler` interface.&#x20;

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](https://pps-docs.pebcak.de/api/policyset) to the `Handle()` method of the `Handler` interface type you provided. All it expects back is a proper response of the type [PostfixResp](https://pps-docs.pebcak.de/api/postfixresp) that it can write back to Postfix. What you do with the [PolicySet](https://pps-docs.pebcak.de/api/policyset) in your `Handle()` method is totally up to you.

{% tabs %}
{% tab title="Signature" %}

```go
type Handler interface {
	Handle(*PolicySet) PostfixResp
}
```

{% endtab %}

{% tab title="Example" %}

```go
// Empty struct to act the Handler interface
type Hi struct {
	r PostfixResp
}

// Handle is the function required by the Handler Interface
func (h Hi) Handle(*pps.PolicySet) pps.PostfixResp {
	if h.r == "" {
		h.r = pps.RespDunno
	}
	return h.r
}
```

{% endtab %}
{% endtabs %}
