Skip to content

Test bed for me to play with go. This will watch a folder and uploading anything new to Flickr, including videos.

License

Notifications You must be signed in to change notification settings

doweber/photosync

Repository files navigation

PhotoSync

Test bed for me to play with go. This will watch a folder and uploading anything new to Flickr, including videos.

photosync

-- import "github.com/Reisender/photosync"

Usage

func LoadConfig

func LoadConfig(configPath *string) error

Load the consumer key and secret in from the config file

func Sync

func Sync(api *FlickrAPI, photos *PhotosMap, dryrun bool) (int, int, error)

type Error

type Error struct {
}

API Error type

func (Error) Error

func (e Error) Error() string

type FlickrAPI

type FlickrAPI struct {
	FlickrUserId string `json:"flickr_user_id"`
}

func NewFlickrAPI

func NewFlickrAPI() *FlickrAPI

func (*FlickrAPI) Download

func (this *FlickrAPI) Download(info *PhotoInfo, p *Photo)

func (*FlickrAPI) GetExtention

func (this *FlickrAPI) GetExtention(info *PhotoInfo) (string, error)

func (*FlickrAPI) GetInfo

func (this *FlickrAPI) GetInfo(p *Photo) (*PhotoInfo, error)

func (*FlickrAPI) GetLogin

func (this *FlickrAPI) GetLogin() (*FlickrUser, error)

func (*FlickrAPI) GetPhotos

func (this *FlickrAPI) GetPhotos(user *FlickrUser) (*PhotosMap, error)

func (*FlickrAPI) GetSizes

func (this *FlickrAPI) GetSizes(p *Photo) (*[]PhotoSize, error)

func (*FlickrAPI) SetTitle

func (this *FlickrAPI) SetTitle(p *Photo, title string) error

func (*FlickrAPI) Upload

func (this *FlickrAPI) Upload(path string, file os.FileInfo) (*FlickrUploadResponse, error)

type FlickrApiResponse

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

type FlickrUploadResponse struct {
	XMLName xml.Name `xml:"rsp"`
	Status  string   `xml:"stat,attr"`
	PhotoId string   `xml:"photoid"`
}

type FlickrUser

type FlickrUser struct {
	Id       string
	Username struct {
		Content string `json:"_content"`
	} `json:"username"`
}

type OauthConfig

type OauthConfig struct {
	Consumer oauth.Credentials
	Access   oauth.Credentials
}

type Photo

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

type PhotoInfo struct {
	Rotation       int
	Originalformat string
	Media          string
}

type PhotoSize

type PhotoSize struct {
	Label  string
	Source string
}

type PhotosMap

type PhotosMap map[string]Photo

type PhotosyncConfig

type PhotosyncConfig struct {
	OauthConfig
	WatchDir string `json:"watch_dir"`
}

About

Test bed for me to play with go. This will watch a folder and uploading anything new to Flickr, including videos.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages