supporter

package
v0.1003.0-MLPAB1742das... Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: MIT Imports: 15 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(tmpl template.Template, organisationStore OrganisationStore, sessionStore sesh.Store) page.Handler

func LoginCallback

func LoginCallback(oneLoginClient LoginCallbackOneLoginClient, sessionStore sesh.Store, organisationStore OrganisationStore) page.Handler

func Register

func Register(
	rootMux *http.ServeMux,
	tmpls template.Templates,
	oneLoginClient OneLoginClient,
	sessionStore SessionStore,
	organisationStore OrganisationStore,
	notFoundHandler page.Handler,
	errorHandler page.ErrorHandler,
	notifyClient NotifyClient,
	appPublicURL string,
)

Types

type ErrorHandler

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

type Handler

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

func Dashboard added in v0.995.0

func Dashboard(tmpl template.Template, organisationStore OrganisationStore) 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, organisationStore OrganisationStore, notifyClient NotifyClient, randomString func(int) string, appPublicURL string) Handler

func OrganisationCreated added in v0.948.0

func OrganisationCreated(tmpl template.Template) Handler

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 NotifyClient added in v0.949.0

type NotifyClient interface {
	SendEmail(context 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, name string) (*actor.Organisation, error)
	CreateMemberInvite(ctx context.Context, organisation *actor.Organisation, firstNames, lastname, email, code string, permission actor.Permission) error
	Get(ctx context.Context) (*actor.Organisation, error)
	CreateLPA(ctx context.Context) (*actor.DonorProvidedDetails, error)
	AllLPAs(ctx context.Context) ([]actor.DonorProvidedDetails, error)
	Put(ctx context.Context, organisation *actor.Organisation) error
}

type SessionStore

type SessionStore interface {
	Get(r *http.Request, name string) (*sessions.Session, error)
	New(r *http.Request, name string) (*sessions.Session, error)
	Save(r *http.Request, w http.ResponseWriter, s *sessions.Session) error
}

type Template added in v0.946.0

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

Jump to

Keyboard shortcuts

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