Documentation ¶
Index ¶
- Constants
- func DeviceToDB(device Device) database.Device
- func NetworkingServiceToProto(netServ NetworkingService) *devcfgpb.NetworkingService
- func OrganisationToDB(org Organization) database.Organization
- func StringPtrFrom(ns sql.NullString) *string
- func StringPtrToDB(p *string) sql.NullString
- func StudentToDB(s Student) database.Student
- func UserToDB(user User) database.User
- type AdminMessage
- type AdminMessageSeverity
- type CaCertType
- type CombinedAppointment
- type CreateDeviceResponse
- type Device
- type Eap
- type EnrollParams
- type GenerateNATSCredentialsResponse
- type GetZermeloAppointmentsParams
- type Ipv4Config
- type Ipv4ConfigSettings
- type Ipv4ConfigType
- type Ipv6Config
- type Ipv6ConfigSettings
- type Ipv6ConfigType
- type Ipv6Privacy
- type NanoTime
- type NetworkingService
- type NetworkingServiceType
- type Organization
- type OrganizationZermeloInfo
- type PaginatedDevices
- type PaginatedNetworkingServices
- type PaginatedStudents
- type Pagination
- type PatchedStudent
- type Phase2Type
- type PrimaryDeviceStatus
- type PrivateKeyPassphraseType
- type PrivateKeyType
- type RegistrationConfig
- type Security
- type Server
- type StringPatch
- type Student
- type StudentZermeloInfo
- type TimeSpan
- type User
- type ZermeloAppointment
- type ZermeloAppointmentsResponse
Constants ¶
View Source
const ( PrimaryDeviceStatusOnline = "Online" PrimaryDeviceStatusOffline = "Offline" )
Variables ¶
This section is empty.
Functions ¶
func DeviceToDB ¶
func NetworkingServiceToProto ¶
func NetworkingServiceToProto(netServ NetworkingService) *devcfgpb.NetworkingService
func OrganisationToDB ¶
func OrganisationToDB(org Organization) database.Organization
func StringPtrFrom ¶
func StringPtrFrom(ns sql.NullString) *string
func StringPtrToDB ¶
func StringPtrToDB(p *string) sql.NullString
func StudentToDB ¶
Types ¶
type AdminMessage ¶
type AdminMessage struct { OrganizationID uuid.UUID `json:"organizationId"` LoggedAt NanoTime `json:"loggedAt"` Severity AdminMessageSeverity `json:"severity"` Verbosity int `json:"verbosity"` Summary string `json:"summary"` Message string `json:"message"` Fields map[string]interface{} `json:"fields"` }
type AdminMessageSeverity ¶
type AdminMessageSeverity string
const ( AdminMessageSeverityError AdminMessageSeverity = "error" AdminMessageSeverityInfo AdminMessageSeverity = "info" )
type CaCertType ¶
type CaCertType string
const ( CaCertTypePem CaCertType = "Pem" CaCertTypeDer CaCertType = "Der" )
type CombinedAppointment ¶
type CombinedAppointment struct { Appointment *zermelo.Appointment Participation *zermelo.AppointmentParticipation }
func (*CombinedAppointment) ToAPI ¶
func (a *CombinedAppointment) ToAPI() *ZermeloAppointment
type CreateDeviceResponse ¶
func CreateDeviceResponseFrom ¶
func CreateDeviceResponseFrom(device database.Device, token uuid.UUID) CreateDeviceResponse
type Device ¶
type Device struct { ID uuid.UUID `json:"id"` OrganizationID uuid.UUID `json:"organizationId"` Name string `json:"name"` PrimaryStatus PrimaryDeviceStatus `json:"primaryStatus"` }
func DeviceFrom ¶
func DevicesFrom ¶
type EnrollParams ¶
func EnrollParamsFromRequest ¶
func EnrollParamsFromRequest(r *http.Request) (EnrollParams, error)
type GenerateNATSCredentialsResponse ¶
type GenerateNATSCredentialsResponse struct {
Credentials string `json:"credentials"`
}
type Ipv4Config ¶
type Ipv4Config struct { Type Ipv4ConfigType `json:"type,omitempty"` Settings *Ipv4ConfigSettings `json:"settings,omitempty"` }
type Ipv4ConfigSettings ¶
type Ipv4ConfigType ¶
type Ipv4ConfigType string
const ( Ipv4ConfigTypeOff Ipv4ConfigType = "Off" Ipv4ConfigTypeDhcp Ipv4ConfigType = "Dhcp" Ipv4ConfigTypeCustom Ipv4ConfigType = "Custom" )
type Ipv6Config ¶
type Ipv6Config struct { Type Ipv6ConfigType `json:"type,omitempty"` Settings *Ipv6ConfigSettings `json:"settings,omitempty"` }
type Ipv6ConfigSettings ¶
type Ipv6ConfigType ¶
type Ipv6ConfigType string
const ( Ipv6ConfigTypeOff Ipv6ConfigType = "Off" Ipv6ConfigTypeAuto Ipv6ConfigType = "Auto" Ipv6ConfigTypeCustom Ipv6ConfigType = "Custom" )
type Ipv6Privacy ¶
type Ipv6Privacy string
const ( Ipv6PrivacyDisabled Ipv6Privacy = "Disabled" Ipv6PrivacyEnabled Ipv6Privacy = "Enabled" Ipv6PrivacyPreferred Ipv6Privacy = "Preferred" )
type NanoTime ¶
func (NanoTime) MarshalJSON ¶
type NetworkingService ¶
type NetworkingService struct { ID uuid.UUID `json:"id,omitempty"` OrganizationID uuid.UUID `json:"organizationId,omitempty"` Name string `json:"name,omitempty"` Type NetworkingServiceType `json:"type,omitempty"` Ipv4Config *Ipv4Config `json:"ipv4Config,omitempty"` Ipv6Config *Ipv6Config `json:"ipv6Config,omitempty"` Ipv6Privacy Ipv6Privacy `json:"ipv6Privacy,omitempty"` Mac string `json:"mac,omitempty"` Nameservers []string `json:"nameservers,omitempty"` SearchDomains []string `json:"searchDomains,omitempty"` Timeservers []string `json:"timeservers,omitempty"` Domain string `json:"domain,omitempty"` NetworkName string `json:"networkName,omitempty"` SSID string `json:"ssid,omitempty"` Passphrase string `json:"passphrase,omitempty"` Security Security `json:"security,omitempty"` IsHidden bool `json:"isHidden,omitempty"` Eap Eap `json:"eap,omitempty"` CaCert []byte `json:"caCert,omitempty"` CaCertType CaCertType `json:"caCertType,omitempty"` PrivateKey []byte `json:"privateKey,omitempty"` PrivateKeyType PrivateKeyType `json:"privateKeyType,omitempty"` PrivateKeyPassphrase string `json:"privateKeyPassphrase,omitempty"` PrivateKeyPassphraseType PrivateKeyPassphraseType `json:"privateKeyPassphraseType,omitempty"` Identity string `json:"identity,omitempty"` AnonymousIdentity string `json:"anonymousIdentify,omitempty"` SubjectMatch string `json:"subjectMatch,omitempty"` AltSubjectMatch string `json:"altSubjectMatch,omitempty"` DomainSuffixMatch string `json:"domainSuffixMatch,omitempty"` DomainMatch string `json:"domainMatch,omitempty"` Phase2 Phase2Type `json:"phase2,omitempty"` IsPhase2EapBased bool `json:"isPhase2EapBased,omitempty"` }
func NetworkingServiceFrom ¶
func NetworkingServiceFrom(cfg *devcfgpb.NetworkingService, db database.NetworkingService) NetworkingService
type NetworkingServiceType ¶
type NetworkingServiceType string
const ( NetworkingServiceTypeEthernet NetworkingServiceType = "Ethernet" NetworkingServiceTypeWifi NetworkingServiceType = "Wifi" )
type Organization ¶
type Organization struct { ID uuid.UUID `json:"id"` Name string `json:"name"` Zermelo OrganizationZermeloInfo `json:"zermelo"` }
func OrganizationFrom ¶
func OrganizationFrom(org database.Organization) Organization
type OrganizationZermeloInfo ¶
type OrganizationZermeloInfo struct {
Institution string `json:"institution"`
}
type PaginatedDevices ¶
type PaginatedDevices struct { Pagination Data []Device `json:"data"` }
func PaginatedDevicesFrom ¶
func PaginatedDevicesFrom(p database.PaginatedDevices) PaginatedDevices
type PaginatedNetworkingServices ¶
type PaginatedNetworkingServices struct { Pagination Data []NetworkingService `json:"data"` }
func PaginatedNetworkingServicesFrom ¶
func PaginatedNetworkingServicesFrom(p database.PaginatedNetworkingServices, data []NetworkingService) PaginatedNetworkingServices
type PaginatedStudents ¶
type PaginatedStudents struct { Pagination Data []Student `json:"data"` }
func PaginatedStudentsFrom ¶
func PaginatedStudentsFrom(p database.PaginatedStudents) PaginatedStudents
type Pagination ¶
type Pagination struct { Offset uint64 `json:"offset"` MaxAmount uint64 `json:"maxAmount"` Total uint64 `json:"total"` }
func PaginationFrom ¶
func PaginationFrom(p database.Pagination) Pagination
type PatchedStudent ¶
type PatchedStudent struct { Student CardID StringPatch `json:"cardId"` }
type Phase2Type ¶
type Phase2Type string
const ( Phase2TypeMschapV2 Phase2Type = "MschapV2" Phase2TypeGtc Phase2Type = "Gtc" )
type PrimaryDeviceStatus ¶
type PrimaryDeviceStatus string
type PrivateKeyPassphraseType ¶
type PrivateKeyPassphraseType string
const PrivateKeyPassphraseTypeFsid PrivateKeyPassphraseType = "Fsid"
type PrivateKeyType ¶
type PrivateKeyType string
const ( PrivateKeyTypePem PrivateKeyType = "Pem" PrivateKeyTypeDer PrivateKeyType = "Der" PrivateKeyTypePfx PrivateKeyType = "Pfx" )
type RegistrationConfig ¶
type RegistrationConfig struct { Token uuid.UUID `json:"token"` OrganizationID uuid.UUID `json:"organizationId"` NetworkingServices []NetworkingService `json:"networkingServices"` }
type StringPatch ¶
func (StringPatch) MarshalJSON ¶
func (p StringPatch) MarshalJSON() ([]byte, error)
func (*StringPatch) UnmarshalJSON ¶
func (p *StringPatch) UnmarshalJSON(b []byte) error
type Student ¶
type Student struct { ID uuid.UUID `json:"id"` OrganizationID uuid.UUID `json:"organizationId"` Zermelo StudentZermeloInfo `json:"zermelo"` HasCardAssociated bool `json:"hasCardAssociated,omitempty"` }
func StudentFrom ¶
func StudentsFrom ¶
type StudentZermeloInfo ¶
type StudentZermeloInfo struct {
User *string `json:"user,omitempty"`
}
type TimeSpan ¶
type TimeSpan struct {
StartUnix, EndUnix int64
}
func TimeSpanFromAppointment ¶
func TimeSpanFromAppointment(a *zermelo.Appointment) TimeSpan
type User ¶
type ZermeloAppointment ¶
type ZermeloAppointment struct { ID int `json:"id"` ParticipationID int `json:"participationId"` AppointmentInstance int `json:"appointmentInstance"` IsOnline *bool `json:"isOnline"` IsOptional *bool `json:"isOptional"` IsStudentEnrolled *bool `json:"isStudentEnrolled"` IsCanceled *bool `json:"isCanceled"` StartTimeSlotName string `json:"startTimeSlotName"` EndTimeSlotName string `json:"endTimeSlotName"` Subjects []string `json:"subjects"` Groups []string `json:"groups"` Locations []string `json:"locations"` Teachers []string `json:"teachers"` StartTime jsontypes.UnixTime `json:"startTime"` EndTime jsontypes.UnixTime `json:"endTime"` Content string `json:"content"` AvailableSpace *int `json:"availableSpace"` Capacity *int `json:"capacity"` Alternatives []*ZermeloAppointment `json:"alternatives"` AllowedStudentActions string `json:"allowedStudentActions"` }
type ZermeloAppointmentsResponse ¶
type ZermeloAppointmentsResponse struct {
Data []*ZermeloAppointment `json:"data"`
}
Click to show internal directories.
Click to hide internal directories.