Go client library to call the pfsense API: https://github.com/jaredhendrickson13/pfsense-api.
- Local Authentication (Username/Password)
- JWT Authentication
- Token Authentication
package main
import (
"context"
"fmt"
"github.com/sjafferali/pfsense-api-goclient/pfsenseapi"
)
func main() {
ctx := context.Background()
client := pfsenseapi.NewClientWithLocalAuth(
"https://192.168.10.1",
"admin",
"adminpassword",
)
leases, err := client.DHCP.ListLeases(ctx)
if err != nil {
panic(err)
}
for _, lease := range leases {
fmt.Println(lease.Ip)
}
}
PRs welcome.