auth

package
v0.0.0-...-0fce1db Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticate

func Authenticate(c *constant.Constant)

Types

type DeviceCode

type DeviceCode struct {
	DeviceCode              string `json:"device_code"`
	UserCode                string `json:"user_code"`
	VerificationURI         string `json:"verification_uri"`
	VerificationURIComplete string `json:"verification_uri_complete"`
	ExpiresIn               int64  `json:"expires_in"`
	Interval                int64  `json:"interval"`
}

func ReqDeviceCode

func ReqDeviceCode() DeviceCode

func UnmarshalDeviceCode

func UnmarshalDeviceCode(data []byte) (DeviceCode, error)

func (*DeviceCode) Marshal

func (r *DeviceCode) Marshal() ([]byte, error)

type Error

type Error struct {
	ErrorMessage     string `json:"error"`
	ErrorDescription string `json:"error_description"`
}

func UnmarshalErrorResponse

func UnmarshalErrorResponse(data []byte) (Error, error)

func (Error) Error

func (e Error) Error() string

func (*Error) Marshal

func (r *Error) Marshal() ([]byte, error)

type Token

type Token struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	IDToken      string `json:"id_token"`
	TokenType    string `json:"token_type"`
	ExpiresIn    int64  `json:"expires_in"`
	CreatedAt    int64  `json:"created_at"`
}

func ReadToken

func ReadToken(c *constant.Constant) (token Token, err error)

func ReqAuthToken

func ReqAuthToken(deviceCode string) Token

func UnmarshalToken

func UnmarshalToken(data []byte) (Token, error)

func (*Token) IsExpired

func (t *Token) IsExpired() bool

func (*Token) Marshal

func (r *Token) Marshal() ([]byte, error)

Jump to

Keyboard shortcuts

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