voucherpage

package
v0.1363.0-notifytracing.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package voucherpage provides the pages that a voucher interacts with.

Index

Constants

View Source
const (
	None handleOpt = 1 << iota
	RequireSession
	CanGoBack
)

Variables

This section is empty.

Functions

func EnterReferenceNumber

func EnterReferenceNumber(tmpl template.Template, shareCodeStore ShareCodeStore, sessionStore SessionStore, voucherStore VoucherStore) page.Handler

func Register

func Register(
	rootMux *http.ServeMux,
	logger Logger,
	tmpls template.Templates,
	sessionStore SessionStore,
	voucherStore VoucherStore,
	oneLoginClient OneLoginClient,
	shareCodeStore ShareCodeStore,
	dashboardStore DashboardStore,
	errorHandler page.ErrorHandler,
)

Types

type DashboardStore

type DashboardStore interface {
	GetAll(ctx context.Context) (donor, attorney, certificateProvider []page.LpaAndActorTasks, err error)
	SubExistsForActorType(ctx context.Context, sub string, actorType actor.Type) (bool, error)
}

type ErrorHandler

type ErrorHandler func(http.ResponseWriter, *http.Request, error)

type Handler

type Handler func(data appcontext.Data, w http.ResponseWriter, r *http.Request) error

func TaskList

func TaskList(tmpl template.Template) Handler

type Logger

type Logger interface {
	InfoContext(ctx context.Context, msg string, args ...any)
	WarnContext(ctx context.Context, msg string, args ...any)
	ErrorContext(ctx context.Context, msg string, args ...any)
}

type OneLoginClient

type OneLoginClient interface {
	AuthCodeURL(state, nonce, locale string, identity bool) (string, error)
	Exchange(ctx context.Context, code, nonce string) (idToken, accessToken string, err error)
	UserInfo(ctx context.Context, accessToken string) (onelogin.UserInfo, error)
}

type SessionStore

type SessionStore interface {
	Login(r *http.Request) (*sesh.LoginSession, error)
	LpaData(r *http.Request) (*sesh.LpaDataSession, error)
	OneLogin(r *http.Request) (*sesh.OneLoginSession, error)
	SetLogin(r *http.Request, w http.ResponseWriter, session *sesh.LoginSession) error
	SetLpaData(r *http.Request, w http.ResponseWriter, lpaDataSession *sesh.LpaDataSession) error
	SetOneLogin(r *http.Request, w http.ResponseWriter, session *sesh.OneLoginSession) error
}

type ShareCodeStore

type ShareCodeStore interface {
	Get(ctx context.Context, actorType actor.Type, shareCode string) (sharecodedata.Link, error)
	Put(ctx context.Context, actorType actor.Type, shareCode string, data sharecodedata.Link) error
	Delete(ctx context.Context, shareCode sharecodedata.Link) error
}

type Template

type Template func(io.Writer, interface{}) error

type VoucherStore

type VoucherStore interface {
	Create(ctx context.Context, shareCode sharecodedata.Link, email string) (any, error)
}

Jump to

Keyboard shortcuts

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