zenmoneyauth

package module
v0.0.0-...-0a9d70d Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2018 License: MIT Imports: 5 Imported by: 0

README

zenmoney-auth-go

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultEndpoints = &Endpoints{
	Authorize: "https://api.zenmoney.ru/oauth2/authorize/",
	Token:     "https://api.zenmoney.ru/oauth2/token/",
	Redirect:  "http://example.com",
}

Functions

This section is empty.

Types

type Application

type Application struct {
	ConsumerKey    string
	ConsumerSecret string
}

type Auth

type Auth struct {
	Application *Application
	Endpoints   *Endpoints
	User        *User
}

func NewAuth

func NewAuth(app *Application, user *User) *Auth

func (*Auth) GenerateAuthorizeUrl

func (a *Auth) GenerateAuthorizeUrl() string

func (*Auth) GetAuthorizeCode

func (a *Auth) GetAuthorizeCode() (string, error)

func (*Auth) GetToken

func (a *Auth) GetToken(code string) (*TokenResponse, error)

type Endpoints

type Endpoints struct {
	Authorize string
	Redirect  string
	Token     string
}

type TokenResponse

type TokenResponse struct {
	AccessToken  string `json:"access_token"`
	TokenType    string `json:"token_type"`
	ExpiresIn    int64  `json:"expires_in"`
	RefreshToken string `json:"refresh_token"`
}

type User

type User struct {
	Login    string
	Password string
}

Jump to

Keyboard shortcuts

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