supporter

package
v0.1314.0-MLPAB2111peo... Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnterOrganisationName added in v0.946.0

func EnterOrganisationName(logger Logger, tmpl template.Template, organisationStore OrganisationStore, memberStore MemberStore, sessionStore SessionStore) page.Handler

func EnterReferenceNumber added in v0.1023.0

func EnterReferenceNumber(logger Logger, tmpl template.Template, memberStore MemberStore, sessionStore SessionStore) page.Handler

func EnterYourName added in v0.1064.0

func EnterYourName(tmpl template.Template, memberStore MemberStore) page.Handler

func LoginCallback

func LoginCallback(logger Logger, oneLoginClient LoginCallbackOneLoginClient, sessionStore SessionStore, organisationStore OrganisationStore, now func() time.Time, memberStore MemberStore) page.Handler

func Register

func Register(
	rootMux *http.ServeMux,
	logger Logger,
	tmpls template.Templates,
	oneLoginClient OneLoginClient,
	sessionStore SessionStore,
	organisationStore OrganisationStore,
	errorHandler page.ErrorHandler,
	notifyClient NotifyClient,
	appPublicURL string,
	memberStore MemberStore,
	searchClient *search.Client,
	donorStore DonorStore,
	shareCodeStore ShareCodeStore,
	progressTracker ProgressTracker,
	lpaStoreResolvingService LpaStoreResolvingService,
)

Types

type CertificateProviderStore added in v0.1090.0

type CertificateProviderStore interface {
	GetAny(ctx context.Context) (*actor.CertificateProviderProvidedDetails, error)
}

type DonorStore added in v0.1045.0

type DonorStore interface {
	DeleteDonorAccess(ctx context.Context, shareCodeData actor.ShareCodeData) error
	Get(ctx context.Context) (*actor.DonorProvidedDetails, error)
	GetByKeys(ctx context.Context, keys []dynamo.Keys) ([]actor.DonorProvidedDetails, error)
	Put(ctx context.Context, donor *actor.DonorProvidedDetails) error
}

type ErrorHandler

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

type HandleOpt added in v0.1054.0

type HandleOpt byte
const (
	None HandleOpt = 1 << iota
	RequireSession
	RequireAdmin
	CanGoBack
)

type Handler

type Handler func(data page.AppData, w http.ResponseWriter, r *http.Request, organisation *actor.Organisation, member *actor.Member) error

func ConfirmDonorCanInteractOnline added in v0.1016.0

func ConfirmDonorCanInteractOnline(tmpl template.Template, organisationStore OrganisationStore) Handler

func Dashboard added in v0.995.0

func Dashboard(tmpl template.Template, donorStore DonorStore, searchClient SearchClient) Handler

func DeleteOrganisation added in v0.1057.0

func DeleteOrganisation(logger Logger, tmpl template.Template, organisationStore OrganisationStore, sessionStore SessionStore, searchClient SearchClient) Handler

func DonorAccess added in v0.1079.0

func DonorAccess(logger Logger, tmpl template.Template, donorStore DonorStore, shareCodeStore ShareCodeStore, notifyClient NotifyClient, appPublicURL string, randomString func(int) string) Handler

func EditMember added in v0.1032.0

func EditMember(logger Logger, tmpl template.Template, memberStore MemberStore) Handler

func EditOrganisationName added in v0.994.0

func EditOrganisationName(tmpl template.Template, organisationStore OrganisationStore) Handler

func Guidance added in v0.982.0

func Guidance(tmpl template.Template) Handler

func InviteMember added in v0.949.0

func InviteMember(tmpl template.Template, memberStore MemberStore, notifyClient NotifyClient, randomString func(int) string, appPublicURL string) Handler

func ManageTeamMembers added in v0.1005.0

func ManageTeamMembers(tmpl template.Template, memberStore MemberStore, randomString func(int) string, notifyClient NotifyClient, appPublicURL string) Handler

func ViewLPA added in v0.1076.0

func ViewLPA(tmpl template.Template, lpaStoreResolvingService LpaStoreResolvingService, progressTracker ProgressTracker) Handler

type Localizer added in v0.1089.0

type Localizer interface {
	page.Localizer
}

type Logger added in v0.1303.0

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

type LoginCallbackOneLoginClient

type LoginCallbackOneLoginClient interface {
	Exchange(ctx context.Context, code, nonce string) (idToken, accessToken string, err error)
	UserInfo(ctx context.Context, accessToken string) (onelogin.UserInfo, error)
}

type LpaStoreResolvingService added in v0.1116.0

type LpaStoreResolvingService interface {
	Get(ctx context.Context) (*lpastore.Lpa, error)
}

type MemberStore added in v0.1032.0

type MemberStore interface {
	Create(ctx context.Context, firstNames, lastName string) (*actor.Member, error)
	CreateFromInvite(ctx context.Context, invite *actor.MemberInvite) error
	CreateMemberInvite(ctx context.Context, organisation *actor.Organisation, firstNames, lastname, email, code string, permission actor.Permission) error
	DeleteMemberInvite(ctx context.Context, organisationID, email string) error
	Get(ctx context.Context) (*actor.Member, error)
	GetAny(ctx context.Context) (*actor.Member, error)
	GetAll(ctx context.Context) ([]*actor.Member, error)
	GetByID(ctx context.Context, memberID string) (*actor.Member, error)
	InvitedMember(ctx context.Context) (*actor.MemberInvite, error)
	InvitedMembers(ctx context.Context) ([]*actor.MemberInvite, error)
	InvitedMembersByEmail(ctx context.Context) ([]*actor.MemberInvite, error)
	Put(ctx context.Context, member *actor.Member) error
}

type NotifyClient added in v0.949.0

type NotifyClient interface {
	SendEmail(ctx context.Context, to string, email notify.Email) error
}

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 OrganisationStore added in v0.946.0

type OrganisationStore interface {
	Create(ctx context.Context, member *actor.Member, name string) (*actor.Organisation, error)
	CreateLPA(ctx context.Context) (*actor.DonorProvidedDetails, error)
	Get(ctx context.Context) (*actor.Organisation, error)
	Put(ctx context.Context, organisation *actor.Organisation) error
	SoftDelete(ctx context.Context, organisation *actor.Organisation) error
}

type ProgressTracker added in v0.1090.0

type ProgressTracker interface {
	Progress(lpa *lpastore.Lpa) page.Progress
}

type SearchClient added in v0.1045.0

type SearchClient interface {
	Query(ctx context.Context, req search.QueryRequest) (*search.QueryResponse, error)
	CountWithQuery(ctx context.Context, req search.CountWithQueryReq) (int, error)
}

type SessionStore

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

type ShareCodeStore added in v0.1079.0

type ShareCodeStore interface {
	PutDonor(ctx context.Context, shareCode string, data actor.ShareCodeData) error
	GetDonor(ctx context.Context) (actor.ShareCodeData, error)
	Delete(ctx context.Context, data actor.ShareCodeData) error
}

type SupporterPath added in v0.1079.0

type SupporterPath interface {
	String() string
	IsManageOrganisation() bool
}

type Template added in v0.946.0

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

Jump to

Keyboard shortcuts

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