supporter

package
v0.1064.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 18 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, memberStore MemberStore, sessionStore SessionStore) page.Handler

func EnterReferenceNumber added in v0.1023.0

func EnterReferenceNumber(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(oneLoginClient LoginCallbackOneLoginClient, sessionStore SessionStore, organisationStore OrganisationStore, now func() time.Time, memberStore MemberStore) page.Handler

func Register

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

Types

type DonorStore added in v0.1045.0

type DonorStore interface {
	GetByKeys(ctx context.Context, keys []dynamo.Key) ([]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) 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(tmpl template.Template, organisationStore OrganisationStore, sessionStore SessionStore, searchClient SearchClient) Handler

func EditMember added in v0.1032.0

func EditMember(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

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 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(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, 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 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 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