gallery

package
v0.0.0-...-1bf988e Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2016 License: MIT Imports: 14 Imported by: 2

Documentation

Index

Constants

View Source
const (
	PicasaAPIBase = "https://picasaweb.google.com/data/feed/api/"
)

Variables

View Source
var Client = &http.Client{

	CheckRedirect: func(req *http.Request, via []*http.Request) error {
		old := via[0]
		req.Header.Set("User-Agent", old.UserAgent())
		return nil
	},
}

Functions

func Attach

func Attach(url string)

func AttachAdmin

func AttachAdmin(url string)

func HttpGet

func HttpGet(url string) (string, error)

func HttpGetJson

func HttpGetJson(url string) (map[string]interface{}, error)

Given a URL, fetch it and return a string map of the data

func ParsePicasaTime

func ParsePicasaTime(timestamp string) int64

Taken a timestamp in the picasa format, which seems like the standard iso format time, return a int64 timestamp, ex:

2009-04-27T07:18:46.000Z ->

func UrlJoin

func UrlJoin(strs ...string) string

join multiple url bits into one

Types

type GalleryConfig

type GalleryConfig struct {
	Id      bson.ObjectId `bson:"_id,omitempty"`
	Type    string
	UserId  string
	LastRun int64
}

func LoadGalleryConfig

func LoadGalleryConfig() *GalleryConfig

func (*GalleryConfig) Check

func (g *GalleryConfig) Check() error

func (*GalleryConfig) Collection

func (g *GalleryConfig) Collection() string

func (*GalleryConfig) Indexes

func (g *GalleryConfig) Indexes() [][]string

func (*GalleryConfig) Save

func (g *GalleryConfig) Save()
func (g *GalleryConfig) SourceLink() string

func (*GalleryConfig) String

func (g *GalleryConfig) String() string

type GalleryPanel

type GalleryPanel struct{}

func (*GalleryPanel) Render

func (gp *GalleryPanel) Render() string

type Image

type Image struct {
	Url    string
	Height int
	Width  int
}

type M

type M map[string]interface{}

type PicasaAPI

type PicasaAPI struct {
	UserId string
}

func NewPicasaAPI

func NewPicasaAPI(UserId string) *PicasaAPI

func (*PicasaAPI) ListAlbums

func (p *PicasaAPI) ListAlbums() ([]*PicasaAlbum, error)

func (*PicasaAPI) ListPhotos

func (p *PicasaAPI) ListPhotos(album *PicasaAlbum) ([]*PicasaPhoto, error)

func (*PicasaAPI) UpdateAlbums

func (p *PicasaAPI) UpdateAlbums() error

Update all picasa album info

func (*PicasaAPI) UpdateAll

func (p *PicasaAPI) UpdateAll() error

Update all picasa data and keep track of required bookkeeping

func (*PicasaAPI) UpdatePhotos

func (p *PicasaAPI) UpdatePhotos(album *PicasaAlbum) error

type PicasaAlbum

type PicasaAlbum struct {
	Id                 bson.ObjectId `bson:"_id,omitempty"`
	ApiUrl             string        // id
	AlbumId            string        //gphoto$id
	Published          string
	PublishedTimestamp int64
	Updated            string
	UpdatedTimestamp   int64
	Title              string
	Slug               string
	Summary            string
	Rights             string //gphoto$access
	Links              []string
	AlbumType          string // gphoto$albumType
	Thumbnail          string // media$thumbnail
	NumPhotos          int
	Enabled            bool `bson:",omitempty"`
}

func ByAlbumId

func ByAlbumId(id string) (*PicasaAlbum, error)
func (a *PicasaAlbum) AlbumLink() string

func (*PicasaAlbum) Collection

func (a *PicasaAlbum) Collection() string

func (*PicasaAlbum) Disable

func (a *PicasaAlbum) Disable()

func (*PicasaAlbum) Enable

func (a *PicasaAlbum) Enable()

func (*PicasaAlbum) Indexes

func (a *PicasaAlbum) Indexes() [][]string

func (*PicasaAlbum) PreSave

func (a *PicasaAlbum) PreSave()

func (*PicasaAlbum) String

func (p *PicasaAlbum) String() string

func (*PicasaAlbum) Unique

func (a *PicasaAlbum) Unique() bson.M

type PicasaPhoto

type PicasaPhoto struct {
	Id                 bson.ObjectId `bson:"_id,omitempty"`
	ApiUrl             string        // id
	AlbumId            string        //gphoto$albumid
	PhotoId            string        // gphoto$id
	Published          string
	PublishedTimestamp int64
	Updated            string
	UpdatedTimestamp   int64
	Title              string
	Slug               string
	Summary            string
	Rights             string //gphoto$access
	Links              []string
	Size               int
	Height             int
	Width              int
	ExifTags           map[string]string
	Position           int
	Large              Image
	Thumbnails         []Image
	Enabled            bool `bson:",omitempty"`
}

func (*PicasaPhoto) Collection

func (p *PicasaPhoto) Collection() string

func (*PicasaPhoto) Disable

func (p *PicasaPhoto) Disable()

func (*PicasaPhoto) Enable

func (p *PicasaPhoto) Enable()

func (*PicasaPhoto) FullSize

func (p *PicasaPhoto) FullSize() string

func (*PicasaPhoto) Indexes

func (p *PicasaPhoto) Indexes() [][]string

func (*PicasaPhoto) MediumThumbnail

func (p *PicasaPhoto) MediumThumbnail() Image

func (*PicasaPhoto) PreSave

func (p *PicasaPhoto) PreSave()

func (*PicasaPhoto) Unique

func (p *PicasaPhoto) Unique() bson.M

type WaitGroupErr

type WaitGroupErr struct {
	sync.WaitGroup
	Errors []error
}

func (*WaitGroupErr) Error

func (w *WaitGroupErr) Error(err error)

func (*WaitGroupErr) GetError

func (w *WaitGroupErr) GetError() error

Jump to

Keyboard shortcuts

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