Test bed for me to play with go. This will watch a folder and uploading anything new to Flickr, including videos.
-- import "github.com/Reisender/photosync"
func LoadConfig(configPath *string) error
Load the consumer key and secret in from the config file
func Sync(api *FlickrAPI, photos *PhotosMap, dryrun bool) (int, int, error)
type Error struct {
}
API Error type
func (e Error) Error() string
type FlickrAPI struct {
FlickrUserId string `json:"flickr_user_id"`
}
func NewFlickrAPI() *FlickrAPI
func (this *FlickrAPI) Download(info *PhotoInfo, p *Photo)
func (this *FlickrAPI) GetExtention(info *PhotoInfo) (string, error)
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) SetTitle(p *Photo, title string) error
func (this *FlickrAPI) Upload(path string, file os.FileInfo) (*FlickrUploadResponse, error)
type FlickrApiResponse struct {
Stat string
Data struct {
Page int
Pages int
Perpage int
Total string
Photos []Photo `json:"photo"`
} `json:"photos"`
User FlickrUser `json:"user"`
PhotoDetails PhotoInfo `json:"photo"`
SizeData struct {
Sizes []PhotoSize `json:"size"`
} `json:"sizes"`
}
type FlickrUploadResponse struct {
XMLName xml.Name `xml:"rsp"`
Status string `xml:"stat,attr"`
PhotoId string `xml:"photoid"`
}
type FlickrUser struct {
Id string
Username struct {
Content string `json:"_content"`
} `json:"username"`
}
type OauthConfig struct {
Consumer oauth.Credentials
Access oauth.Credentials
}
type Photo struct {
Id string
Owner string
Secret string
Title string
Ispublic int `json:"string"`
Isfriend int `json:"string"`
Isfamily int `json:"string"`
}
type PhotoInfo struct {
Rotation int
Originalformat string
Media string
}
type PhotoSize struct {
Label string
Source string
}
type PhotosMap map[string]Photo
type PhotosyncConfig struct {
OauthConfig
WatchDir string `json:"watch_dir"`
}