Documentation ¶
Index ¶
- type V1
- func (api V1) ConfigHandler(w http.ResponseWriter, r *http.Request)
- func (api V1) HTTPMux() http.Handler
- func (api V1) HelloHandler(w http.ResponseWriter, r *http.Request)
- func (api *V1) MessagesHandler(w http.ResponseWriter, r *http.Request)
- func (api V1) NewConfig(s *plex.Source) (*V1Config, error)
- func (api V1) NewHello(s *plex.Source) (*V1Hello, error)
- func (api V1) NewNode(n *ddt.Node, s *plex.Source) (*V1Node, error)
- func (api V1) NewNodeAsset(a *ddt.NodeAsset) (*V1NodeAsset, error)
- func (api V1) NewSources(ss *plex.Sources) (*V1Sources, error)
- func (api V1) NewTree(t *ddt.Tree, s *plex.Source) (*V1Tree, error)
- func (api V1) NewTreeNode(n *ddt.Node, s *plex.Source) (*V1TreeNode, error)
- func (api V1) NewTreeSearchResults(nodes []*ddt.Node, total int, took time.Duration) *V1SearchResults
- func (api V1) NodeAssetHandler(w http.ResponseWriter, r *http.Request)
- func (api V1) NodeHandler(w http.ResponseWriter, r *http.Request)
- func (api V1) NotFoundHandler(w http.ResponseWriter, r *http.Request)
- func (api V1) SearchHandler(w http.ResponseWriter, r *http.Request)
- func (api V1) SourcesHandler(w http.ResponseWriter, r *http.Request)
- func (api V1) TreeHandler(w http.ResponseWriter, r *http.Request)
- type V1Config
- type V1Hello
- type V1Message
- type V1Node
- type V1NodeAsset
- type V1NodeAuthor
- type V1NodeDoc
- type V1NodeDocComponent
- type V1RefNode
- type V1SearchResults
- type V1Source
- type V1Sources
- type V1Tree
- type V1TreeNode
- type V2
- func (api V2) FilterHandler(w http.ResponseWriter, r *http.Request)
- func (api V2) HTTPMux() http.Handler
- func (api V2) NewTreeFilterResults(nodes []*ddt.Node, total int, took time.Duration) *V2FilterResults
- func (api V2) NewTreeSearchResults(hs []*search.FullSearchHit, total int, took time.Duration) *V2FullSearchResults
- func (api V2) SearchHandler(w http.ResponseWriter, r *http.Request)
- type V2FilterResults
- type V2FullSearchHit
- type V2FullSearchResults
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type V1 ¶
type V1 struct {
// contains filtered or unexported fields
}
func (V1) ConfigHandler ¶
func (api V1) ConfigHandler(w http.ResponseWriter, r *http.Request)
ConfigHandler responds with a configuration object.
Handles these URLs:
/api/v1/config
func (V1) HelloHandler ¶
func (api V1) HelloHandler(w http.ResponseWriter, r *http.Request)
Says hello :)
Handles these URLs:
/api/v1/hello
func (*V1) MessagesHandler ¶
func (api *V1) MessagesHandler(w http.ResponseWriter, r *http.Request)
WebSocket endpoint for receiving notifications.
Handles these URLs:
/api/v1/messages
func (V1) NewNodeAsset ¶
func (api V1) NewNodeAsset(a *ddt.NodeAsset) (*V1NodeAsset, error)
func (V1) NewTreeNode ¶
func (V1) NewTreeSearchResults ¶
func (V1) NodeAssetHandler ¶
func (api V1) NodeAssetHandler(w http.ResponseWriter, r *http.Request)
Returns a node asset.
Handles these kinds of URLs:
/api/v1/tree/Button/foo.mp4&v={version} /api/v1/tree/Button/colors.json&v={version} /api/v1/tree/Button/colors.yaml&v={version}
func (V1) NodeHandler ¶
func (api V1) NodeHandler(w http.ResponseWriter, r *http.Request)
Returns information about a single ddt.
Handles these kinds of URLs:
/api/v1/tree/DisplayData/Table?v={version}
func (V1) NotFoundHandler ¶
func (api V1) NotFoundHandler(w http.ResponseWriter, r *http.Request)
func (V1) SearchHandler ¶
func (api V1) SearchHandler(w http.ResponseWriter, r *http.Request)
Performs a search over the design defintions tree and returns results in form of a flat list of URLs of matched nodes.
Handles these URL:
/api/v1/search?q={query} /api/v1/search?q={query}&v={version}
func (V1) SourcesHandler ¶
func (api V1) SourcesHandler(w http.ResponseWriter, r *http.Request)
List available DDT sources.
Handles this URL:
/api/v1/sources
func (V1) TreeHandler ¶
func (api V1) TreeHandler(w http.ResponseWriter, r *http.Request)
Returns all nodes in the design defintions tree, as nested nodes.
Handles these URLs:
/api/v1/tree /api/v1/tree&v={version}
type V1Node ¶
type V1Node struct { Hash string `json:"hash"` URL string `json:"url"` Parent *V1RefNode `json:"parent"` Children []*V1RefNode `json:"children"` Title string `json:"title"` Description string `json:"description"` Authors []*V1NodeAuthor `json:"authors"` Modified int64 `json:"modified"` Version string `json:"version"` Tags []string `json:"tags"` Custom interface{} `json:"custom"` Docs []*V1NodeDoc `json:"docs"` Assets []*V1NodeAsset `json:"assets"` Crumbs []*V1RefNode `json:"crumbs"` Related []*V1RefNode `json:"related"` Prev *V1RefNode `json:"prev"` Next *V1RefNode `json:"next"` // Deprecated, to be removed in APIv3, please use Assets: Downloads []*V1NodeAsset `json:"downloads"` }
type V1NodeAsset ¶
type V1NodeAuthor ¶
type V1NodeDoc ¶
type V1NodeDoc struct { Title string `json:"title"` HTML string `json:"html"` Raw string `json:"raw"` Components []*V1NodeDocComponent `json:"components"` }
type V1NodeDocComponent ¶
type V1RefNode ¶
V1NodeRef have no parent and children. References must be looked up using the URL to get more information about them.
type V1SearchResults ¶
type V1Tree ¶
type V1Tree struct { Hash string `json:"hash"` Root *V1TreeNode `json:"root"` Total uint16 `json:"total"` }
type V1TreeNode ¶
type V1TreeNode struct { Hash string `json:"hash"` URL string `json:"url"` Children []*V1TreeNode `json:"children"` Title string `json:"title"` }
V1TreeMode is a light top down representation of a part of the DDT.
type V2 ¶
type V2 struct {
// contains filtered or unexported fields
}
func (V2) FilterHandler ¶
func (api V2) FilterHandler(w http.ResponseWriter, r *http.Request)
Performs a restricted narrow search over the design defintions tree.
Handles these URLs:
/api/v2/filter?q={query} /api/v2/filter?q={query}&v={version}
func (V2) NewTreeFilterResults ¶
func (V2) NewTreeSearchResults ¶
func (api V2) NewTreeSearchResults(hs []*search.FullSearchHit, total int, took time.Duration) *V2FullSearchResults
func (V2) SearchHandler ¶
func (api V2) SearchHandler(w http.ResponseWriter, r *http.Request)
Performs a full broad search over the design defintions tree.
Handles these URLs:
/api/v2/search?q={query} /api/v2/search?q={query}&v={version}
type V2FilterResults ¶
type V2FullSearchHit ¶
type V2FullSearchResults ¶
type V2FullSearchResults struct { Hits []*V2FullSearchHit `json:"hits"` Total int `json:"total"` Took int64 `json:"took"` // nanoseconds }
V2FullSearchResults differs from V2FilterResults in some important ways: The results may be paginated. FilterResults always contains all found results in form of a list of node URLs.