• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

LICENSEH A D27-Feb-20191.5 KiB

README.mdH A D27-Feb-2019558

nsdctl.goH A D03-May-20227.7 KiB

README.md

1# go-nsdctl
2Golang interface for NSD's control socket
3
4# Usage
5```go
6package main
7
8import (
9  "io"
10  "os"
11
12  "github.com/optix2000/go-nsdctl"
13)
14
15func main() {
16  client, err := nsdctl.NewClientFromConfig("/etc/nsd/nsd.conf")
17  // If you want to build one manually
18  // client, err := nsdctl.NewClient("127.0.0.1:8952", "nsd", "/etc/nsd/nsd_server.pem", "/etc/nsd/nsd_control.key", "/etc/nsd/nsd_control.pem", false)
19  if err != nil {
20    panic(err)
21  }
22
23  r, err := client.Command("status")
24  if err != nil {
25    panic(err)
26  }
27
28  io.Copy(os.Stdout, r)
29}
30```
31