auth

package
v1.9.3-0...-3bfc8b0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 5 Imported by: 0

README

auth

import "github.com/tagoro9/fotingo/internal/auth"

Index

func SetInteractiveFlowRunner

func SetInteractiveFlowRunner(runner func(run func() error) error)

SetInteractiveFlowRunner sets a wrapper used to execute interactive OAuth flows. Passing nil resets to direct execution.

type AccessToken

type AccessToken struct {
    api.AccessToken
    Expiry time.Time
}

type Authenticator

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

func NewAuthenticator
func NewAuthenticator(clientID string, clientSecret string, scopes []string, host *oauth.Host, getToken func() string, storeToken func(string) error) *Authenticator

func (Authenticator) Authenticate
func (a Authenticator) Authenticate() (*AccessToken, error)

type OauthService

type OauthService interface {
    // Authenticate starts the oauth authentication flow and returns the access token
    Authenticate() (token *AccessToken, err error)
}

Generated by gomarkdoc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetInteractiveFlowRunner

func SetInteractiveFlowRunner(runner func(run func() error) error)

SetInteractiveFlowRunner sets a wrapper used to execute interactive OAuth flows. Passing nil resets to direct execution.

Types

type AccessToken

type AccessToken struct {
	api.AccessToken
	Expiry time.Time
}

type Authenticator

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

func NewAuthenticator

func NewAuthenticator(clientID string, clientSecret string, scopes []string, host *oauth.Host, getToken func() string, storeToken func(string) error) *Authenticator

func (Authenticator) Authenticate

func (a Authenticator) Authenticate() (*AccessToken, error)

type OauthService

type OauthService interface {
	// Authenticate starts the oauth authentication flow and returns the access token
	Authenticate() (token *AccessToken, err error)
}

Jump to

Keyboard shortcuts

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