api

package
v0.0.0-...-f2e39e4 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2021 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OrgController

type OrgController interface {
	GetOrganisation(id string, u auth.User) (impact.Organisation, error)
	NewOrganisation(orgName, userName, email, password string) (impact.Organisation, error)
	UpdateOrganisationSetting(id, setting string, value interface{}, u auth.User) error
	GetOrganisations(offset, limit int, u auth.User) ([]impact.Organisation, error)
}

type ReportController

type ReportController interface {
	HasGeneratedReport(orgID string, u auth.User) (bool, error)
}

type RouteHandler

type RouteHandler struct {
	Route   string
	Handler http.Handler
}

func NewV1

func NewV1(db data.Base, oc OrgController, authGen auth.Generator, userController UserController, rc ReportController, so *softoutcomes.Client) ([]RouteHandler, error)

NewV1 returns a set of RouteHandler which serve V1 of the API

type UserController

type UserController interface {
	GetUser(id string, u auth.User) (*user.Profile, error)
	GetUsers(org string, u auth.User) ([]user.Profile, error)
	GetSelf(u auth.User) (*user.U, error)
	UpdateSelf(patch user.Patch, u auth.User) (*user.U, error)
	UpdateUser(id string, patch user.Patch, u auth.User) (*user.Profile, error)
	CreateUser(name, email, password, orgID string) (*user.Profile, error)
	UnsubscribeUser(userID string) error
}

Jump to

Keyboard shortcuts

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