Documentation
¶
Index ¶
- Constants
- func AlbumsFromAlbumSimplified(albums []AlbumSimplified) []assets.Album
- func OptionConnectionTimeout(d time.Duration) clientOption
- func OptionDryRun(dryRun bool) clientOption
- func OptionSetAPITrace(rtd RoundTripperDecorator) clientOption
- func OptionVerifySSL(verify bool) clientOption
- func SearchOptions() *searchOptions
- func UrlRequest(ur URLRequester) serverRequestOption
- type AboutInfo
- type AdminOnboardingUpdateDto
- type AlbumContent
- type AlbumSimplified
- type Asset
- type AssetResponse
- type AssetSimplified
- type ExifInfo
- type GetAllPeopleOptions
- type GetAssetOptions
- type ImmichAlbumInterface
- type ImmichAssetInterface
- type ImmichClient
- func (ic *ImmichClient) AddAssetToAlbum(ctx context.Context, albumID string, assets []string) ([]UpdateAlbumResult, error)
- func (ic *ImmichClient) AssetUpload(ctx context.Context, la *assets.Asset) (AssetResponse, error)
- func (ic *ImmichClient) BulkTagAssets(ctx context.Context, tagIDs []string, assetIDs []string) (struct{ ... }, error)
- func (ic *ImmichClient) CopyAsset(ctx context.Context, sourceID string, targetID string) error
- func (ic *ImmichClient) CreateAlbum(ctx context.Context, name string, description string, assetsIDs []string) (assets.Album, error)
- func (ic *ImmichClient) CreateJob(ctx context.Context, name JobName) error
- func (ic *ImmichClient) CreateStack(ctx context.Context, ids []string) (string, error)
- func (ic *ImmichClient) DeleteAlbum(ctx context.Context, id string) error
- func (ic *ImmichClient) DeleteAssets(ctx context.Context, id []string, forceDelete bool) error
- func (ic *ImmichClient) DownloadAsset(ctx context.Context, id string) (io.ReadCloser, error)
- func (ic *ImmichClient) EnableAppTrace(rtd RoundTripperDecorator)
- func (ic *ImmichClient) GetAboutInfo(ctx context.Context) (AboutInfo, error)
- func (ic *ImmichClient) GetAlbumInfo(ctx context.Context, id string, withoutAssets bool) (AlbumContent, error)
- func (ic *ImmichClient) GetAllAlbums(ctx context.Context) ([]AlbumSimplified, error)
- func (ic *ImmichClient) GetAllAssets(ctx context.Context, filter func(*Asset) error) error
- func (ic *ImmichClient) GetAllAssetsWithFilter(ctx context.Context, query *SearchMetadataQuery, filter func(*Asset) error) error
- func (ic *ImmichClient) GetAllPeople(ctx context.Context, opts ...GetAllPeopleOptions) (*PeopleResponseDto, error)
- func (ic *ImmichClient) GetAllPeopleIterator(ctx context.Context, fn func(*PersonResponseDto) error, ...) error
- func (ic *ImmichClient) GetAllTags(ctx context.Context) ([]TagSimplified, error)
- func (ic *ImmichClient) GetAssetAlbums(ctx context.Context, assetID string) ([]AlbumSimplified, error)
- func (ic *ImmichClient) GetAssetInfo(ctx context.Context, id string) (*Asset, error)
- func (ic *ImmichClient) GetAssetStatistics(ctx context.Context) (UserStatistics, error)
- func (ic *ImmichClient) GetAssetsAlbums(ctx context.Context, id string) ([]assets.Album, error)
- func (ic *ImmichClient) GetAssetsByHash(ctx context.Context, hash string) ([]*Asset, error)
- func (ic *ImmichClient) GetAssetsByImageName(ctx context.Context, name string) ([]*Asset, error)
- func (ic *ImmichClient) GetEndPoint() string
- func (ic *ImmichClient) GetFilteredAssetsFn(ctx context.Context, so *searchOptions, filter func(*Asset) error) error
- func (ic *ImmichClient) GetJobs(ctx context.Context) (map[string]Job, error)
- func (ic *ImmichClient) GetPeopleByNames(ctx context.Context, names []string, opts ...GetAllPeopleOptions) (map[string]*PersonResponseDto, error)
- func (ic *ImmichClient) GetPersonByName(ctx context.Context, name string, opts ...GetAllPeopleOptions) (*PersonResponseDto, error)
- func (ic *ImmichClient) GetSearchSuggestions(ctx context.Context, req SearchSuggestionRequest) (SearchSuggestions, error)
- func (ic *ImmichClient) GetServerStatistics(ctx context.Context) (ServerStatistics, error)
- func (ic *ImmichClient) GetSupportedMediaTypes(ctx context.Context) (filetypes.SupportedMedia, error)
- func (ic *ImmichClient) IsExtensionPrefix(ext string) bool
- func (ic *ImmichClient) IsIgnoredExt(ext string) bool
- func (ic *ImmichClient) PingServer(ctx context.Context) error
- func (ic *ImmichClient) ReplaceAsset(ctx context.Context, ID string, la *assets.Asset) (AssetResponse, error)
- func (ic *ImmichClient) SendJobCommand(ctx context.Context, jobID string, command JobCommand, force bool) (resp SendJobCommandResponse, err error)
- func (ic *ImmichClient) SetDeviceUUID(deviceUUID string)
- func (ic *ImmichClient) SetEndPoint(endPoint string)
- func (ic *ImmichClient) SignUpAdmin(ctx context.Context, email, password, name string) (User, error)
- func (ic *ImmichClient) SupportedMedia() filetypes.SupportedMedia
- func (ic *ImmichClient) TagAssets(ctx context.Context, tagID string, assetIDs []string) ([]TagAssetsResponse, error)
- func (ic *ImmichClient) TypeFromExt(ext string) string
- func (ic *ImmichClient) UpdateAdminOnboarding(ctx context.Context, isOnBoarded bool) error
- func (ic *ImmichClient) UpdateAsset(ctx context.Context, id string, param UpdAssetField) (*Asset, error)
- func (ic *ImmichClient) UpdateAssets(ctx context.Context, ids []string, isArchived bool, isFavorite bool, ...) error
- func (ic *ImmichClient) UpsertTags(ctx context.Context, tags []string) ([]TagSimplified, error)
- func (ic *ImmichClient) UserLogin(ctx context.Context, email, password string) (LoginResponseDto, error)
- func (ic *ImmichClient) ValidateConnection(ctx context.Context) (User, error)
- type ImmichClientInterface
- type ImmichExifTime
- type ImmichGetSuggestion
- type ImmichInterface
- type ImmichJobInterface
- type ImmichPeopleInterface
- type ImmichStackInterface
- type ImmichTagInterface
- type ImmichTime
- type Job
- type JobCommand
- type JobID
- type JobName
- type LoginCredentialDto
- type LoginResponseDto
- type PeopleResponseDto
- type PersonResponseDto
- type PingResponse
- type RoundTripperDecorator
- type SearchMetadataQuery
- type SearchSuggestionRequest
- type SearchSuggestionType
- type SearchSuggestions
- type SendJobCommandResponse
- type ServerErrorMessage
- type ServerStatistics
- type SignupDto
- type TagAssetsResponse
- type TagSimplified
- type TooManyInternalError
- type URLRequester
- type UnsupportedMedia
- type UpdAssetField
- type UpdateAlbum
- type UpdateAlbumResult
- type User
- type UserAdminResponseDto
- type UserStatistics
- type UserStatus
Constants ¶
const ( UploadCreated = "created" UploadReplaced = "replaced" UploadDuplicate = "duplicate" )
const ( StatusCreated = "created" StatusReplaced = "replaced" StatusDuplicate = "duplicate" )
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" )
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 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 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
type AssetResponse ¶
type AssetSimplified ¶
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
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 (*ImmichClient) CopyAsset ¶ added in v0.29.0
CopyAsset copy metadata from the sourceID to targeID
func (*ImmichClient) CreateAlbum ¶
func (*ImmichClient) CreateJob ¶
func (ic *ImmichClient) CreateJob(ctx context.Context, name JobName) error
func (*ImmichClient) CreateStack ¶
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 (*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 (*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 ¶
getAssetInfo https://api.immich.app/endpoints/assets/getAssetInfo
func (*ImmichClient) GetAssetStatistics ¶
func (ic *ImmichClient) GetAssetStatistics(ctx context.Context) (UserStatistics, error)
func (*ImmichClient) GetAssetsAlbums ¶
func (*ImmichClient) GetAssetsByHash ¶
GetAssetByHash returns the asset with the given hash The hash is the base64 encoded sha1 of the file
func (*ImmichClient) GetAssetsByImageName ¶
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 (*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 (*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 (*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 ¶
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 ¶
type ImmichInterface interface {
ImmichAssetInterface
ImmichClientInterface
ImmichAlbumInterface
ImmichTagInterface
ImmichStackInterface
ImmichJobInterface
}
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 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 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 ¶
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 LoginCredentialDto ¶ added in v0.29.0
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
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 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 TagAssetsResponse ¶
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 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 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 UserStatus ¶ added in v0.29.0
type UserStatus string
const ( UserStatusActive UserStatus = "active" UserStatusRemoving UserStatus = "removing" UserStatusDeleted UserStatus = "deleted" )