Documentation
¶
Overview ¶
Package shortcuts is about the .url shortcuts. They are files and, as such, can be manipulated via the /files API. But the stack also offer some routes to make it easier to create and open them.
Index ¶
- func Create(c echo.Context) error
- func FromJSONAPI(c echo.Context) (*vfs.FileDoc, []byte, error)
- func Get(c echo.Context) error
- func Routes(router *echo.Group)
- type Shortcut
- func (s *Shortcut) Clone() couchdb.Doc
- func (s *Shortcut) DocType() string
- func (s *Shortcut) ID() string
- func (s *Shortcut) Included() []jsonapi.Object
- func (s *Shortcut) Links() *jsonapi.LinksList
- func (s *Shortcut) Relationships() jsonapi.RelationshipMap
- func (s *Shortcut) Rev() string
- func (s *Shortcut) SetID(id string)
- func (s *Shortcut) SetRev(rev string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(c echo.Context) error
Create is the API handler for POST /shortcuts. It can be used to create a shortcut from a JSON description.
func FromJSONAPI ¶
FromJSONAPI parses a JSON-API payload for a shortcut and returns a FileDoc and body for it.
Types ¶
type Shortcut ¶
type Shortcut struct { DocID string `json:"_id"` DocRev string `json:"_rev,omitempty"` Name string `json:"name"` DirID string `json:"dir_id"` URL string `json:"url"` Metadata vfs.Metadata `json:"metadata"` }
Shortcut is a struct with the high-level information about a .url file.
func (*Shortcut) Relationships ¶
func (s *Shortcut) Relationships() jsonapi.RelationshipMap
Relationships is a method of the jsonapi.Document interface
Click to show internal directories.
Click to hide internal directories.