Skip to content

Commit

Permalink
move examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Sagleft committed May 4, 2022
1 parent 84d0422 commit d927bce
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions examples/get.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package main

import (
"fmt"
"log"
"os"

gonvs "github.com/sagleft/go-nvs"
)

func main() {
client, err := gonvs.NewClient(gonvs.CreateClientTask{
RPCUser: os.Getenv("USER"),
RPCPassword: os.Getenv("PASSWORD"),
RPCPort: os.Getenv("PORT"),
})
if err != nil {
log.Fatalln(err)
}

entry, err := client.GetEntry(gonvs.GetEntryTask{
Name: "dns:example",
})
if err != nil {
log.Fatalln(err)
}

fmt.Println("value:" + entry.Value)
}
File renamed without changes.
File renamed without changes.

0 comments on commit d927bce

Please sign in to comment.