windermere

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewActivityRow

func NewActivityRow(tenant string, activity *ss12000v1.Activity) dbActivityRow

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 NewUserRow(tenant string, user *ss12000v1.User) dbUserRow

func NoValidation added in v0.4.0

func NoValidation(obj ss12000v1.Object) error

Dummy validator that does nothing

Types

type ObjectParser added in v0.4.0

type ObjectParser func(resourceType, resource string) (ss12000v1.Object, error)

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)

func (*SQLBackend) Update

func (backend *SQLBackend) Update(tenant, resourceType, resourceID, resource string) (string, error)

type Validator added in v0.4.0

type Validator func(obj ss12000v1.Object) error

A function that does some kind of validation of an SS12000 object

func CreateOptionalValidator added in v0.4.0

func CreateOptionalValidator(uuid, schoolUnitCode bool) Validator

Convenience function for creating a validator with specified validators included

func MultiValidator added in v0.4.0

func MultiValidator(validators []Validator) Validator

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

Jump to

Keyboard shortcuts

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