chrome

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: MPL-2.0 Imports: 24 Imported by: 0

README

Digiposte login module

This module is used to login to digiposte.fr.

This module exists because digiposte.fr does not provide oauth2 credentials to third party applications. This module will get the credentials from the digiposte.fr website and store them in the rclone config file.

Documentation

Index

Constants

View Source
const (
	ConfigURL       = "url"
	ConfigCookieJar = "cookie"
)
View Source
const (
	// DefaultRefreshFrequency is the default refresh frequency for the login process.
	DefaultRefreshFrequency = 1500 * time.Millisecond
)

Variables

This section is empty.

Functions

func New

func New(opts ...digioauth.Option) (digioauth.LoginMethod, error)

New creates a new chrome login method. It requires chromedp to be installed.

func WithCancelOnClose

func WithCancelOnClose(ctx context.Context, done <-chan struct{}) (context.Context, context.CancelFunc)

Types

type HTTPError

type HTTPError struct {
	Status     int64
	StatusText string
}

func (*HTTPError) Error

func (e *HTTPError) Error() string

type InvalidTokenError

type InvalidTokenError struct {
	Token *oauth2.Token
}

func (*InvalidTokenError) Error

func (e *InvalidTokenError) Error() string

type InvalidTypeOptionError

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

func (*InvalidTypeOptionError) Error

func (e *InvalidTypeOptionError) Error() string

type MissingOptionError

type MissingOptionError struct {
	Option string
}

func (*MissingOptionError) Error

func (e *MissingOptionError) Error() string

func (*MissingOptionError) Is

func (e *MissingOptionError) Is(target error) bool

type Screen

type Screen interface {
	fmt.Stringer
	CurrentPageMatches(ctx context.Context) bool
	ShouldWaitForResponse() bool
	chromedp.Action
}

type Screens

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

func (*Screens) Resolve

func (s *Screens) Resolve(ctx context.Context)

func (*Screens) Succeeded

func (s *Screens) Succeeded() bool

type Validatable

type Validatable interface {
	Validate() error
}

type WithCookies

type WithCookies struct {
	Cookies []*http.Cookie
}

func (*WithCookies) Apply

func (o *WithCookies) Apply(instance interface{}) error

type WithLoggers

type WithLoggers struct {
	Info  *log.Logger
	Error *log.Logger
}

func (*WithLoggers) Apply

func (o *WithLoggers) Apply(instance interface{}) error

type WithRefreshFrequency

type WithRefreshFrequency struct {
	Frequency time.Duration
}

func (*WithRefreshFrequency) Apply

func (o *WithRefreshFrequency) Apply(instance interface{}) error

func (*WithRefreshFrequency) Validate

func (o *WithRefreshFrequency) Validate() error

type WithScreenShortOnError

type WithScreenShortOnError struct{}

func (*WithScreenShortOnError) Apply

func (o *WithScreenShortOnError) Apply(instance interface{}) error

type WithScreenshotError

type WithScreenshotError struct {
	Err        error
	Screenshot []byte
}

func (*WithScreenshotError) Error

func (e *WithScreenshotError) Error() string

func (*WithScreenshotError) Unwrap

func (e *WithScreenshotError) Unwrap() error

type WithTimeout

type WithTimeout struct {
	Timeout time.Duration
}

func (*WithTimeout) Apply

func (o *WithTimeout) Apply(instance interface{}) error

func (*WithTimeout) Validate

func (o *WithTimeout) Validate() error

type WithURL

type WithURL struct {
	URL string
}

func (*WithURL) Apply

func (o *WithURL) Apply(instance interface{}) error

func (*WithURL) Validate

func (o *WithURL) Validate() error

Jump to

Keyboard shortcuts

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