Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultUserAgent = "StudIP Golang Library (github.com/blang/studip)"
DefaultUserAgent if not already set by API.Header
var StudIPAPIBaseURL = "https://studip.uni-passau.de/studip/api.php/"
StudIPAPIBaseURL, the url to the api
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
Header http.Header
Client HTTPClient
}
API to communicate with StudIP
func (*API) DocumentTree ¶
func (a *API) DocumentTree() (*DocumentTree, error)
DocumentTree represents a tree of all semesters and corresponding documents. An error is returned if the request could not be completed. The error can be a StatusCodeError.
type DocumentTree ¶
type DocumentTree []struct {
SemesterID string `json:"semester_id"`
Title string `json:"title"`
Description string `json:"description"`
Courses []struct {
CourseID string `json:"course_id"`
CourseNr string `json:"course_nr"`
Title string `json:"title"`
Folders []Folder `json:"folders"`
} `json:"courses"`
}
DocumentTree represents a tree of all semesters and its documents. API Endpoints: - api/studip-client-core/documenttree/
type Folder ¶
type Folder struct {
FolderID string `json:"folder_id"`
Name string `json:"name"`
Mkdate string `json:"mkdate"`
Chdate string `json:"chdate"`
Permissions struct {
Visible bool `json:"visible"`
Writable bool `json:"writable"`
Readable bool `json:"readable"`
Extendable bool `json:"extendable"`
} `json:"permissions"`
Subfolders []Folder `json:"subfolders"`
Files []struct {
DocumentID string `json:"document_id"`
Name string `json:"name"`
Mkdate string `json:"mkdate"`
Chdate string `json:"chdate"`
Filename string `json:"filename"`
Filesize string `json:"filesize"`
Protection string `json:"protection"`
MimeType string `json:"mime_type"`
} `json:"files"`
}
Folder represents a folder in studips documents.
type HTTPClient ¶
HTTPClient is a general interface for http requests. Implemented by *http.Client
type StatusCodeError ¶
StatusCodeError is returned if the error is only specified by an invalid status code.
func (StatusCodeError) Error ¶
func (e StatusCodeError) Error() string
Error returns the error message