Versions in this module Expand all Collapse all v0 v0.1.0 Nov 28, 2026 Changes in this version + var ErrForbidden = errors.New("iserv: forbidden") + var ErrInvalidCredentials = errors.New("iserv: invalid credentials") + var ErrInvalidDomain = errors.New("iserv: invalid school domain") + var ErrNotFound = errors.New("iserv: not found") + var ErrResponseTooLarge = errors.New("iserv: response body too large") + var ErrUnauthorized = errors.New("iserv: unauthorized") + var ErrUpstreamProtocol = errors.New("iserv: upstream protocol error") + var ErrUpstreamUnavailable = errors.New("iserv: upstream unavailable") + var ErrValidation = errors.New("iserv: validation error") + func ErrorCode(err error) string + func NewLogger(w io.Writer, level slog.Level) *slog.Logger + type Address struct + Email string + Name string + type Attachment struct + ContentType string + Filename string + ID string + Size int64 + type Avatar struct + ContentType string + Data []byte + type CalendarEvent struct + AllDay bool + CalendarID string + Categories []string + Description string + End time.Time + ID string + Location string + Start time.Time + Title string + type CalendarEventsOptions struct + End time.Time + SourceID string + Start time.Time + type CalendarService struct + func (s *CalendarService) Events(ctx context.Context, opts CalendarEventsOptions) ([]CalendarEvent, error) + func (s *CalendarService) List(ctx context.Context) ([]CalendarSource, error) + type CalendarSource struct + CalDAVPath string + Color string + ID string + Name string + ReadOnly bool + Type string + type Client struct + Calendar *CalendarService + Directory *DirectoryService + Email *EmailService + Files *FilesService + Groups *GroupsService + Notifications *NotificationsService + Profile *ProfileService + Tasks *TasksService + func New(ctx context.Context, schoolDomain, username, password string, opts ...Option) (*Client, error) + func NewUnauthenticated(schoolDomain, username, password string, opts ...Option) (*Client, error) + func (c *Client) BaseURL() string + func (c *Client) Close(ctx context.Context) error + func (c *Client) Domain() string + func (c *Client) Login(ctx context.Context) error + func (c *Client) Logout(ctx context.Context) error + func (c *Client) Username() string + type DirectoryService struct + func (s *DirectoryService) SearchUsers(ctx context.Context, query string) ([]DirectoryUser, error) + type DirectoryUser struct + Account string + AvatarURL string + Department string + Email string + FirstName string + FullName string + Groups []string + LastName string + Role string + type EmailDetail struct + Attachments []Attachment + CC []Address + HTMLBody string + TextBody string + type EmailListOptions struct + Folder string + Limit int + Offset int + OrderBy string + OrderDir string + type EmailPage struct + Items []EmailSummary + Meta PageMeta + type EmailService struct + func (s *EmailService) All(ctx context.Context, opts EmailListOptions) iter.Seq2[EmailSummary, error] + func (s *EmailService) Folders(ctx context.Context) ([]Folder, error) + func (s *EmailService) Get(ctx context.Context, folder, uid string) (*EmailDetail, error) + func (s *EmailService) List(ctx context.Context, opts EmailListOptions) (*EmailPage, error) + type EmailSummary struct + Date time.Time + Flagged bool + Folder string + From Address + HasAttachments bool + Seen bool + Size int64 + Subject string + To []Address + UID string + type Error struct + Cause error + Code string + Details map[string]string + Err error + Message string + Op string + StatusCode int + func (e *Error) Error() string + func (e *Error) Unwrap() []error + type FileDownload struct + Body io.ReadCloser + ContentType string + FileName string + Size int64 + type FileEntry struct + ContentType string + ETag string + IsDir bool + ModifiedAt *time.Time + Name string + Path string + Size int64 + type FilesService struct + func (s *FilesService) Download(ctx context.Context, filePath string) (*FileDownload, error) + func (s *FilesService) DownloadTo(ctx context.Context, filePath string, w io.Writer) (int64, error) + func (s *FilesService) List(ctx context.Context, dirPath string) ([]FileEntry, error) + type Folder struct + Flags []string + Name string + Path string + TotalCount int + UnreadCount int + type Group struct + Account string + Description string + FilesPath string + ID string + MemberCount int + Name string + Owner string + type GroupDetail struct + Members []GroupMember + type GroupMember struct + Email string + FullName string + Role string + Username string + type GroupsService struct + func (s *GroupsService) Get(ctx context.Context, rawID string) (*GroupDetail, error) + func (s *GroupsService) List(ctx context.Context) ([]Group, error) + type Notification struct + CreatedAt time.Time + ID string + Message string + Module string + Read bool + Title string + URL string + type NotificationsService struct + func (s *NotificationsService) List(ctx context.Context) ([]Notification, error) + func (s *NotificationsService) MarkAllRead(ctx context.Context) error + func (s *NotificationsService) MarkRead(ctx context.Context, rawID string) error + type Option func(*clientConfig) error + func WithAllowInsecureHTTP(allow bool) Option + func WithAutoReauth(enabled bool) Option + func WithHTTPTransport(rt http.RoundTripper) Option + func WithLogger(logger *slog.Logger) Option + func WithMaxBodyBytes(n int64) Option + func WithTimeout(d time.Duration) Option + func WithUserAgent(ua string) Option + type PageMeta struct + HasMore bool + Limit int + Offset int + Total int + type Profile struct + Attributes map[string]string + AvatarURL string + Email string + FirstName string + FullName string + Groups []string + LastName string + SchoolDomain string + Username string + type ProfileService struct + func (s *ProfileService) Avatar(ctx context.Context) (*Avatar, error) + func (s *ProfileService) Get(ctx context.Context) (*Profile, error) + type TaskAttachment struct + Name string + URL string + type TaskDetail struct + Attachments []TaskAttachment + Author string + Description string + Feedback string + Submission string + type TaskStatus string + const TaskStatusAll + const TaskStatusCurrent + const TaskStatusPast + type TaskSummary struct + Done bool + DueDate string + ID string + Overdue bool + Reviewed bool + StartDate string + Tags []string + Title string + URL string + type TasksService struct + func (s *TasksService) Get(ctx context.Context, rawID string) (*TaskDetail, error) + func (s *TasksService) List(ctx context.Context, rawStatus TaskStatus) ([]TaskSummary, error)