Initial success talking to lob directly with my own client
This commit is contained in:
parent
c0935c848b
commit
97ec0667a5
2 changed files with 86 additions and 0 deletions
26
lob/cmd/address-list/main.go
Normal file
26
lob/cmd/address-list/main.go
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/Gleipnir-Technology/nidus-sync/lob"
|
||||
)
|
||||
|
||||
func main() {
|
||||
key := os.Getenv("LOB_API_KEY")
|
||||
if key == "" {
|
||||
log.Println("LOB_API_KEY is empty")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
client := lob.NewLob(key)
|
||||
ctx := context.TODO()
|
||||
_, err := client.AddressList(ctx)
|
||||
if err != nil {
|
||||
log.Printf("err: %v", err)
|
||||
os.Exit(2)
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue