oauth

package
v0.0.0-...-4bf1f59 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2017 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Oauth1

type Oauth1 struct {
	Type           string
	ConsumerKey    string
	ConsumerSecret string
	ReqTokenUrl    string
	AuthTokenUrl   string
	AccsTokenUrl   string
	CallbackUrl    string
	// contains filtered or unexported fields
}

func (*Oauth1) Authorize

func (o *Oauth1) Authorize(token string, code string) (
	client *Oauth1Client, err error)

func (*Oauth1) Config

func (o *Oauth1) Config()

func (*Oauth1) NewClient

func (o *Oauth1) NewClient(acct *account.Account) (client *Oauth1Client)

func (*Oauth1) Request

func (o *Oauth1) Request() (url string, err error)

type Oauth1Client

type Oauth1Client struct {
	Account *account.Account
	Token   string
	Secret  string
	// contains filtered or unexported fields
}

func (*Oauth1Client) GetJson

func (c *Oauth1Client) GetJson(url string, userParams map[string]string,
	resp interface{}) (err error)

func (*Oauth1Client) Sign

func (c *Oauth1Client) Sign(method string, url string,
	params map[string]string) (sig string)

type Oauth2

type Oauth2 struct {
	Type         string
	ClientId     string
	ClientSecret string
	CallbackUrl  string
	AuthUrl      string
	TokenUrl     string
	Scopes       []string
	// contains filtered or unexported fields
}

func (*Oauth2) Authorize

func (o *Oauth2) Authorize(state string, code string) (
	client *Oauth2Client, err error)

func (*Oauth2) Config

func (o *Oauth2) Config()

func (*Oauth2) NewClient

func (o *Oauth2) NewClient(acct *account.Account) (client *Oauth2Client)

func (*Oauth2) Request

func (o *Oauth2) Request() (url string, err error)

type Oauth2Client

type Oauth2Client struct {
	oauth2.Token

	Account *account.Account
	// contains filtered or unexported fields
}

func (*Oauth2Client) Check

func (c *Oauth2Client) Check() (refreshed bool, err error)

func (*Oauth2Client) Do

func (c *Oauth2Client) Do(req *http.Request) (*http.Response, error)

func (*Oauth2Client) GetJson

func (c *Oauth2Client) GetJson(url string, resp interface{}) (err error)

func (*Oauth2Client) Refresh

func (c *Oauth2Client) Refresh() (err error)

type Token

type Token struct {
	Id          string
	Type        string
	OauthSecret string
}

Jump to

Keyboard shortcuts

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