Documentation ¶
Index ¶
- Variables
- func GenerateAuthURL(clientId, redirectURI string, scopes ...string) string
- type Chat
- type ChatId
- type Date
- type Error
- type File
- type FileRelation
- type FrameParseError
- type Homework
- type HomeworkId
- type Homeworker
- func (h *Homeworker) Chat(id ChatId) (Chat, error)
- func (h *Homeworker) ChatMembers(id ChatId) ([]User, error)
- func (h *Homeworker) ChatMessages(id ChatId, before MessageId) ([]Message, error)
- func (h *Homeworker) Chats() ([]Chat, error)
- func (h *Homeworker) CheckHomework(id HomeworkId) error
- func (h *Homeworker) Code(clientId, clientSecret, code string) (string, error)
- func (h *Homeworker) CreateChat(name string, filesAllowed, everybodyCanStartCall, broadcastOnly bool) (Chat, error)
- func (d *Homeworker) DeleteFile(hash string) error
- func (h *Homeworker) DeleteHomework(id HomeworkId) (Homework, error)
- func (h *Homeworker) DeleteMessage(chat ChatId, message MessageId) error
- func (h *Homeworker) EndPhaseSession(id PhaseSessionId) (time.Time, error)
- func (h *Homeworker) Files(relation FileRelation) ([]File, error)
- func (h *Homeworker) FormatText(s string) (Text, error)
- func (h *Homeworker) Homework(id HomeworkId) (Homework, error)
- func (h *Homeworker) Homeworks() ([]Homework, error)
- func (h *Homeworker) LessonContents(from, to Date) ([]LessonContent, error)
- func (h *Homeworker) Lessons() ([]Lesson, error)
- func (h *Homeworker) Login(email, password string) error
- func (h *Homeworker) MarkMessageAsLastRead(chat ChatId, message MessageId) (Message, error)
- func (h *Homeworker) Me() (Me, error)
- func (h *Homeworker) MuteChat(id ChatId, mute bool) error
- func (h *Homeworker) News() ([]News, error)
- func (h *Homeworker) PinChat(id ChatId, pin bool) error
- func (h *Homeworker) Poll(chat ChatId, poll PollId) (Poll, error)
- func (h *Homeworker) PollVote(chat ChatId, poll PollId, option OptionId) (Poll, error)
- func (h *Homeworker) RefreshToken(clientId, clientSecret, refreshToken string) error
- func (h *Homeworker) Register(email, password string) error
- func (h *Homeworker) Representations() ([]Representation, error)
- func (h *Homeworker) SendMessage(id ChatId, text string, files bool) (Message, error)
- func (h *Homeworker) SendPollMessage(id ChatId, text string, anonymous, multipleChoice bool, options ...string) (Message, error)
- func (h *Homeworker) SetChat(id ChatId, name string, ...) (Chat, error)
- func (h *Homeworker) StartPhaseSession(lessonId LessonId) (PhaseSessionId, error)
- func (h *Homeworker) UploadFile(relation FileRelation, name string, r io.Reader) (File, error)
- func (h *Homeworker) Websocket(ctx context.Context, c chan<- interface{}) error
- type Lesson
- type LessonContent
- type LessonContentId
- type LessonId
- type Me
- type Message
- type MessageDeletion
- type MessageId
- type MessageType
- type News
- type OptionId
- type PhaseSessionId
- type Poll
- type PollId
- type PollOption
- type Representation
- type Text
- type User
- type UserBadges
- type UserId
- type WebsocketRaw
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEmailUnknown = errors.New("houmweke: email unknown") ErrEmailRegistered = errors.New("houmweke: email already registered") ErrPasswordIncorrect = errors.New("houmweke: password incorrect") ErrPasswordInvalid = errors.New("houmweke: password does not follow requirements") ErrNotLoggedIn = errors.New("houmweke: not logged in") )
Functions ¶
func GenerateAuthURL ¶
Types ¶
type Chat ¶
type Chat struct { Id ChatId Name string CreatedAt time.Time `json:"created_at"` IsDirect bool `json:"is_direct"` BroadcastOnly bool `json:"broadcast_only"` FilesAllowed bool `json:"files_allowed"` EveryoneCanStartCall bool `json:"everybody_can_start_call"` UnreadMessages int `json:"unread_messages"` IsMuted bool `json:"is_muted"` IsPinned bool `json:"is_pinned"` IsAdmin bool `json:"is_admin"` CanWrite bool `json:"can_write"` CanSendFiles bool `json:"can_send_files"` CanStartCall bool `json:"can_start_call"` CanEdit bool `json:"can_edit"` LastMessage Message `json:"last_message"` }
type File ¶
type File struct { Id uint Hash string SHA1Checksum string `json:"sha1_checksum"` Name string ContentType string `json:"content_type"` Size uint IsPublic bool `json:"is_public"` UploadedAt time.Time `json:"uploaded"` URL string CanDelete bool `json:"can_delete"` Type string TypeEmoji string `json:"type_emoji"` }
type FileRelation ¶
type FileRelation string
const (
FileMessage FileRelation = "chat-message-file-new"
)
type FrameParseError ¶
func (FrameParseError) Error ¶
func (e FrameParseError) Error() string
type Homework ¶
type Homework struct { Id HomeworkId Text string Note string NoteHTML string `json:"note_formatted"` NoteBasic string `json:"note_basic"` PostedOn time.Time `json:"posted_on"` Until time.Time `json:"until_datetime"` IsScheduled bool `json:"is_scheduled"` IsUpdated bool `json:"is_updated"` Lesson Lesson IsChecked bool `json:"is_checked"` CanCheck bool `json:"can_check"` IsSubmittable bool `json:"is_submissionable"` CanCorrect bool `json:"can_correct"` }
type HomeworkId ¶
type HomeworkId uint
type Homeworker ¶
type Homeworker struct { Client string // contains filtered or unexported fields }
func (*Homeworker) ChatMembers ¶
func (h *Homeworker) ChatMembers(id ChatId) ([]User, error)
func (*Homeworker) ChatMessages ¶
func (h *Homeworker) ChatMessages(id ChatId, before MessageId) ([]Message, error)
func (*Homeworker) Chats ¶
func (h *Homeworker) Chats() ([]Chat, error)
func (*Homeworker) CheckHomework ¶
func (h *Homeworker) CheckHomework(id HomeworkId) error
func (*Homeworker) Code ¶
func (h *Homeworker) Code(clientId, clientSecret, code string) (string, error)
func (*Homeworker) CreateChat ¶
func (h *Homeworker) CreateChat(name string, filesAllowed, everybodyCanStartCall, broadcastOnly bool) (Chat, error)
func (*Homeworker) DeleteFile ¶
func (d *Homeworker) DeleteFile(hash string) error
func (*Homeworker) DeleteHomework ¶
func (h *Homeworker) DeleteHomework(id HomeworkId) (Homework, error)
func (*Homeworker) DeleteMessage ¶
func (h *Homeworker) DeleteMessage(chat ChatId, message MessageId) error
func (*Homeworker) EndPhaseSession ¶
func (h *Homeworker) EndPhaseSession(id PhaseSessionId) (time.Time, error)
func (*Homeworker) Files ¶
func (h *Homeworker) Files(relation FileRelation) ([]File, error)
func (*Homeworker) FormatText ¶
func (h *Homeworker) FormatText(s string) (Text, error)
func (*Homeworker) Homework ¶
func (h *Homeworker) Homework(id HomeworkId) (Homework, error)
func (*Homeworker) Homeworks ¶
func (h *Homeworker) Homeworks() ([]Homework, error)
func (*Homeworker) LessonContents ¶
func (h *Homeworker) LessonContents(from, to Date) ([]LessonContent, error)
func (*Homeworker) Lessons ¶
func (h *Homeworker) Lessons() ([]Lesson, error)
func (*Homeworker) Login ¶
func (h *Homeworker) Login(email, password string) error
func (*Homeworker) MarkMessageAsLastRead ¶
func (h *Homeworker) MarkMessageAsLastRead(chat ChatId, message MessageId) (Message, error)
func (*Homeworker) Me ¶
func (h *Homeworker) Me() (Me, error)
func (*Homeworker) News ¶
func (h *Homeworker) News() ([]News, error)
func (*Homeworker) RefreshToken ¶
func (h *Homeworker) RefreshToken(clientId, clientSecret, refreshToken string) error
func (*Homeworker) Register ¶
func (h *Homeworker) Register(email, password string) error
func (*Homeworker) Representations ¶
func (h *Homeworker) Representations() ([]Representation, error)
func (*Homeworker) SendMessage ¶
func (*Homeworker) SendPollMessage ¶
func (*Homeworker) StartPhaseSession ¶
func (h *Homeworker) StartPhaseSession(lessonId LessonId) (PhaseSessionId, error)
func (*Homeworker) UploadFile ¶
func (h *Homeworker) UploadFile(relation FileRelation, name string, r io.Reader) (File, error)
type LessonContent ¶
type LessonContentId ¶
type LessonContentId uint
type Me ¶
type Me struct { User NameIsEditable bool `json:"name_is_editable"` IsPro bool `json:"is_pro"` IsStudent bool `json:"is_student"` IsTeacher bool `json:"is_teacher"` Mail string MailVerified bool `json:"mail_verified"` MailIsEditable bool `json:"mail_is_editable"` Mobile string MobileVerified bool `json:"mobile_verified"` MobileIsEditable bool `json:"mobile_is_editable"` Birthday Date BirthdayIsEditable bool `json:"birthday_is_editable"` RegisteredAt time.Time `json:"registered_at"` LastSeenAt time.Time `json:"last_seen_at"` }
type Message ¶
type Message struct { Id MessageId ChatId ChatId `json:"chat_id"` Text string TextHTML string `json:"text_formatted"` TextBasic string `json:"text_basic"` User User Type MessageType `json:"meta_type"` SentAt time.Time `json:"sent_at"` IsOwn bool `json:"is_own"` CanDelete bool `json:"can_delete"` Files []File Poll Poll }
type MessageDeletion ¶
type MessageDeletion struct {
Id MessageId
}
type PhaseSessionId ¶
type PhaseSessionId uint
type PollOption ¶
type Representation ¶
type UserBadges ¶
func (*UserBadges) UnmarshalJSON ¶
func (u *UserBadges) UnmarshalJSON(b []byte) error
type WebsocketRaw ¶
type WebsocketRaw struct { Type string Data json.RawMessage }
Click to show internal directories.
Click to hide internal directories.