More API refactoring and working on cleaning up

Signed-off-by: Kris Nóva <kris@nivenly.com>
This commit is contained in:
Kris Nóva 2021-02-09 14:45:36 -08:00
parent e4323b6047
commit 3b41c9dd5f
9 changed files with 232 additions and 148 deletions

View file

@ -1,10 +0,0 @@
#!/bin/bash
token="c558cccdd25917056e8b7b72a2a3e5f40215d707a6fac1aa"
server="localhost"
port="8080"
function photoget() {
url="http://${server}:${port}/${1}"
curl --header "X-Session-Id: ${token}" --header "Content-Type: application/json" ${url}
}

View file

@ -1,10 +0,0 @@
#!/bin/bash
token=""
server="localhost"
port="8080"
function photoget() {
url="http://${server}:${port}/${1}"
curl --header "X-Session-Id: ${token}" --header "Content-Type: application/json" ${url} | jq
}

View file

@ -7,9 +7,8 @@ import (
func main() {
logger.Level = 4
creds := photoprism.NewClientAuthLogin("admin", "missy")
client := photoprism.New("localhost:8080")
err := client.Auth(creds)
client := photoprism.New("http://localhost:8080")
err := client.Auth(photoprism.NewClientAuthLogin("admin", "missy"))
if err != nil {
halt(4, "Error logging into API: %v", err)
}

View file

@ -11,9 +11,8 @@ import (
func main() {
logger.Level = 4
uuid := "pqnzigq351j2fqgn" // This is a known ID
creds := photoprism.NewClientAuthLogin("admin", "missy")
client := photoprism.New("localhost:8080")
err := client.Auth(creds)
client := photoprism.New("http://localhost:8080")
err := client.Auth(photoprism.NewClientAuthLogin("admin", "missy"))
if err != nil {
halt(4, "Error logging into API: %v", err)
}