Documentation
¶
Overview ¶
Package ossucs is the library behind the ossucs command line: the HTTP client, request shaping, and the typed data models for the OSSU Computer Science curriculum.
The Client here is the spine every command shares. It sets a real User-Agent, paces requests so a busy session stays polite, and retries the transient failures (429 and 5xx) that any public site throws under load.
Index ¶
Constants ¶
const DefaultUserAgent = "ossucs/dev (+https://github.com/tamnd/ossucs-cli)"
DefaultUserAgent identifies the client to the remote host.
const Host = "github.com/ossu/computer-science"
Host is the site the URI driver in domain.go claims.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
BaseURL string
Rate time.Duration
Timeout time.Duration
Retries int
UserAgent string
}
Config holds all tunables for the Client.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns a Config pointed at raw.githubusercontent.com with conservative pacing and retry settings.
type Course ¶
type Course struct {
Rank int `json:"rank" csv:"rank" tsv:"rank"`
Section string `json:"section" csv:"section" tsv:"section"`
Title string `json:"title" csv:"title" tsv:"title"`
URL string `json:"url" csv:"url" tsv:"url"`
}
Course is one course in the OSSU Computer Science curriculum.
type Domain ¶
type Domain struct{}
Domain is the ossucs driver. It carries no state; the per-run client is built by the factory Register hands kit.
func (Domain) Info ¶
func (Domain) Info() kit.DomainInfo
Info describes the scheme, the hostnames a pasted link is matched against, and the identity reused for the binary's help and version.