📩
postfix-policy-server
  • 👋Welcome
  • API
    • 🚀Server
    • 📋ServerOpt
    • 📐Handler
    • 🗃️PolicySet
    • 📣Postfix(Text)Resp
  • Code Examples
    • 💡Policy to JSON echo server
Powered by GitBook
On this page
  • WithAddr
  • WithPort
  1. API

ServerOpt

SeverOpt functions let you override default values

SeverOpt is a type that represents a function that allow you to override the default settings of the New() method with your own settings.

type ServerOpt func(*Server)

pps provides the following ServerOpt functions:

WithAddr

WithAddr() allows you to set the listening address for the TCP server (Default: 0.0.0.0)

func WithAddr(string) ServerOpt
s := pps.New(WithAddr("127.0.0.1"))

WithPort

WithPort() allows you to set the listening port for the TCP server (Default: 10005)

func WithPort(string) ServerOpt
s := pps.New(WithPort("10006"))
PreviousServerNextHandler

Last updated 3 years ago

📋