immich

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2025 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UploadCreated   = "created"
	UploadReplaced  = "replaced"
	UploadDuplicate = "duplicate"
)
View Source
const (
	StatusCreated   = "created"
	StatusReplaced  = "replaced"
	StatusDuplicate = "duplicate"
)
View Source
const (
	EndPointGetJobs                = "GetJobs"
	EndPointSendJobCommand         = "SendJobCommand"
	EndPointCreateJob              = "CreateJob"
	EndPointGetAllAlbums           = "GetAllAlbums"
	EndPointGetAlbumInfo           = "GetAlbumInfo"
	EndPointAddAsstToAlbum         = "AddAssetToAlbum"
	EndPointCreateAlbum            = "CreateAlbum"
	EndPointGetAssetAlbums         = "GetAssetAlbums"
	EndPointDeleteAlbum            = "DeleteAlbum"
	EndPointPingServer             = "PingServer"
	EndPointValidateConnection     = "ValidateConnection"
	EndPointGetServerStatistics    = "GetServerStatistics"
	EndPointGetAssetStatistics     = "GetAssetStatistics"
	EndPointGetSupportedMediaTypes = "GetSupportedMediaTypes"
	EndPointGetAllAssets           = "GetAllAssets"
	EndPointUpsertTags             = "UpsertTags"
	EndPointTagAssets              = "TagAssets"
	EndPointBulkTagAssets          = "BulkTagAssets"
	EndPointGetAllTags             = "GetAllTags"
	EndPointAssetUpload            = "AssetUpload"
	EndPointAssetReplace           = "AssetReplace"
	EndPointCopyAsset              = "CopyAsset"
	EndPointGetAboutInfo           = "GetAboutInfo"
	EndPointGetSearchSuggestions   = "GetSearchSuggestions"
	EndPointGetAllPeople           = "GetAllPeople"
	EndPointSignUpAdmin            = "SignUpAdmin"
	EndPointAdminLogin             = "AdminLogin"
	EndPointLogin                  = "Login"
	EndPointGetUserInfo            = "GetUserInfo"
	EndPointUpdateAdminOnboarding  = "UpdateAdminOnboarding"
	EndPointCreateApiKey           = "CreateApiKey"
)
View Source
const (
	TimeFormat string = "2006-01-02T15:04:05.000Z"
)

Variables

This section is empty.

Functions

func AlbumsFromAlbumSimplified

func AlbumsFromAlbumSimplified(albums []AlbumSimplified) []assets.Album

func OptionConnectionTimeout

func OptionConnectionTimeout(d time.Duration) clientOption

func OptionDryRun

func OptionDryRun(dryRun bool) clientOption

func OptionSetAPITrace added in v0.29.0

func OptionSetAPITrace(rtd RoundTripperDecorator) clientOption

func OptionVerifySSL

func OptionVerifySSL(verify bool) clientOption

func SearchOptions added in v0.29.0

func SearchOptions() *searchOptions

func UrlRequest added in v0.29.0

func UrlRequest(ur URLRequester) serverRequestOption

Types

type AboutInfo added in v0.24.3

type AboutInfo struct {
	Version       string `json:"version"`
	VersionURL    string `json:"versionUrl"`
	Licensed      bool   `json:"licensed"`
	Build         string `json:"build"`
	BuildURL      string `json:"buildUrl"`
	BuildImage    string `json:"buildImage"`
	BuildImageURL string `json:"buildImageUrl"`
	Repository    string `json:"repository"`
	RepositoryURL string `json:"repositoryUrl"`
	SourceRef     string `json:"sourceRef"`
	SourceCommit  string `json:"sourceCommit"`
	SourceURL     string `json:"sourceUrl"`
	Nodejs        string `json:"nodejs"`
	Exiftool      string `json:"exiftool"`
	Ffmpeg        string `json:"ffmpeg"`
	Libvips       string `json:"libvips"`
	Imagemagick   string `json:"imagemagick"`
}

getAboutInfo

type AdminOnboardingUpdateDto added in v0.29.0

type AdminOnboardingUpdateDto struct {
	IsOnboarded bool `json:"isOnboarded"`
}

type AlbumContent

type AlbumContent struct {
	ID string `json:"id,omitempty"`
	// OwnerID                    string    `json:"ownerId"`
	AlbumName   string   `json:"albumName"`
	Description string   `json:"description"`
	Shared      bool     `json:"shared"`
	Assets      []*Asset `json:"assets,omitempty"`
	AssetIDs    []string `json:"assetIds,omitempty"`
}

type AlbumSimplified

type AlbumSimplified struct {
	ID          string `json:"id,omitempty"`
	AlbumName   string `json:"albumName"`
	Description string `json:"description,omitempty"`
	// OwnerID                    string    `json:"ownerId"`
	// CreatedAt                  time.Time `json:"createdAt"`
	// UpdatedAt                  time.Time `json:"updatedAt"`
	// AlbumThumbnailAssetID      string    `json:"albumThumbnailAssetId"`
	// SharedUsers                []string  `json:"sharedUsers"`
	// Owner                      User      `json:"owner"`
	// Shared                     bool      `json:"shared"`
	// AssetCount                 int       `json:"assetCount"`
	// LastModifiedAssetTimestamp time.Time `json:"lastModifiedAssetTimestamp"
	AssetIds []string `json:"assetIds,omitempty"`
}

type Asset

type Asset struct {
	Checksum string `json:"checksum"`
	// createdAt
	DeviceAssetID string `json:"deviceAssetId"`
	DeviceID      string `json:"deviceId"`
	// duplicateId
	Duration       string     `json:"duration"`
	ExifInfo       ExifInfo   `json:"exifInfo"`
	FileCreatedAt  ImmichTime `json:"fileCreatedAt"`
	FileModifiedAt ImmichTime `json:"fileModifiedAt"`
	// hasMetadata
	ID         string `json:"id"`
	IsArchived bool   `json:"isArchived"`
	IsFavorite bool   `json:"isFavorite"`
	// isOffline
	IsTrashed        bool   `json:"isTrashed"`
	LibraryID        string `json:"libraryId,omitempty"`
	LivePhotoVideoID string `json:"livePhotoVideoId"`

	// The local date and time when the photo/video was taken,
	// derived from EXIF metadata. This represents the
	// photographer's local time regardless of timezone,
	// stored as a timezone-agnostic timestamp.
	// Used for timeline grouping by "local" days and months.
	LocalDateTime    ImmichTime `json:"localDateTime"`
	OriginalFileName string     `json:"originalFileName"`
	// originalMimeType
	OriginalPath string `json:"originalPath"`
	// owner
	OwnerID string `json:"ownerId"`
	// people
	Resized bool `json:"resized"`
	// stack
	Tags      []TagSimplified `json:"tags"`
	Thumbhash string          `json:"thumbhash"`
	Type      string          `json:"type"`
	// unassignedFaces
	UpdatedAt ImmichTime `json:"updatedAt"`
	// rating not listed on the API page?
	Rating int `json:"rating"`
	// StackParentID string            `json:"stackParentId"`
	Visibility string `json:"visibility"`

	Albums []AlbumSimplified `json:"-"` // Albums that asset belong to, not in the API
}

immich Asset simplified

func (Asset) AsAsset

func (ia Asset) AsAsset() *assets.Asset

NewAssetFromImmich creates an assets.Asset from an immich.Asset.

type AssetResponse

type AssetResponse struct {
	ID     string `json:"id"`
	Status string `json:"status"`
}

type AssetSimplified

type AssetSimplified struct {
	ID            string `json:"id"`
	DeviceAssetID string `json:"deviceAssetId"`
}

immich Asset simplified

type ExifInfo

type ExifInfo struct {
	Make             string         `json:"make"`
	Model            string         `json:"model"`
	ExifImageWidth   int            `json:"exifImageWidth"`
	ExifImageHeight  int            `json:"exifImageHeight"`
	FileSizeInByte   int64          `json:"fileSizeInByte"`
	Orientation      string         `json:"orientation"`
	DateTimeOriginal ImmichExifTime `json:"dateTimeOriginal,omitempty"`
	// 	ModifyDate       time.Time `json:"modifyDate"`
	TimeZone string `json:"timeZone"`
	// LensModel        string    `json:"lensModel"`
	// 	FNumber          float64   `json:"fNumber"`
	// 	FocalLength      float64   `json:"focalLength"`
	// 	Iso              int       `json:"iso"`
	// 	ExposureTime     string    `json:"exposureTime"`
	Latitude  float64 `json:"latitude,omitempty"`
	Longitude float64 `json:"longitude,omitempty"`
	// 	City             string    `json:"city"`
	// 	State            string    `json:"state"`
	// 	Country          string    `json:"country"`
	Description string `json:"description"`
	Rating      int    `json:"rating"`
}

type GetAllPeopleOptions added in v0.29.0

type GetAllPeopleOptions struct {
	ClosestAssetId  string // UUID of the closest asset
	ClosestPersonId string // UUID of the closest person
	Page            int    // Page number for pagination (default: 1, minimum: 1)
	Size            int    // Number of items per page (default: 500, minimum: 1, maximum: 1000)
	WithHidden      *bool  // Whether to include hidden people
}

GetAllPeopleOptions represents the query parameters for the getAllPeople endpoint

func (GetAllPeopleOptions) SetURL added in v0.29.0

func (opts GetAllPeopleOptions) SetURL(u *url.URL) error

SetURL implements the URL parameter setting for GetAllPeopleOptions

type GetAssetOptions

type GetAssetOptions struct {
	UserID        string
	IsFavorite    bool
	IsArchived    bool
	WithoutThumbs bool
	Skip          string
}

func (*GetAssetOptions) Values

func (o *GetAssetOptions) Values() url.Values

type ImmichAlbumInterface

type ImmichAlbumInterface interface {
	GetAllAlbums(ctx context.Context) ([]AlbumSimplified, error)
	GetAlbumInfo(ctx context.Context, id string, withoutAssets bool) (AlbumContent, error)
	CreateAlbum(
		ctx context.Context,
		tilte string,
		description string,
		ids []string,
	) (assets.Album, error)

	// GetAssetAlbums get all albums that an asset belongs to
	GetAssetAlbums(ctx context.Context, assetID string) ([]AlbumSimplified, error)
	DeleteAlbum(ctx context.Context, id string) error
}

type ImmichAssetInterface

type ImmichAssetInterface interface {
	GetAssetInfo(ctx context.Context, id string) (*Asset, error)
	DownloadAsset(ctx context.Context, id string) (io.ReadCloser, error)
	UpdateAsset(ctx context.Context, id string, param UpdAssetField) (*Asset, error)
	ReplaceAsset(ctx context.Context, ID string, la *assets.Asset) (AssetResponse, error) // Deprecated
	CopyAsset(ctx context.Context, sourceID string, targetID string) error
	GetAllAssets(ctx context.Context, fn func(*Asset) error) error
	AddAssetToAlbum(context.Context, string, []string) ([]UpdateAlbumResult, error)
	UpdateAssets(
		ctx context.Context,
		IDs []string,
		isArchived bool,
		isFavorite bool,
		latitude float64,
		longitude float64,
		removeParent bool,
		stackParentID string,
	) error
	GetFilteredAssetsFn(ctx context.Context, so *searchOptions, filter func(*Asset) error) error
	// GetAllAssetsWithFilter(context.Context, *SearchMetadataQuery, func(*Asset) error) error
	GetAssetsByHash(ctx context.Context, hash string) ([]*Asset, error)
	GetAssetsByImageName(ctx context.Context, name string) ([]*Asset, error)

	AssetUpload(context.Context, *assets.Asset) (AssetResponse, error)
	DeleteAssets(ctx context.Context, IDs []string, force bool) error
}

type ImmichClient

type ImmichClient struct {
	DeviceUUID   string        // Device
	Retries      int           // Number of attempts on 500 errors
	RetriesDelay time.Duration // Duration between retries
	// contains filtered or unexported fields
}

func NewImmichClient

func NewImmichClient(endPoint string, key string, options ...clientOption) (*ImmichClient, error)

Create a new ImmichClient

func (*ImmichClient) AddAssetToAlbum

func (ic *ImmichClient) AddAssetToAlbum(ctx context.Context, albumID string, assets []string) ([]UpdateAlbumResult, error)

func (*ImmichClient) AssetUpload

func (ic *ImmichClient) AssetUpload(ctx context.Context, la *assets.Asset) (AssetResponse, error)

func (*ImmichClient) BulkTagAssets

func (ic *ImmichClient) BulkTagAssets(
	ctx context.Context,
	tagIDs []string,
	assetIDs []string,
) (struct {
	Count int `json:"count"`
}, error,
)

func (*ImmichClient) CopyAsset added in v0.29.0

func (ic *ImmichClient) CopyAsset(ctx context.Context, sourceID string, targetID string) error

CopyAsset copy metadata from the sourceID to targeID

func (*ImmichClient) CreateAlbum

func (ic *ImmichClient) CreateAlbum(ctx context.Context, name string, description string, assetsIDs []string) (assets.Album, error)

func (*ImmichClient) CreateJob

func (ic *ImmichClient) CreateJob(ctx context.Context, name JobName) error

func (*ImmichClient) CreateStack

func (ic *ImmichClient) CreateStack(ctx context.Context, ids []string) (string, error)

CreateStack create a stack with the given assets, the 1st asset is the cover, return the stack ID

func (*ImmichClient) DeleteAlbum

func (ic *ImmichClient) DeleteAlbum(ctx context.Context, id string) error

func (*ImmichClient) DeleteAssets

func (ic *ImmichClient) DeleteAssets(ctx context.Context, id []string, forceDelete bool) error

func (*ImmichClient) DownloadAsset

func (ic *ImmichClient) DownloadAsset(ctx context.Context, id string) (io.ReadCloser, error)

func (*ImmichClient) EnableAppTrace

func (ic *ImmichClient) EnableAppTrace(rtd RoundTripperDecorator)

func (*ImmichClient) GetAboutInfo added in v0.24.3

func (ic *ImmichClient) GetAboutInfo(ctx context.Context) (AboutInfo, error)

func (*ImmichClient) GetAlbumInfo

func (ic *ImmichClient) GetAlbumInfo(ctx context.Context, id string, withoutAssets bool) (AlbumContent, error)

func (*ImmichClient) GetAllAlbums

func (ic *ImmichClient) GetAllAlbums(ctx context.Context) ([]AlbumSimplified, error)

func (*ImmichClient) GetAllAssets

func (ic *ImmichClient) GetAllAssets(ctx context.Context, filter func(*Asset) error) error

func (*ImmichClient) GetAllAssetsWithFilter

func (ic *ImmichClient) GetAllAssetsWithFilter(ctx context.Context, query *SearchMetadataQuery, filter func(*Asset) error) error

func (*ImmichClient) GetAllPeople added in v0.29.0

func (ic *ImmichClient) GetAllPeople(ctx context.Context, opts ...GetAllPeopleOptions) (*PeopleResponseDto, error)

GetAllPeople retrieves all people from the Immich server This method implements the getAllPeople endpoint with pagination support

func (*ImmichClient) GetAllPeopleIterator added in v0.29.0

func (ic *ImmichClient) GetAllPeopleIterator(ctx context.Context, fn func(*PersonResponseDto) error, opts ...GetAllPeopleOptions) error

GetAllPeopleIterator retrieves all people using pagination automatically This is a convenience method that handles pagination internally

func (*ImmichClient) GetAllTags

func (ic *ImmichClient) GetAllTags(ctx context.Context) ([]TagSimplified, error)

func (*ImmichClient) GetAssetAlbums

func (ic *ImmichClient) GetAssetAlbums(ctx context.Context, assetID string) ([]AlbumSimplified, error)

func (*ImmichClient) GetAssetInfo

func (ic *ImmichClient) GetAssetInfo(ctx context.Context, id string) (*Asset, error)

getAssetInfo https://api.immich.app/endpoints/assets/getAssetInfo

func (*ImmichClient) GetAssetStatistics

func (ic *ImmichClient) GetAssetStatistics(ctx context.Context) (UserStatistics, error)

func (*ImmichClient) GetAssetsAlbums

func (ic *ImmichClient) GetAssetsAlbums(ctx context.Context, id string) ([]assets.Album, error)

func (*ImmichClient) GetAssetsByHash

func (ic *ImmichClient) GetAssetsByHash(ctx context.Context, hash string) ([]*Asset, error)

GetAssetByHash returns the asset with the given hash The hash is the base64 encoded sha1 of the file

func (*ImmichClient) GetAssetsByImageName

func (ic *ImmichClient) GetAssetsByImageName(ctx context.Context, name string) ([]*Asset, error)

GetAssetByHash returns the asset with the given hash The hash is the base64 encoded sha1 of the file

func (*ImmichClient) GetEndPoint

func (ic *ImmichClient) GetEndPoint() string

func (*ImmichClient) GetFilteredAssetsFn added in v0.29.0

func (ic *ImmichClient) GetFilteredAssetsFn(ctx context.Context, so *searchOptions, filter func(*Asset) error) error

func (*ImmichClient) GetJobs

func (ic *ImmichClient) GetJobs(ctx context.Context) (map[string]Job, error)

func (*ImmichClient) GetPeopleByNames added in v0.29.0

func (ic *ImmichClient) GetPeopleByNames(ctx context.Context, names []string, opts ...GetAllPeopleOptions) (map[string]*PersonResponseDto, error)

GetPeopleByNames finds multiple people by their names Returns a map of name to PersonResponseDto, missing names will not be in the map

func (*ImmichClient) GetPersonByName added in v0.29.0

func (ic *ImmichClient) GetPersonByName(ctx context.Context, name string, opts ...GetAllPeopleOptions) (*PersonResponseDto, error)

GetPersonByName finds a person by their name Returns nil if no person with the given name is found

func (*ImmichClient) GetSearchSuggestions added in v0.29.0

func (ic *ImmichClient) GetSearchSuggestions(ctx context.Context, req SearchSuggestionRequest) (SearchSuggestions, error)

GetSearchSuggestions retrieves search suggestions based on the provided request parameters

func (*ImmichClient) GetServerStatistics

func (ic *ImmichClient) GetServerStatistics(ctx context.Context) (ServerStatistics, error)

func (*ImmichClient) GetSupportedMediaTypes

func (ic *ImmichClient) GetSupportedMediaTypes(ctx context.Context) (filetypes.SupportedMedia, error)

func (*ImmichClient) IsExtensionPrefix

func (ic *ImmichClient) IsExtensionPrefix(ext string) bool

func (*ImmichClient) IsIgnoredExt

func (ic *ImmichClient) IsIgnoredExt(ext string) bool

func (*ImmichClient) PingServer

func (ic *ImmichClient) PingServer(ctx context.Context) error

Ping server

func (*ImmichClient) ReplaceAsset

func (ic *ImmichClient) ReplaceAsset(ctx context.Context, ID string, la *assets.Asset) (AssetResponse, error)

ReplaceAsset is deprecated, use CopyAsset

func (*ImmichClient) SendJobCommand

func (ic *ImmichClient) SendJobCommand(
	ctx context.Context,
	jobID string,
	command JobCommand,
	force bool,
) (resp SendJobCommandResponse, err error)

func (*ImmichClient) SetDeviceUUID

func (ic *ImmichClient) SetDeviceUUID(deviceUUID string)

func (*ImmichClient) SetEndPoint

func (ic *ImmichClient) SetEndPoint(endPoint string)

func (*ImmichClient) SignUpAdmin added in v0.29.0

func (ic *ImmichClient) SignUpAdmin(ctx context.Context, email, password, name string) (User, error)

func (*ImmichClient) SupportedMedia

func (ic *ImmichClient) SupportedMedia() filetypes.SupportedMedia

func (*ImmichClient) TagAssets

func (ic *ImmichClient) TagAssets(
	ctx context.Context,
	tagID string,
	assetIDs []string,
) ([]TagAssetsResponse, error)

func (*ImmichClient) TypeFromExt

func (ic *ImmichClient) TypeFromExt(ext string) string

func (*ImmichClient) UpdateAdminOnboarding added in v0.29.0

func (ic *ImmichClient) UpdateAdminOnboarding(ctx context.Context, isOnBoarded bool) error

func (*ImmichClient) UpdateAsset

func (ic *ImmichClient) UpdateAsset(ctx context.Context, id string, param UpdAssetField) (*Asset, error)

func (*ImmichClient) UpdateAssets

func (ic *ImmichClient) UpdateAssets(ctx context.Context, ids []string,
	isArchived bool, isFavorite bool,
	latitude float64, longitude float64,
	removeParent bool, stackParentID string,
) error

func (*ImmichClient) UpsertTags

func (ic *ImmichClient) UpsertTags(ctx context.Context, tags []string) ([]TagSimplified, error)

func (*ImmichClient) UserLogin added in v0.29.0

func (ic *ImmichClient) UserLogin(ctx context.Context, email, password string) (LoginResponseDto, error)

func (*ImmichClient) ValidateConnection

func (ic *ImmichClient) ValidateConnection(ctx context.Context) (User, error)

type ImmichClientInterface

type ImmichClientInterface interface {
	SetEndPoint(string)
	// EnableAppTrace by decorating the client's transport with round tripper that logs queries
	EnableAppTrace(rtd RoundTripperDecorator)
	SetDeviceUUID(string)
	PingServer(ctx context.Context) error
	ValidateConnection(ctx context.Context) (User, error)
	GetServerStatistics(ctx context.Context) (ServerStatistics, error)
	GetAssetStatistics(ctx context.Context) (UserStatistics, error)
	SupportedMedia() filetypes.SupportedMedia
	GetAboutInfo(ctx context.Context) (AboutInfo, error)
}

type ImmichExifTime

type ImmichExifTime struct {
	time.Time
}

func (ImmichExifTime) MarshalJSON

func (t ImmichExifTime) MarshalJSON() ([]byte, error)

func (*ImmichExifTime) UnmarshalJSON

func (t *ImmichExifTime) UnmarshalJSON(b []byte) error

type ImmichGetSuggestion added in v0.29.0

type ImmichGetSuggestion interface {
	GetSearchSuggestions(ctx context.Context, req SearchSuggestionRequest) (SearchSuggestions, error)
}

ImmichGetSuggestion is not a part of the immich client interface to simplify the client mokes

type ImmichInterface

ImmichInterface is an interface that implements the minimal immich client set of features for uploading interface used to mock up the client

type ImmichJobInterface

type ImmichJobInterface interface {
	GetJobs(ctx context.Context) (map[string]Job, error)
	SendJobCommand(
		ctx context.Context,
		jobID string,
		command JobCommand,
		force bool,
	) (SendJobCommandResponse, error)
	CreateJob(ctx context.Context, name JobName) error
}

type ImmichPeopleInterface added in v0.29.0

type ImmichPeopleInterface interface {
	GetAllPeople(ctx context.Context, opts ...GetAllPeopleOptions) (*PeopleResponseDto, error)
	GetAllPeopleIterator(ctx context.Context, fn func(*PersonResponseDto) error, opts ...GetAllPeopleOptions) error
	GetPersonByName(ctx context.Context, name string, opts ...GetAllPeopleOptions) (*PersonResponseDto, error)
	GetPeopleByNames(ctx context.Context, names []string, opts ...GetAllPeopleOptions) (map[string]*PersonResponseDto, error)
}

type ImmichStackInterface

type ImmichStackInterface interface {
	// CreateStack create a stack with the given assets, the 1st asset is the cover, return the stack ID
	CreateStack(ctx context.Context, ids []string) (string, error)
}

type ImmichTagInterface

type ImmichTagInterface interface {
	GetAllTags(ctx context.Context) ([]TagSimplified, error)
	UpsertTags(ctx context.Context, tags []string) ([]TagSimplified, error)
	TagAssets(
		ctx context.Context,
		tagID string,
		assetIDs []string,
	) ([]TagAssetsResponse, error)
	BulkTagAssets(
		ctx context.Context,
		tagIDs []string,
		assetIDs []string,
	) (struct {
		Count int `json:"count"`
	}, error)
}

type ImmichTime

type ImmichTime struct {
	time.Time
}

func (ImmichTime) MarshalJSON

func (t ImmichTime) MarshalJSON() ([]byte, error)

func (*ImmichTime) UnmarshalJSON

func (t *ImmichTime) UnmarshalJSON(b []byte) error

type Job

type Job struct {
	JobCounts struct {
		Active    int `json:"active"`
		Completed int `json:"completed"`
		Failed    int `json:"failed"`
		Delayed   int `json:"delayed"`
		Waiting   int `json:"waiting"`
		Paused    int `json:"paused"`
	} `json:"jobCounts"`
	QueueStatus struct {
		IsActive bool `json:"isActive"`
		IsPaused bool `json:"isPaused"`
	} `json:"queueStatus"`
}

type JobCommand

type JobCommand string
const (
	Start       JobCommand = "start"
	Pause       JobCommand = "pause"
	Resume      JobCommand = "resume"
	Empty       JobCommand = "empty"
	ClearFailed JobCommand = "clear-failed"
)

type JobID

type JobID string
const (
	StorageTemplateMigration JobID = "storageTemplateMigration"
)

type JobName

type JobName string
const (
	PersonCleanup JobName = "person-cleanup"
	TagCleanup    JobName = "tag-cleanup"
	UserCleanup   JobName = "user-cleanup"
)

type LoginCredentialDto added in v0.29.0

type LoginCredentialDto struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type LoginResponseDto added in v0.29.0

type LoginResponseDto struct {
	AccessToken          string `json:"accessToken"`
	IsAdmin              bool   `json:"isAdmin"`
	IsOnboarded          bool   `json:"isOnboarded"`
	Name                 string `json:"name"`
	ProfileImagePath     string `json:"profileImagePath"`
	ShouldChangePassword bool   `json:"shouldChangePassword"`
	UserEmail            string `json:"userEmail"`
	UserID               string `json:"userId"`
}

type PeopleResponseDto added in v0.29.0

type PeopleResponseDto struct {
	HasNextPage bool                `json:"hasNextPage,omitempty"` // Added in v1.110.0
	Hidden      int                 `json:"hidden"`
	Total       int                 `json:"total"`
	People      []PersonResponseDto `json:"people"`
}

PeopleResponseDto represents the response from the getAllPeople endpoint

type PersonResponseDto added in v0.29.0

type PersonResponseDto struct {
	ID            string     `json:"id"`
	Name          string     `json:"name"`
	BirthDate     ImmichTime `json:"birthDate,omitzero"`
	Color         string     `json:"color,omitempty"`      // Added in v1.126.0
	IsFavorite    bool       `json:"isFavorite,omitempty"` // Added in v1.126.0
	IsHidden      bool       `json:"isHidden"`
	ThumbnailPath string     `json:"thumbnailPath"`
	UpdatedAt     ImmichTime `json:"updatedAt,omitempty"` // Added in v1.107.0
}

PersonResponseDto represents a person in the Immich system

type PingResponse

type PingResponse struct {
	Res string `json:"res"`
}

type RoundTripperDecorator added in v0.29.0

type RoundTripperDecorator func(rt http.RoundTripper) http.RoundTripper

type SearchMetadataQuery

type SearchMetadataQuery struct {
	// pagination
	Page int `json:"page"`
	Size int `json:"size,omitempty"`

	// filters
	WithExif         bool              `json:"withExif,omitempty"`
	IsFavorite       bool              `json:"isFavorite,omitempty"`
	IsNotInAlbum     bool              `json:"isNotInAlbum,omitempty"`
	WithDeleted      bool              `json:"withDeleted,omitempty"`
	AlbumIds         []string          `json:"albumIds,omitempty"`
	TagIds           []string          `json:"tagIds,omitempty"`
	PersonIds        []string          `json:"personIds,omitempty"`
	TakenBefore      string            `json:"takenBefore,omitzero"`
	TakenAfter       string            `json:"takenAfter,omitzero"`
	TrashedAfter     string            `json:"trashedAfter,omitzero"`
	TrashedBefore    string            `json:"trashedBefore,omitzero"`
	Model            string            `json:"model,omitempty"`
	Make             string            `json:"make,omitempty"`
	Country          string            `json:"country,omitempty"`
	State            string            `json:"state,omitempty"`
	City             string            `json:"city,omitempty"`
	Checksum         string            `json:"checksum,omitempty"`
	OriginalFileName string            `json:"originalFileName,omitempty"`
	Rating           int               `json:"rating,omitzero"`
	Visibility       assets.Visibility `json:"visibility,omitempty"`
	Order            string            `json:"order,omitempty"`
}

type SearchSuggestionRequest added in v0.29.0

type SearchSuggestionRequest struct {
	Type        SearchSuggestionType `json:"type"`
	Country     string               `json:"country,omitempty"`
	State       string               `json:"state,omitempty"`
	Make        string               `json:"make,omitempty"`
	Model       string               `json:"model,omitempty"`
	IncludeNull bool                 `json:"includeNull,omitzero"`
}

SearchSuggestionRequest represents the request parameters for getSearchSuggestions

func (SearchSuggestionRequest) SetURL added in v0.29.0

func (q SearchSuggestionRequest) SetURL(u *url.URL) error

type SearchSuggestionType added in v0.29.0

type SearchSuggestionType string

SearchSuggestionType represents the type of search suggestions to retrieve

const (
	SearchSuggestionTypeCountry     SearchSuggestionType = "country"
	SearchSuggestionTypeState       SearchSuggestionType = "state"
	SearchSuggestionTypeCity        SearchSuggestionType = "city"
	SearchSuggestionTypeCameraMake  SearchSuggestionType = "camera-make"
	SearchSuggestionTypeCameraModel SearchSuggestionType = "camera-model"
)

type SearchSuggestions added in v0.29.0

type SearchSuggestions []string

SearchSuggestions represents the response from getSearchSuggestions: a list of suggestion strings

type SendJobCommandResponse

type SendJobCommandResponse struct {
	JobCounts struct {
		Active    int `json:"active"`
		Completed int `json:"completed"`
		Delayed   int `json:"delayed"`
		Failed    int `json:"failed"`
		Paused    int `json:"paused"`
		Waiting   int `json:"waiting"`
	} `json:"jobCounts"`
	QueueStatus struct {
		IsActive bool `json:"isActive"`
		IsPause  bool `json:"isPause"`
	}
}

type ServerErrorMessage

type ServerErrorMessage struct {
	Error         string `json:"error"`
	StatusCode    int    `json:"statusCode"`
	Message       string `json:"message"`
	CorrelationID string `json:"correlationId"`
}

type ServerStatistics

type ServerStatistics struct {
	Photos      int   `json:"photos"`
	Videos      int   `json:"videos"`
	Usage       int64 `json:"usage"`
	UsageByUser []struct {
		UserID           string `json:"userId"`
		UserName         string `json:"userName"`
		Photos           int    `json:"photos"`
		Videos           int    `json:"videos"`
		Usage            int64  `json:"usage"`
		QuotaSizeInBytes any    `json:"quotaSizeInBytes"`
	} `json:"usageByUser"`
}

type SignupDto added in v0.29.0

type SignupDto struct {
	Email    string `json:"email"`
	Password string `json:"password"`
	Name     string `json:"name"`
}

type TagAssetsResponse

type TagAssetsResponse struct {
	Error   string `json:"error,omitempty"` // [duplicate, no_permission, not_found, unknown]
	ID      string `json:"id"`
	Success bool   `json:"success"`
}

type TagSimplified

type TagSimplified struct {
	ID    string `json:"id"`
	Name  string `json:"name"`
	Value string `json:"value"`
}

func (TagSimplified) AsTag

func (ts TagSimplified) AsTag() assets.Tag

type TooManyInternalError

type TooManyInternalError struct {
	// contains filtered or unexported fields
}

func (TooManyInternalError) Is

func (e TooManyInternalError) Is(target error) bool

type URLRequester added in v0.29.0

type URLRequester interface {
	SetURL(u *url.URL) error
}

type UnsupportedMedia

type UnsupportedMedia struct {
	// contains filtered or unexported fields
}

func (UnsupportedMedia) Error

func (u UnsupportedMedia) Error() string

func (UnsupportedMedia) Is

func (u UnsupportedMedia) Is(target error) bool

type UpdAssetField

type UpdAssetField struct {
	IsArchived       bool      `json:"isArchived,omitempty"`
	IsFavorite       bool      `json:"isFavorite,omitempty"`
	Latitude         float64   `json:"latitude,omitempty"`
	Longitude        float64   `json:"longitude,omitempty"`
	Description      string    `json:"description,omitempty"`
	Rating           int       `json:"rating,omitempty"`
	DateTimeOriginal time.Time `json:"dateTimeOriginal,omitempty"`
}

UpdAssetField is used to update asset with fields given in the struct fields

func (UpdAssetField) MarshalJSON added in v0.25.2

func (u UpdAssetField) MarshalJSON() ([]byte, error)

MarshalJSON customizes the JSON marshaling for the UpdAssetField struct. If either Latitude or Longitude is non-zero, it includes them in the JSON output. Otherwise, it omits them by using the alias type.

type UpdateAlbum

type UpdateAlbum struct {
	IDS []string `json:"ids"`
}

type UpdateAlbumResult

type UpdateAlbumResult struct {
	ID      string `json:"id"`
	Success bool   `json:"success"`
	Error   string `json:"error,omitempty"`
}

type User

type User struct {
	ID                   string    `json:"id"`
	Email                string    `json:"email"`
	FirstName            string    `json:"firstName"`
	LastName             string    `json:"lastName"`
	StorageLabel         string    `json:"storageLabel"`
	ExternalPath         string    `json:"externalPath"`
	ProfileImagePath     string    `json:"profileImagePath"`
	ShouldChangePassword bool      `json:"shouldChangePassword"`
	IsAdmin              bool      `json:"isAdmin"`
	CreatedAt            time.Time `json:"createdAt"`
	DeletedAt            time.Time `json:"deletedAt"`
	UpdatedAt            time.Time `json:"updatedAt"`
	OauthID              string    `json:"oauthId"`
}

type UserAdminResponseDto added in v0.29.0

type UserAdminResponseDto struct {
	CreatedAt            string     `json:"createdAt"`
	DeletedAt            string     `json:"deletedAt,omitempty"`
	Email                string     `json:"email"`
	ID                   string     `json:"id"`
	IsAdmin              bool       `json:"isAdmin"`
	Name                 string     `json:"name"`
	OauthID              string     `json:"oauthId"`
	ProfileChangedAt     string     `json:"profileChangedAt"`
	ProfileImagePath     string     `json:"profileImagePath"`
	QuotaSizeInBytes     int64      `json:"quotaSizeInBytes,omitempty"`
	QuotaUsageInBytes    int64      `json:"quotaUsageInBytes,omitempty"`
	ShouldChangePassword bool       `json:"shouldChangePassword"`
	Status               UserStatus `json:"status"`
	StorageLabel         string     `json:"storageLabel,omitempty"`
	UpdatedAt            string     `json:"updatedAt"`
}

type UserStatistics

type UserStatistics struct {
	Images int `json:"images"`
	Videos int `json:"videos"`
	Total  int `json:"total"`
}

type UserStatus added in v0.29.0

type UserStatus string
const (
	UserStatusActive   UserStatus = "active"
	UserStatusRemoving UserStatus = "removing"
	UserStatusDeleted  UserStatus = "deleted"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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