Adding sample auth code that will most likely change and api implementation

Signed-off-by: Kris Nóva <kris@nivenly.com>
This commit is contained in:
Kris Nóva 2021-01-31 00:08:52 -08:00
parent ef15a0ac15
commit 95794522e0
7 changed files with 279 additions and 278 deletions

View file

@ -25,7 +25,8 @@ func main() {
if pass == "" {
halt(2, "Missing PHOTOPRISM_PASS")
}
photoclient := photoprism.New()
login := photoprism.NewClientAuthLogin("username", "password")
photoclient := photoprism.New(login)
photo, err := photoclient.V1().GetPhoto("123")
if err != nil {
halt(3, "Error fetching photo: %v", err)