Adding sample code for work
Signed-off-by: Kris Nóva <kris@nivenly.com>
This commit is contained in:
parent
e69880434d
commit
0476727633
10 changed files with 387 additions and 136 deletions
29
examples/list.go
Normal file
29
examples/list.go
Normal file
|
@ -0,0 +1,29 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
photoprism "github.com/kris-nova/client-go"
|
||||
"github.com/kris-nova/logger"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// ---
|
||||
// Log Level 4 (Most)
|
||||
// Log Level 3
|
||||
// Log Level 2
|
||||
// Log Level 1
|
||||
// Log Level 0 (Least)
|
||||
//
|
||||
logger.Level = 4
|
||||
//
|
||||
// ---
|
||||
|
||||
client := photoprism.New("http://localhost:8080")
|
||||
err := client.Auth(photoprism.NewClientAuthLogin("admin", "missy"))
|
||||
if err != nil {
|
||||
halt(4, "Error logging into API: %v", err)
|
||||
}
|
||||
logger.Always("Logged in...")
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue