Introduction
This is an Immich client library written in Go. It is still a work in progress and should be considered
pre-alpha. Interfaces may be subject to change at short notice. Things might not work.
Quickstart
package main
import (
"fmt"
"log"
immichclient "codeberg.org/pdwerryhouse/immich-client-go/client"
)
func main() {
endpoint := "http://localhost:2283/api"
api_key := "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
c, err := immichclient.NewClient(&endpoint, &api_key)
if err != nil {
log.Fatal("Failed to create Immich Client")
}
albums, err := c.GetAlbums()
if err != nil {
log.Fatal("GetAlbums failed")
}
for _, album := range albums {
fmt.Printf("%+v\n", album)
}
}
Tests
There are some tests available, not even close to complete.
Unit tests with mock servers:
make unit_test
Integration tests with a real server:
export TEST_IMMICH_ENDPOINT=http://localhost:2283/api # Obviously, you need to have your own server running
read -p "Enter key: " -s TEST_IMMICH_API_KEY # Create an API key before running this
export TEST_IMMICH_API_KEY
make integration_test
License
This project is licensed under the GPL 3.0 (or later). See details in the LICENSE file.