Documentation ¶
Index ¶
- Constants
- func FixExif(title string, path string, f os.FileInfo) (string, func(api *FlickrAPI, photoId string), error)
- func GetAllExifData(path string) (*[]ExifToolOutput, error)
- func LoadConfig(configPath *string, config *PhotosyncConfig) error
- func Sync(api *FlickrAPI, photos *PhotosMap, videos *PhotosMap, albums *AlbumsMap, ...) (int, int, int, int, error)
- type Album
- type AlbumsMap
- type DynamicValueContext
- type Error
- type ExifToolOutput
- type FilenameConfig
- type FilenameTimeFormat
- type FlexInt
- type FlickrAPI
- func (this *FlickrAPI) AddTags(photoId, tags string) error
- func (this *FlickrAPI) AddToAlbum(photoId string, album *Album) error
- func (this *FlickrAPI) Download(info *PhotoInfo, p *Photo) error
- func (this *FlickrAPI) GetAlbums(user *FlickrUser) (*AlbumsMap, error)
- func (this *FlickrAPI) GetExtention(info *PhotoInfo) (string, error)
- func (this *FlickrAPI) GetFilenamesConfig() []FilenameConfig
- func (this *FlickrAPI) GetInfo(p *Photo) (*PhotoInfo, error)
- func (this *FlickrAPI) GetLogin() (*FlickrUser, error)
- func (this *FlickrAPI) GetPhotos(user *FlickrUser) (*PhotosMap, error)
- func (this *FlickrAPI) GetSizes(p *Photo) (*[]PhotoSize, error)
- func (this *FlickrAPI) GetVideos(user *FlickrUser) (*PhotosMap, error)
- func (this *FlickrAPI) LoadAlbumPhotos(album *Album) error
- func (this *FlickrAPI) Search(form *url.Values) (*PhotosMap, error)
- func (this *FlickrAPI) SetAlbumOrder(photoSetId string, photoIds []string) error
- func (this *FlickrAPI) SetAlbumPhoto(photoId, photoSetId string) error
- func (this *FlickrAPI) SetDate(photoId, date string) error
- func (this *FlickrAPI) SetTitle(photo_id, title string) error
- func (this *FlickrAPI) Upload(path string, file os.FileInfo) (*FlickrUploadResponse, error)
- type FlickrAlbumPhotosResponse
- type FlickrAlbumsResponse
- type FlickrApiResponse
- type FlickrBaseApiResponse
- type FlickrPagedResponse
- type FlickrResponse
- type FlickrUploadResponse
- type FlickrUser
- type OauthConfig
- type Options
- type Photo
- type PhotoInfo
- type PhotoSet
- type PhotoSize
- type PhotosMap
- type PhotosyncConfig
- type WatchDirConfig
Constants ¶
View Source
const ExifTimeLayout = "2006:01:02 15:04:05"
View Source
const FilenameTimeLayout = "20060102_150405"
time formats
View Source
const FlickrTimeLayout = "2006-01-02 15:04:05"
Variables ¶
This section is empty.
Functions ¶
func FixExif ¶
func FixExif(title string, path string, f os.FileInfo) (string, func(api *FlickrAPI, photoId string), error)
Checks the EXIF data for JPGs and returns the path to either the original or the fixed JPG file. The 2nd return value should be called when use of the JPG is complete. workingFile, done, err := FixExif(...) defer done()
func GetAllExifData ¶
func GetAllExifData(path string) (*[]ExifToolOutput, error)
func LoadConfig ¶
func LoadConfig(configPath *string, config *PhotosyncConfig) error
Load the consumer key and secret in from the config file
Types ¶
type Album ¶
type DynamicValueContext ¶
type DynamicValueContext struct {
// contains filtered or unexported fields
}
Context for dynamic values in the config
func (*DynamicValueContext) ExifDate ¶
func (this *DynamicValueContext) ExifDate() (string, error)
func (*DynamicValueContext) Folders ¶
func (this *DynamicValueContext) Folders() (string, error)
type ExifToolOutput ¶
type ExifToolOutput struct { SourceFile string ExifTool struct { Warning string } Ifd struct { Orientation string Make string Model string ModifyDate string } `json:"IFD0"` }
func GetExifData ¶
func GetExifData(path string) (*ExifToolOutput, error)
type FilenameConfig ¶
type FilenameConfig struct { Match string `json:"match"` Append string Prepend string // contains filtered or unexported fields }
func (*FilenameConfig) GetNewPath ¶
func (this *FilenameConfig) GetNewPath(path string, dirCfg *WatchDirConfig, exif *ExifToolOutput) (string, string, bool)
func (*FilenameConfig) Load ¶
func (this *FilenameConfig) Load() error
type FilenameTimeFormat ¶
type FlexInt ¶
type FlexInt int
Be more flexible when un-marshaling from json. Unmarshal from int or string.
func (*FlexInt) UnmarshalJSON ¶
type FlickrAPI ¶
type FlickrAPI struct { FlickrUserId string `json:"flickr_user_id"` // contains filtered or unexported fields }
func NewFlickrAPI ¶
func NewFlickrAPI(config *PhotosyncConfig) *FlickrAPI
func (*FlickrAPI) AddToAlbum ¶
func (*FlickrAPI) GetAlbums ¶
func (this *FlickrAPI) GetAlbums(user *FlickrUser) (*AlbumsMap, error)
func (*FlickrAPI) GetExtention ¶
func (*FlickrAPI) GetFilenamesConfig ¶
func (this *FlickrAPI) GetFilenamesConfig() []FilenameConfig
func (*FlickrAPI) GetLogin ¶
func (this *FlickrAPI) GetLogin() (*FlickrUser, error)
func (*FlickrAPI) GetPhotos ¶
func (this *FlickrAPI) GetPhotos(user *FlickrUser) (*PhotosMap, error)
func (*FlickrAPI) GetVideos ¶
func (this *FlickrAPI) GetVideos(user *FlickrUser) (*PhotosMap, error)
func (*FlickrAPI) LoadAlbumPhotos ¶
func (*FlickrAPI) SetAlbumOrder ¶
func (*FlickrAPI) SetAlbumPhoto ¶
type FlickrAlbumPhotosResponse ¶
type FlickrAlbumPhotosResponse struct { FlickrBaseApiResponse Data struct { Photos []Photo `json:"photo"` // contains filtered or unexported fields } `json:"photoset"` }
func (FlickrAlbumPhotosResponse) Page ¶
func (this FlickrAlbumPhotosResponse) Page() int
func (FlickrAlbumPhotosResponse) Pages ¶
func (this FlickrAlbumPhotosResponse) Pages() int
func (FlickrAlbumPhotosResponse) PerPage ¶
func (this FlickrAlbumPhotosResponse) PerPage() int
func (*FlickrAlbumPhotosResponse) Reset ¶
func (this *FlickrAlbumPhotosResponse) Reset()
func (FlickrAlbumPhotosResponse) Total ¶
func (this FlickrAlbumPhotosResponse) Total() int
type FlickrAlbumsResponse ¶
type FlickrAlbumsResponse struct { FlickrBaseApiResponse Data struct { Albums []Album `json:"photoset"` // contains filtered or unexported fields } `json:"photosets"` }
func (FlickrAlbumsResponse) Page ¶
func (this FlickrAlbumsResponse) Page() int
func (FlickrAlbumsResponse) Pages ¶
func (this FlickrAlbumsResponse) Pages() int
func (FlickrAlbumsResponse) PerPage ¶
func (this FlickrAlbumsResponse) PerPage() int
func (*FlickrAlbumsResponse) Reset ¶
func (this *FlickrAlbumsResponse) Reset()
func (FlickrAlbumsResponse) Total ¶
func (this FlickrAlbumsResponse) Total() int
type FlickrApiResponse ¶
type FlickrApiResponse struct { FlickrBaseApiResponse Data struct { Photos []Photo `json:"photo"` // contains filtered or unexported fields } `json:"photos"` User FlickrUser `json:"user"` PhotoDetails PhotoInfo `json:"photo"` SizeData struct { Sizes []PhotoSize `json:"size"` } `json:"sizes"` }
func (FlickrApiResponse) Page ¶
func (this FlickrApiResponse) Page() int
func (FlickrApiResponse) Pages ¶
func (this FlickrApiResponse) Pages() int
func (FlickrApiResponse) PerPage ¶
func (this FlickrApiResponse) PerPage() int
func (*FlickrApiResponse) Reset ¶
func (this *FlickrApiResponse) Reset()
func (FlickrApiResponse) Total ¶
func (this FlickrApiResponse) Total() int
type FlickrBaseApiResponse ¶
type FlickrBaseApiResponse struct {
Stat string
}
func (FlickrBaseApiResponse) Success ¶
func (this FlickrBaseApiResponse) Success() bool
type FlickrPagedResponse ¶
type FlickrResponse ¶
type FlickrResponse interface {
Success() bool
}
type FlickrUploadResponse ¶
type FlickrUser ¶
type OauthConfig ¶
type OauthConfig struct { Consumer oauth.Credentials Access oauth.Credentials }
type PhotosyncConfig ¶
type PhotosyncConfig struct { OauthConfig Filenames []FilenameConfig `json:"filenames"` WatchDir []WatchDirConfig `json:"directories"` FilenameTimeFormats []FilenameTimeFormat `json:"filename_time_formats"` }
type WatchDirConfig ¶
type WatchDirConfig struct { Dir string Tags string Albums []string // contains filtered or unexported fields }
func (*WatchDirConfig) CreateTemplates ¶
func (this *WatchDirConfig) CreateTemplates()
func (*WatchDirConfig) GetAlbums ¶
func (this *WatchDirConfig) GetAlbums(context *DynamicValueContext) []string
func (*WatchDirConfig) GetTags ¶
func (this *WatchDirConfig) GetTags(context *DynamicValueContext) (string, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.