verifier_odnoklassniki

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ClientID     string
	ClientSecret string
	RedirectURL  string
	Scopes       []string
}

type UserInfo

type UserInfo struct {
	Accessible                    bool   `json:"accessible"`
	Age                           int    `json:"age"`
	AllowAddToFriend              bool   `json:"allow_add_to_friend"`
	AllowsAnonymAccess            bool   `json:"allows_anonym_access"`
	AllowsMessagingOnlyForFriends bool   `json:"allows_messaging_only_for_friends"`
	Birthday                      string `json:"birthday"`
	BirthdaySet                   bool   `json:"birthdaySet"`
	Blocked                       bool   `json:"blocked"`
	Blocks                        bool   `json:"blocks"`
	CanUseReferralInvite          bool   `json:"can_use_referral_invite"`
	CanVcall                      bool   `json:"can_vcall"`
	CanVmail                      bool   `json:"can_vmail"`
	Capabilities                  string `json:"capabilities"`
	CityOfBirth                   string `json:"city_of_birth"`
	CommonFriendsCount            int    `json:"common_friends_count"`
	CurrentLocation               struct {
		Altitude  float32 `json:"altitude"`
		CellId    int     `json:"cellId"`
		City      string  `json:"city"`
		Country   string  `json:"country"`
		IpAddress string  `json:"ipAddress"`
		Latitude  float32 `json:"altitude"`
		Longitude float32 `json:"longitude"`
	} `json:"current_location"`
	CurrentStatus       string `json:"current_status"`
	Email               string `json:"email"`
	Executor            bool   `json:"executor"`
	FeedSubscription    bool   `json:"feed_subscription"`
	FirstName           string `json:"first_name"`
	ForbidsMentioning   bool   `json:"forbids_mentioning"`
	Friend              bool   `json:"friend"`
	FriendInvitation    bool   `json:"friend_invitation"`
	Gender              string `json:"gender"`
	HasEmail            bool   `json:"has_email"`
	HasPhone            bool   `json:"has_phone"`
	HasServiceInvisible bool   `json:"has_service_invisible"`
	InvitedByFriend     bool   `json:"invited_by_friend"`
	LastName            string `json:"last_name"`
	Locale              string `json:"locale"`
	Location            struct {
		City        string `json:"city"`
		Country     string `json:"country"`
		CountryCode string `json:"countryCode"`
		CountryName string `json:"countryName"`
	} `json:"location"`
	Location_of_birth struct {
		City        string `json:"city"`
		Country     string `json:"country"`
		CountryCode string `json:"countryCode"`
		CountryName string `json:"countryName"`
	}
	Login                     string    `json:"login"`
	Mobile                    string    `json:"mobile"`
	Name                      string    `json:"name"`
	NotificationsSubscription bool      `json:"notifications_subscription"`
	Pic1024x768               string    `json:"pic1024x768"`
	Premium                   bool      `json:"premium"`
	Private                   bool      `json:"private"`
	RegisteredDate            time.Time `json:"registered_date"`
	Uid                       string    `json:"uid"`
	UrlChat                   string    `json:"url_chat"`
	UrlChatMobile             string    `json:"url_chat_mobile"`
	UrlProfile                string    `json:"url_profile"`
	UrlProfileMobile          string    `json:"url_profile_mobile"`
	Vip                       string    `json:"vip"`
}

type Verifier

type Verifier struct {
	// contains filtered or unexported fields
}

func New

func New(cfg Config) *Verifier

func (*Verifier) GetOAuth2Identity

func (prov *Verifier) GetOAuth2Identity(ctx context.Context, accessToken string) (iden *identity.IdentityData, verifierData *identity.VerifierData, err error)

func (*Verifier) GetOAuth2URL

func (prov *Verifier) GetOAuth2URL(state string) string

func (*Verifier) HandleOAuth2Callback

func (prov *Verifier) HandleOAuth2Callback(ctx context.Context, code string) (token *oauth2.Token, err error)

func (*Verifier) Info

func (prov *Verifier) Info() identity.VerifierInfo

func (*Verifier) NormalizeIdentity

func (prov *Verifier) NormalizeIdentity(idn string) string

Jump to

Keyboard shortcuts

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