photos

package
v0.0.0-...-6a20b66 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTags

func AddTags(client *flickr.FlickrClient, photoId string, tags []string) error

AddTags add tags to an existing photo

func Delete

func Delete(client *flickr.FlickrClient, id string) (*flickr.BasicResponse, error)

Delete a photo from Flickr This method requires authentication with 'delete' permission.

func SetDates

func SetDates(client *flickr.FlickrClient, id string, datePosted string, dateTaken string) (*flickr.BasicResponse, error)

Set date posted and date taken on a Flickr photo datePosted and dateTaken are optional and may be set to ""

func SetPerms

func SetPerms(client *flickr.FlickrClient, id string, isPublic PrivacyType, IsFriend PrivacyType, isFamily PrivacyType) (*flickr.BasicResponse, error)

Set permission of a photo from flickr this method requires authentica with 'write' permission

Types

type PhotoAccessInfo

type PhotoAccessInfo struct {
	flickr.BasicResponse
	Sizes []PhotoDownloadInfo `xml:"sizes>size"`
}

func GetSizes

func GetSizes(client *flickr.FlickrClient, photoId string) (*PhotoAccessInfo, error)

GetSizes get all the downloadable link as

type PhotoDownloadInfo

type PhotoDownloadInfo struct {
	Label  string `xml:"label,attr"`
	Width  string `xml:"width,attr"`
	Height string `xml:"height,attr"`
	Source string `xml:"source,attr"`
	Url    string `xml:"url,attr"`
	Media  string `xml:"media,attr"`
}

type PhotoInfo

type PhotoInfo struct {
	Id           string `xml:"id,attr"`
	Secret       string `xml:"secret,attr"`
	Server       string `xml:"server,attr"`
	Farm         string `xml:"farm,attr"`
	DateUploaded string `xml:"dateuploaded,attr"`
	IsFavorite   bool   `xml:"isfavorite,attr"`
	License      string `xml:"license,attr"`
	// NOTE: one less than safety level set on upload (ie, here 0 = safe, 1 = moderate, 2 = restricted)
	//       while on upload, 1 = safe, 2 = moderate, 3 = restricted
	SafetyLevel    int    `xml:"safety_level,attr"`
	Rotation       int    `xml:"rotation,attr"`
	OriginalSecret string `xml:"originalsecret,attr"`
	OriginalFormat string `xml:"originalformat,attr"`
	Views          int    `xml:"views,attr"`
	Media          string `xml:"media,attr"`
	Title          string `xml:"title"`
	Description    string `xml:"description"`
	Visibility     struct {
		IsPublic bool `xml:"ispublic,attr"`
		IsFriend bool `xml:"isfriend,attr"`
		IsFamily bool `xml:"isfamily,attr"`
	} `xml:"visibility"`
	Dates struct {
		Posted           string `xml:"posted,attr"`
		Taken            string `xml:"taken,attr"`
		TakenGranularity string `xml:"takengranularity,attr"`
		TakenUnknown     string `xml:"takenunknown,attr"`
		LastUpdate       string `xml:"lastupdate,attr"`
	} `xml:"dates"`
	Permissions struct {
		PermComment string `xml:"permcomment,attr"`
		PermAdMeta  string `xml:"permadmeta,attr"`
	} `xml:"permissions"`
	Editability struct {
		CanComment string `xml:"cancomment,attr"`
		CanAddMeta string `xml:"canaddmeta,attr"`
	} `xml:"editability"`
	PublicEditability struct {
		CanComment string `xml:"cancomment,attr"`
		CanAddMeta string `xml:"canaddmeta,attr"`
	} `xml:"publiceditability"`
	Usage struct {
		CanDownload string `xml:"candownload,attr"`
		CanBlog     string `xml:"canblog,attr"`
		CanPrint    string `xml:"canprint,attr"`
		CanShare    string `xml:"canshare,attr"`
	} `xml:"usage"`
	Comments int   `xml:"comments"`
	Tags     []Tag `xml:"tags>tag"`
}

type PhotoInfoResponse

type PhotoInfoResponse struct {
	flickr.BasicResponse
	Photo PhotoInfo `xml:"photo"`
}

func GetInfo

func GetInfo(client *flickr.FlickrClient, id string, secret string) (*PhotoInfoResponse, error)

Get information about a Flickr photo

type PrivacyType

type PrivacyType int64

type Tag

type Tag struct {
	ID    string `xml:"id,attr"`
	Raw   string `xml:"raw,attr"`
	Value string `xml:",chardata"`
}

Jump to

Keyboard shortcuts

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