Help us shape the future of Go! Take the 2026 Go Developer Survey

flickr

package module
v0.0.0-...-acc9560 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2016 License: MIT Imports: 19 Imported by: 0

README

===================================================
go-flickr: A interface to Flickr's API in Google Go
Author: Nolan Caudill
Date: 2011-01-10
License: MIT
===================================================

This is a simple wrapper in Go to talk to Flickr.

I wrote this mainly as an exercise to learn Go but it is functional.

I don't really know Go so if you see something that could be more idiomatic or written better, please let me know!

The godoc below is the best place to learn how to use this library.

To compile and install:
go build

To test:
gotest

=======================================================================

PACKAGE

package flickr
import "."

TYPES

type Error string

func (e Error) String() string

type Request struct {
    ApiKey string
    Method string
    Args   map[string]string
}

type Response struct {
	Status  string         `xml:"stat,attr"`
	Error   *ResponseError `xml:"err"`
	Payload map[string]bool
}

func (request *Request) Execute() (response string, ret os.Error)

func (request *Request) Replace(filename string, filetype string) (response Response, err os.Error)

func (request *Request) Sign(secret string)

func (request *Request) URL() string

func (request *Request) Upload(filename string, filetype string) (response Response, err os.Error)

Example:
r.Upload("thumb.jpg", "image/jpeg")

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error string

func (Error) Error

func (e Error) Error() string

type OAuth

type OAuth struct {
	ConsumerSecret   string
	Callback         string
	OAuthToken       string
	OAuthTokenSecret string
}

type Request

type Request struct {
	ApiKey string
	Method string
	Args   map[string]string
	OAuth  *OAuth
}

func (*Request) AccessToken

func (request *Request) AccessToken(oauth_token string, oauth_verifier string, oauth_token_secret string) (map[string]string, error)

func (*Request) AuthorizeUrl

func (request *Request) AuthorizeUrl(token map[string]string, perms string) string

func (*Request) Execute

func (request *Request) Execute() (response string, ret error)

func (*Request) ExecuteAuthenticated

func (request *Request) ExecuteAuthenticated() (string, error)

func (*Request) Replace

func (request *Request) Replace(filename string, filetype string) (response *Response, err error)

func (*Request) RequestToken

func (request *Request) RequestToken() (map[string]string, error)

func (*Request) Sign

func (request *Request) Sign(secret string)

func (*Request) URL

func (request *Request) URL() string

func (*Request) Upload

func (request *Request) Upload(filename string, filetype string) (response *Response, err error)

Example: r.Upload("thumb.jpg", "image/jpeg")

type Response

type Response struct {
	Status  string         `xml:"stat,attr"`
	Error   *ResponseError `xml:"err"`
	Payload string         `xml:",innerxml"`
}

type ResponseError

type ResponseError struct {
	Code    string `xml:"code,attr"`
	Message string `xml:"msg,attr"`
}

Jump to

Keyboard shortcuts

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