Documentation ¶
Index ¶
- func NewActivityRow(tenant string, activity *ss12000v1.Activity) dbActivityRow
- func NewEmploymentRow(tenant string, employment *ss12000v1.Employment) dbEmploymentRow
- func NewOrganisationRow(tenant string, organisation *ss12000v1.Organisation) dbOrganisationRow
- func NewSchoolUnitGroupRow(tenant string, schoolUnitGroup *ss12000v1.SchoolUnitGroup) dbSchoolUnitGroupRow
- func NewSchoolUnitRow(tenant string, schoolUnit *ss12000v1.SchoolUnit) dbSchoolUnitRow
- func NewStudentGroupRow(tenant string, group *ss12000v1.StudentGroup) dbStudentGroupRow
- func NewUserRow(tenant string, user *ss12000v1.User) dbUserRow
- func NoValidation(obj ss12000v1.Object) error
- type ObjectParser
- type SQLBackend
- func (backend *SQLBackend) Clear(tenant string) error
- func (backend *SQLBackend) Create(tenant, resourceType, resource string) (string, error)
- func (backend *SQLBackend) Delete(tenant, resourceType, resourceID string) error
- func (backend *SQLBackend) GetParsedResource(tenant, resourceType string, id string) (interface{}, error)
- func (backend *SQLBackend) GetParsedResources(tenant, resourceType string) (map[string]interface{}, error)
- func (backend *SQLBackend) GetResource(tenant, resourceType string, id string) (string, error)
- func (backend *SQLBackend) GetResources(tenant, resourceType string) (map[string]string, error)
- func (backend *SQLBackend) Update(tenant, resourceType, resourceID, resource string) (string, error)
- type Validator
- type Windermere
- func (w *Windermere) Clear(tenant string) error
- func (w *Windermere) CountResources(tenant, resourceType string) int
- func (w *Windermere) GetParsedResource(tenant, resourceType string, id string) (interface{}, error)
- func (w *Windermere) GetParsedResources(tenant, resourceType string) (map[string]interface{}, error)
- func (w *Windermere) GetResource(tenant, resourceType string, id string) (string, error)
- func (w *Windermere) GetResourceTypes(tenant string) []string
- func (w *Windermere) GetResources(tenant, resourceType string) (map[string]string, error)
- func (w *Windermere) Save() error
- func (wind *Windermere) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (wind *Windermere) Shutdown() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewActivityRow ¶
func NewEmploymentRow ¶
func NewEmploymentRow(tenant string, employment *ss12000v1.Employment) dbEmploymentRow
func NewOrganisationRow ¶
func NewOrganisationRow(tenant string, organisation *ss12000v1.Organisation) dbOrganisationRow
func NewSchoolUnitGroupRow ¶
func NewSchoolUnitGroupRow(tenant string, schoolUnitGroup *ss12000v1.SchoolUnitGroup) dbSchoolUnitGroupRow
func NewSchoolUnitRow ¶
func NewSchoolUnitRow(tenant string, schoolUnit *ss12000v1.SchoolUnit) dbSchoolUnitRow
func NewStudentGroupRow ¶
func NewStudentGroupRow(tenant string, group *ss12000v1.StudentGroup) dbStudentGroupRow
func NewUserRow ¶
func NoValidation ¶ added in v0.4.0
Dummy validator that does nothing
Types ¶
type ObjectParser ¶ added in v0.4.0
type SQLBackend ¶
type SQLBackend struct {
// contains filtered or unexported fields
}
SQLBackend implements scimserverlite.Backend for SQL databases
func NewSQLBackend ¶
func NewSQLBackend(d *sqlx.DB, op ObjectParser) (backend *SQLBackend, err error)
NewSQLBackend creates a new SQLBackend
func (*SQLBackend) Clear ¶
func (backend *SQLBackend) Clear(tenant string) error
func (*SQLBackend) Create ¶
func (backend *SQLBackend) Create(tenant, resourceType, resource string) (string, error)
func (*SQLBackend) Delete ¶
func (backend *SQLBackend) Delete(tenant, resourceType, resourceID string) error
func (*SQLBackend) GetParsedResource ¶
func (backend *SQLBackend) GetParsedResource(tenant, resourceType string, id string) (interface{}, error)
func (*SQLBackend) GetParsedResources ¶
func (backend *SQLBackend) GetParsedResources(tenant, resourceType string) (map[string]interface{}, error)
func (*SQLBackend) GetResource ¶
func (backend *SQLBackend) GetResource(tenant, resourceType string, id string) (string, error)
func (*SQLBackend) GetResources ¶
func (backend *SQLBackend) GetResources(tenant, resourceType string) (map[string]string, error)
type Validator ¶ added in v0.4.0
A function that does some kind of validation of an SS12000 object
func CreateOptionalValidator ¶ added in v0.4.0
Convenience function for creating a validator with specified validators included
func MultiValidator ¶ added in v0.4.0
MultiValidator creates a single Validator from several. The validators will be applied in the order in the slice.
func SchoolUnitCodeValidator ¶ added in v0.4.0
func SchoolUnitCodeValidator() Validator
SchoolUnitCodeValidator ensures the object has a valid schoolUnitCode (if it's a school unit)
func UUIDValidator ¶ added in v0.4.0
func UUIDValidator() Validator
UUIDValidator ensures the object has a valid UUID
type Windermere ¶
type Windermere struct {
// contains filtered or unexported fields
}
func New ¶
func New(backingType, backingSource string, tenantGetter scimserverlite.TenantGetter, v Validator) (*Windermere, error)
func (*Windermere) Clear ¶
func (w *Windermere) Clear(tenant string) error
Clear will remove everything from the data model
func (*Windermere) CountResources ¶
func (w *Windermere) CountResources(tenant, resourceType string) int
CountResources will return the number of resources for a given resource type
func (*Windermere) GetParsedResource ¶
func (w *Windermere) GetParsedResource(tenant, resourceType string, id string) (interface{}, error)
func (*Windermere) GetParsedResources ¶
func (w *Windermere) GetParsedResources(tenant, resourceType string) (map[string]interface{}, error)
func (*Windermere) GetResource ¶
func (w *Windermere) GetResource(tenant, resourceType string, id string) (string, error)
func (*Windermere) GetResourceTypes ¶
func (w *Windermere) GetResourceTypes(tenant string) []string
GetResourceTypes returns the resource types for which we have objects
func (*Windermere) GetResources ¶
func (w *Windermere) GetResources(tenant, resourceType string) (map[string]string, error)
func (*Windermere) Save ¶
func (w *Windermere) Save() error
Save makes sure the datamodel is persisted to disk
func (*Windermere) ServeHTTP ¶
func (wind *Windermere) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*Windermere) Shutdown ¶ added in v0.2.0
func (wind *Windermere) Shutdown() error