tumblrclient

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2016 License: Apache-2.0 Imports: 8 Imported by: 7

README

Tumblr API Client Library

Build Status GoDoc

This is a concrete implementation of the ClientInterface defined in the Tumblr API library.

This project utilizes an external OAuth1 library you can find at github.com/dghubble/oauth1

Install by running go get github.com/tumblr/tumblrclient.go

You can instantiate a client by running

client := tumblrclient.NewClient(
    "CONSUMER KEY",
    "CONSUMER SECRET",
)
// or
client := tumblr_go.NewClientWithToken(
    "CONSUMER KEY",
    "CONSUMER SECRET",
    "USER TOKEN",
    "USER TOKEN SECRET",
)

From there you can use the convenience methods.

Support/Questions

You can post a question in the Google Group or contact the Tumblr API Team at api@tumblr.com

License

Copyright 2016 Tumblr, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	tumblr.ClientInterface
	// contains filtered or unexported fields
}

The Tumblr API Client object

func NewClient

func NewClient(consumerKey string, consumerSecret string) *Client

Constructor with only the consumer key and secret

func NewClientWithToken

func NewClientWithToken(consumerKey string, consumerSecret string, token string, tokenSecret string) *Client

Constructor with consumer key/secret and user token/secret

func (*Client) Delete

func (c *Client) Delete(endpoint string) (tumblr.Response, error)

Issue DELETE request to Tumblr API

func (*Client) DeleteWithParams

func (c *Client) DeleteWithParams(endpoint string, params url.Values) (tumblr.Response, error)

Issue DELETE request to Tumblr API with param values

func (*Client) Get

func (c *Client) Get(endpoint string) (tumblr.Response, error)

Issue GET request to Tumblr API

func (*Client) GetBlog

func (c *Client) GetBlog(name string) *tumblr.BlogRef

Creates a BlogRef out of the provided name

func (*Client) GetDashboard

func (c *Client) GetDashboard() (*tumblr.Dashboard, error)

Makes a request for the user's dashboard

func (*Client) GetDashboardWithParams

func (c *Client) GetDashboardWithParams(params url.Values) (*tumblr.Dashboard, error)

Makes a request for the user's dashboard with params

func (*Client) GetHttpClient

func (c *Client) GetHttpClient() *http.Client

Retrieve the underlying HTTP client

func (*Client) GetLikes

func (c *Client) GetLikes() (*tumblr.Likes, error)

Makes a request for

func (*Client) GetLikesWithParams

func (c *Client) GetLikesWithParams(params url.Values) (*tumblr.Likes, error)

Retrieves the posts the current user has liked

func (*Client) GetPost

func (c *Client) GetPost(id uint64, blogName string) *tumblr.PostRef

Creates a PostRef out of an id and blog name

func (*Client) GetUser

func (c *Client) GetUser() (*tumblr.User, error)

Makes a request for user info based on the client's user token/secret values

func (*Client) GetWithParams

func (c *Client) GetWithParams(endpoint string, params url.Values) (tumblr.Response, error)

Issue GET request to Tumblr API with param values

func (*Client) Post

func (c *Client) Post(endpoint string) (tumblr.Response, error)

Issue POST request to Tumblr API

func (*Client) PostWithParams

func (c *Client) PostWithParams(endpoint string, params url.Values) (tumblr.Response, error)

Issue POST request to Tumblr API with param values

func (*Client) Put

func (c *Client) Put(endpoint string) (tumblr.Response, error)

Issue PUT request to Tumblr API

func (*Client) PutWithParams

func (c *Client) PutWithParams(endpoint string, params url.Values) (tumblr.Response, error)

Issue PUT request to Tumblr API with param values

func (*Client) SetConsumer

func (c *Client) SetConsumer(consumerKey string, consumerSecret string)

Set consumer credentials, invalidates any previously cached client

func (*Client) SetToken

func (c *Client) SetToken(token string, tokenSecret string)

Set user credentials, invalidates any previously cached client

func (*Client) TaggedSearch

func (c *Client) TaggedSearch(tag string) (*tumblr.SearchResults, error)

Performs a tagged serach with this client, returning the result

func (*Client) TaggedSearchWithParams

func (c *Client) TaggedSearchWithParams(tag string, params url.Values) (*tumblr.SearchResults, error)

Performs a tagged serach with this client, returning the result

Jump to

Keyboard shortcuts

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