gologin: github.com/dghubble/gologin/tumblr Index | Files

package tumblr

import "github.com/dghubble/gologin/tumblr"

Package tumblr provides Tumblr OAuth1 login and callback handlers.

Index

Package Files

context.go doc.go login.go verify.go

Variables

var (
    ErrUnableToGetTumblrUser = errors.New("tumblr: unable to get Tumblr User")
)

Tumblr login errors

func CallbackHandler Uses

func CallbackHandler(config *oauth1.Config, cookieConfig gologin.CookieConfig, success, failure http.Handler) http.Handler

CallbackHandler handles Tumblr callback requests by parsing the oauth token and verifier and adding the Tubmlr access token and User to the ctx. If authentication succeeds, handling delegates to the success handler, otherwise to the failure handler.

func LoginHandler Uses

func LoginHandler(config *oauth1.Config, cookieConfig gologin.CookieConfig, failure http.Handler) http.Handler

LoginHandler handles Tumblr login requests by obtaining a request token, setting a temporary token secret cookie, and redirecting to the authorization URL.

func WithUser Uses

func WithUser(ctx context.Context, user *User) context.Context

WithUser returns a copy of ctx that stores the Tumblr User.

type User Uses

type User struct {
    Name      string `json:"name"`
    Following int64  `json:"following"`
    Likes     int64  `json:"likes"`
}

User is a Tumblr user.

Note that Tumblr does not provide stable user identifiers.

func UserFromContext Uses

func UserFromContext(ctx context.Context) (*User, error)

UserFromContext returns the Tumblr User from the ctx.

Package tumblr imports 8 packages (graph). Updated 2019-08-16. Refresh now. Tools for package owners.