Documentation ¶
Index ¶
- Constants
- Variables
- func PointerToUint64(x uint64) *uint64
- type AdminMessage
- type AdminMessageData
- type AdminMessageSeverity
- type Device
- type GetAdminMessagesOpts
- type GetDevicesOpts
- type GetNetworkingServicesOpts
- type GetStudentsOpts
- type NetworkingService
- type OAuth2State
- type OIDCFederation
- type Organization
- type PaginatedDevices
- type PaginatedNetworkingServices
- type PaginatedStudents
- type Pagination
- type Student
- type User
- type Wrapper
- func (w *Wrapper) AreDevicesInOrganization(ctx context.Context, organizationID uuid.UUID, ids ...uuid.UUID) (bool, error)
- func (w *Wrapper) AreStudentsInOrganization(ctx context.Context, organizationID uuid.UUID, ids ...uuid.UUID) (bool, error)
- func (w *Wrapper) Close() error
- func (w *Wrapper) CreateAdminMessage(ctx context.Context, msg AdminMessage) error
- func (w *Wrapper) CreateDevice(ctx context.Context, organizationID uuid.UUID, name string) (Device, uuid.UUID, error)
- func (w *Wrapper) CreateDeviceRegistrationToken(ctx context.Context, organizationID uuid.UUID) (uuid.UUID, error)
- func (w *Wrapper) CreateDeviceToken(ctx context.Context, deviceID uuid.UUID) (uuid.UUID, error)
- func (w *Wrapper) CreateNetworkingService(ctx context.Context, organizationID uuid.UUID, name string) (NetworkingService, error)
- func (w *Wrapper) CreateNewUser(ctx context.Context, name, email string, federation OIDCFederation) (User, error)
- func (w *Wrapper) CreateOAuth2State(ctx context.Context, issuer, redirectURL string) (OAuth2State, error)
- func (w *Wrapper) CreateOIDCFederation(ctx context.Context, federation OIDCFederation) (OIDCFederation, error)
- func (w *Wrapper) CreateOrganization(ctx context.Context, name string, zermeloInstitution string) (Organization, error)
- func (w *Wrapper) CreateStudent(ctx context.Context, s Student) (Student, error)
- func (w *Wrapper) CreateUser(ctx context.Context, name, email string, organizationID uuid.UUID) (User, error)
- func (w *Wrapper) CreateUserToken(ctx context.Context, userID uuid.UUID) (uuid.UUID, error)
- func (w *Wrapper) DeleteDevice(ctx context.Context, id uuid.UUID) error
- func (w *Wrapper) DeleteDevices(ctx context.Context, ids []uuid.UUID) error
- func (w *Wrapper) DeleteNetworkingService(ctx context.Context, id uuid.UUID) error
- func (w *Wrapper) DeleteOldDeviceTokens(ctx context.Context) error
- func (w *Wrapper) DeleteOldOAuth2States(ctx context.Context) error
- func (w *Wrapper) DeleteOldUserTokens(ctx context.Context) error
- func (w *Wrapper) DeleteOrganization(ctx context.Context, id uuid.UUID) error
- func (w *Wrapper) DeleteStudent(ctx context.Context, id uuid.UUID) error
- func (w *Wrapper) DeleteStudentCards(ctx context.Context, studentID uuid.UUID) error
- func (w *Wrapper) DeleteStudents(ctx context.Context, ids []uuid.UUID) error
- func (w *Wrapper) GetAdminMessage(ctx context.Context, tm time.Time, organizationID uuid.UUID) (AdminMessage, error)
- func (w *Wrapper) GetAdminMessages(ctx context.Context, opts GetAdminMessagesOpts) ([]AdminMessage, error)
- func (w *Wrapper) GetAllNetworkingServices(ctx context.Context, organizationID uuid.UUID) ([]NetworkingService, error)
- func (w *Wrapper) GetDevice(ctx context.Context, id uuid.UUID) (Device, error)
- func (w *Wrapper) GetDeviceByToken(ctx context.Context, token uuid.UUID) (Device, error)
- func (w *Wrapper) GetDevices(ctx context.Context, opts GetDevicesOpts) (PaginatedDevices, error)
- func (w *Wrapper) GetNetworkingService(ctx context.Context, id uuid.UUID) (NetworkingService, error)
- func (w *Wrapper) GetNetworkingServices(ctx context.Context, opts GetNetworkingServicesOpts) (PaginatedNetworkingServices, error)
- func (w *Wrapper) GetOAuth2State(ctx context.Context, state uuid.UUID) (OAuth2State, error)
- func (w *Wrapper) GetOrganization(ctx context.Context, id uuid.UUID) (Organization, error)
- func (w *Wrapper) GetOrganizationByDeviceRegistrationToken(ctx context.Context, token uuid.UUID) (Organization, error)
- func (w *Wrapper) GetStudent(ctx context.Context, id uuid.UUID) (Student, error)
- func (w *Wrapper) GetStudentByCard(ctx context.Context, uid []byte, organizationID uuid.UUID) (Student, error)
- func (w *Wrapper) GetStudents(ctx context.Context, opts GetStudentsOpts) (PaginatedStudents, error)
- func (w *Wrapper) GetUserByEmail(ctx context.Context, email string) (User, error)
- func (w *Wrapper) GetUserByID(ctx context.Context, id uuid.UUID) (User, error)
- func (w *Wrapper) GetUserByOIDCFederation(ctx context.Context, federation OIDCFederation) (User, error)
- func (w *Wrapper) GetUserByToken(ctx context.Context, token uuid.UUID) (User, error)
- func (w *Wrapper) ReplaceDevice(ctx context.Context, dev Device) error
- func (w *Wrapper) ReplaceDeviceHeartbeat(ctx context.Context, id uuid.UUID) error
- func (w *Wrapper) ReplaceNetworkingService(ctx context.Context, s NetworkingService) error
- func (w *Wrapper) ReplaceOrganization(ctx context.Context, org Organization) error
- func (w *Wrapper) ReplaceStudent(ctx context.Context, s Student) error
- func (w *Wrapper) ReplaceStudentCard(ctx context.Context, organizationID, studentID uuid.UUID, cardUID []byte) error
- func (w *Wrapper) ReplaceUser(ctx context.Context, user User) error
- func (w *Wrapper) WalkDevices(ctx context.Context, organizationID uuid.UUID, f func(dev Device) bool) error
- type WrapperOpt
Constants ¶
View Source
const DefaultTokenExpiration = time.Hour * 24
Variables ¶
View Source
var ErrConflict = &dbError{message: "conflict"}
Functions ¶
func PointerToUint64 ¶
Types ¶
type AdminMessage ¶
type AdminMessageData ¶
type AdminMessageSeverity ¶
type AdminMessageSeverity string
const ( AdminMessageSeverityError AdminMessageSeverity = "error" AdminMessageSeverityInfo AdminMessageSeverity = "info" )
type GetAdminMessagesOpts ¶
type GetDevicesOpts ¶
type GetStudentsOpts ¶
type NetworkingService ¶
type OAuth2State ¶
type OIDCFederation ¶
type PaginatedDevices ¶
type PaginatedDevices struct { Pagination Devices []Device }
type PaginatedNetworkingServices ¶
type PaginatedNetworkingServices struct { Pagination NetworkingServices []NetworkingService }
type PaginatedStudents ¶
type PaginatedStudents struct { Pagination Students []Student }
type Pagination ¶
type Pagination struct {
Offset, Limit, Total uint64
}
type Wrapper ¶
type Wrapper struct {
// contains filtered or unexported fields
}
Wrapper wraps the PostgreSQL database.
func (*Wrapper) AreDevicesInOrganization ¶
func (*Wrapper) AreStudentsInOrganization ¶
func (*Wrapper) CreateAdminMessage ¶
func (w *Wrapper) CreateAdminMessage(ctx context.Context, msg AdminMessage) error
func (*Wrapper) CreateDevice ¶
func (*Wrapper) CreateDeviceRegistrationToken ¶
func (*Wrapper) CreateDeviceToken ¶
func (*Wrapper) CreateNetworkingService ¶
func (*Wrapper) CreateNewUser ¶
func (*Wrapper) CreateOAuth2State ¶
func (*Wrapper) CreateOIDCFederation ¶
func (w *Wrapper) CreateOIDCFederation(ctx context.Context, federation OIDCFederation) (OIDCFederation, error)
func (*Wrapper) CreateOrganization ¶
func (*Wrapper) CreateStudent ¶
func (*Wrapper) CreateUser ¶
func (*Wrapper) CreateUserToken ¶
func (*Wrapper) DeleteDevice ¶
func (*Wrapper) DeleteDevices ¶
func (*Wrapper) DeleteNetworkingService ¶
func (*Wrapper) DeleteOldDeviceTokens ¶
func (*Wrapper) DeleteOldOAuth2States ¶
func (*Wrapper) DeleteOldUserTokens ¶
func (*Wrapper) DeleteOrganization ¶
func (*Wrapper) DeleteStudent ¶
func (*Wrapper) DeleteStudentCards ¶
func (*Wrapper) DeleteStudents ¶
func (*Wrapper) GetAdminMessage ¶
func (*Wrapper) GetAdminMessages ¶
func (w *Wrapper) GetAdminMessages(ctx context.Context, opts GetAdminMessagesOpts) ([]AdminMessage, error)
func (*Wrapper) GetAllNetworkingServices ¶
func (*Wrapper) GetDeviceByToken ¶
func (*Wrapper) GetDevices ¶
func (w *Wrapper) GetDevices(ctx context.Context, opts GetDevicesOpts) (PaginatedDevices, error)
func (*Wrapper) GetNetworkingService ¶
func (*Wrapper) GetNetworkingServices ¶
func (w *Wrapper) GetNetworkingServices(ctx context.Context, opts GetNetworkingServicesOpts) (PaginatedNetworkingServices, error)
func (*Wrapper) GetOAuth2State ¶
func (*Wrapper) GetOrganization ¶
func (*Wrapper) GetOrganizationByDeviceRegistrationToken ¶
func (*Wrapper) GetStudent ¶
func (*Wrapper) GetStudentByCard ¶
func (*Wrapper) GetStudents ¶
func (w *Wrapper) GetStudents(ctx context.Context, opts GetStudentsOpts) (PaginatedStudents, error)
func (*Wrapper) GetUserByEmail ¶
func (*Wrapper) GetUserByID ¶
func (*Wrapper) GetUserByOIDCFederation ¶
func (*Wrapper) GetUserByToken ¶
func (*Wrapper) ReplaceDevice ¶
func (*Wrapper) ReplaceDeviceHeartbeat ¶
func (*Wrapper) ReplaceNetworkingService ¶
func (w *Wrapper) ReplaceNetworkingService(ctx context.Context, s NetworkingService) error
func (*Wrapper) ReplaceOrganization ¶
func (w *Wrapper) ReplaceOrganization(ctx context.Context, org Organization) error
func (*Wrapper) ReplaceStudent ¶
func (*Wrapper) ReplaceStudentCard ¶
type WrapperOpt ¶
type WrapperOpt func(w wrapperOpts) wrapperOpts
func WithJanitor ¶
func WithJanitor(on bool) WrapperOpt
func WithMigrationsURL ¶
func WithMigrationsURL(url string) WrapperOpt
Click to show internal directories.
Click to hide internal directories.