cli

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoCreateAlbums

func AutoCreateAlbums(ctx context.Context, cl *client.Client, opts *AutoCreateAlbumsOptions) error

AutoCreateAlbums will create albums based on folders.

func DefaultCredentialsPath

func DefaultCredentialsPath() (string, error)

DefaultCredentialsPath returns the path of the credentials file.

func Login

func Login(cred *Credentials, filename string) (err error)

Login received the credentials and stores into file. The credentials will be used to communicate with Immich server.

func Logout

func Logout(filename string) error

Logout removes stored credentials.

Types

type About

type About struct {
	Version     string `json:"version"`
	Nodejs      string `json:"nodejs"`
	ImageMagick string `json:"imagemagick"`
	ExifTool    string `json:"exiftool"`
	FFmpeg      string `json:"ffmpeg"`
	Libvips     string `json:"libvips"`
	Build       string `json:"build"`
}

About represents server information.

type Album added in v0.2.0

type Album struct {
	ID         string `json:"id"`
	Name       string `json:"albumName"`
	AssetCount int64  `json:"assetCount"`
}

Album represents an Album stored in Immich.

type Albums added in v0.2.0

type Albums []Album

Albums represents a collection of Albums.

func FetchAlbums added in v0.2.0

func FetchAlbums(ctx context.Context, cl *client.Client) (Albums, error)

FetchAlbums returns all albums stored.

type AutoCreateAlbumsOptions

type AutoCreateAlbumsOptions struct {
	Folder            string            `json:"folder"`
	Recursive         bool              `json:"recursive"`
	SkipLevels        int               `json:"skip_levels"`
	OriginalPath      string            `json:"original_path,omitempty"`
	Exclude           []string          `json:"exclude,omitempty"`
	ParentGroupAssets bool              `json:"parent_group_assets"`
	Albums            map[string]string `json:"albums,omitempty"`
}

AutoCreateAlbumOptions handles the options to auto create albums.

type Credentials

type Credentials struct {
	Host string `json:"host"`
	Key  string `json:"key"`
}

Credentials holds the Immich credentials.

func Session

func Session(filename string) (_ *Credentials, err error)

Session returns the credentials stored.

type ServerInfo

type ServerInfo struct {
	About   *About
	Storage *Storage
	Stats   *Stats
}

ServerInfo represents the server information.

func Info

func Info(ctx context.Context, cl *client.Client) (*ServerInfo, error)

Info retrieves server information, like version, statistics and storage.

type Stats

type Stats struct {
	Photos int64 `json:"photos"`
	Videos int64 `json:"videos"`
	Usage  int64 `json:"usage"`
}

Stats represents the server statistics.

type Storage

type Storage struct {
	Size      int64 `json:"diskSizeRaw"`
	Use       int64 `json:"diskUseRaw"`
	Available int64 `json:"diskAvailableRaw"`
}

Storage represents the server storage information.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL