Documentation
¶
Index ¶
- type OrgController
- func (c *OrgController) GetOrganisation(id string, u auth.User) (impact.Organisation, error)
- func (c *OrgController) GetOrganisations(offset, limit int, u auth.User) ([]impact.Organisation, error)
- func (c *OrgController) NewOrganisation(orgName, userName, email, password string) (impact.Organisation, error)
- func (c *OrgController) UpdateOrganisationSetting(id, setting string, value interface{}, u auth.User) error
- type OrgDB
- type ReportController
- type ReportDB
- type UserController
- func (uc *UserController) CreateUser(name, email, password, orgID string) (*user.Profile, error)
- func (uc *UserController) GetSelf(u auth.User) (*user.U, error)
- func (uc *UserController) GetUser(id string, u auth.User) (*user.Profile, error)
- func (uc *UserController) GetUsers(org string, u auth.User) ([]user.Profile, error)
- func (uc *UserController) UnsubscribeUser(id string) error
- func (uc *UserController) UpdateSelf(patch user.Patch, u auth.User) (*user.U, error)
- func (uc *UserController) UpdateUser(id string, patch user.Patch, u auth.User) (*user.Profile, error)
- type UserCreator
- type UserDirectory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OrgController ¶
type OrgController struct {
// contains filtered or unexported fields
}
func NewOrgController ¶
func NewOrgController(db OrgDB, u UserCreator) *OrgController
func (*OrgController) GetOrganisation ¶
func (c *OrgController) GetOrganisation(id string, u auth.User) (impact.Organisation, error)
GetOrganisation returns the organisation with the given id. If the provided id is empty, the user's organisation will be assumed.
func (*OrgController) GetOrganisations ¶
func (c *OrgController) GetOrganisations(offset, limit int, u auth.User) ([]impact.Organisation, error)
GetOrganisations returns a page of organisations. If a user has organisations:read permission, all organisations are considered, otherwise it pages within the user's organisations
func (*OrgController) NewOrganisation ¶
func (c *OrgController) NewOrganisation(orgName, userName, email, password string) (impact.Organisation, error)
NewOrganisation creates an organisation with a single user. The provided user name, email and password is used to create the user within the new org.
func (*OrgController) UpdateOrganisationSetting ¶
func (c *OrgController) UpdateOrganisationSetting(id, setting string, value interface{}, u auth.User) error
UpdateOrganisationSetting will update a setting associated with an organisation. If the organisation ID provided is an empty string, the user's organisation is used.
type OrgDB ¶
type OrgDB interface { GetOrganisation(id string) (impact.Organisation, error) AddOrganisation(name string) (impact.Organisation, error) DeleteOrganisation(id string) error UpdateSetting(orgID string, setting string, value interface{}) error GetOrganisations(offset int, limit int) ([]impact.Organisation, error) }
type ReportController ¶
type ReportController struct {
// contains filtered or unexported fields
}
func NewReportController ¶
func NewReportController(db ReportDB) *ReportController
func (*ReportController) HasGeneratedReport ¶
type UserController ¶
type UserController struct {
// contains filtered or unexported fields
}
func NewUserController ¶
func NewUserController(ud UserDirectory) *UserController
func (*UserController) CreateUser ¶
func (uc *UserController) CreateUser(name, email, password, orgID string) (*user.Profile, error)
func (*UserController) UnsubscribeUser ¶
func (uc *UserController) UnsubscribeUser(id string) error
func (*UserController) UpdateSelf ¶
type UserCreator ¶
Click to show internal directories.
Click to hide internal directories.