magic

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GCInterval = time.Minute
	Expiry     = time.Minute * 5
	Timeout    = time.Second * 30
)

Variables

View Source
var (
	ErrDBIsRequired   = errors.New("db is required")
	ErrCreatingFlow   = errors.New("error creating flow")
	ErrCompletingFlow = errors.New("error completing flow")
	ErrInvalidNextURL = errors.New("invalid next URL")
	ErrInvalidToken   = errors.New("invalid token")
	ErrInvalidSecret  = errors.New("invalid secret")
)

Functions

This section is empty.

Types

type Magic

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

func New

func New(db *db.DB, logger types.Logger) (*Magic, error)

func (*Magic) Close

func (c *Magic) Close() error

func (*Magic) CompleteFlow

func (c *Magic) CompleteFlow(ctx context.Context, token string) (flow.Data, error)

func (*Magic) CreateFlow

func (c *Magic) CreateFlow(ctx context.Context, emailAddress string, deviceIdentifier string, userIdentifier string, nextURL string) (string, error)

Jump to

Keyboard shortcuts

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