Documentation
¶
Overview ¶
Package apidoc reads the Technitium API document vendored under api-defs: the calls it describes, by path, with the parameters each takes. Technitium publishes no machine-readable description of its API, only this document written for people, so this is what the client in sdk/technitium is held against - which calls exist, and what each is sent.
The document is regular enough to read: every call is a "###" section holding a "URL:" line with an example address, an optional "OBSOLETE PATH:" list, and a "WHERE:" list of parameters before its "RESPONSE:". A call that is sent a body says so under "REQUEST:", where a form's fields are shown as they are posted. A section that does not read that way is an error, never a call quietly left out: a document whose layout changed must not pass for one fully covered.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Call ¶
type Call struct {
// Title is the section's heading: List Zones
Title string
// Path is the call's path under /api/: zones/list
Path string
// Obsolete are the paths the call went by in older versions, which a
// current client must not use
Obsolete []string
// Params are the names of the parameters the call takes: those its
// WHERE list gives, those its example address carries, and the fields of
// a form its REQUEST shows
Params []string
// Upload is the call taking a file, posted as a form's
Upload bool
}
Call is one API call as the document describes it.
type Doc ¶
type Doc struct {
// Version is the server version the document is for, from its file name
Version string
// File is the document's file name
File string
Calls []Call
}
Doc is the document read.
func Vendored ¶
Vendored reads the document vendored in this repository, for the highest server version there.
func (*Doc) ReplacedBy ¶
ReplacedBy is the call that now stands where an obsolete path did, nil when the path is no call's old one.