Documentation ¶
Overview ¶
Package client provides a client for accessing the Zettelstore via its API.
Index ¶
- type Client
- func (c *Client) Authenticate(ctx context.Context) error
- func (c *Client) Base() string
- func (c *Client) CreateZettel(ctx context.Context, data []byte) (api.ZettelID, error)
- func (c *Client) CreateZettelJSON(ctx context.Context, data *api.ZettelDataJSON) (api.ZettelID, error)
- func (c *Client) DeleteZettel(ctx context.Context, zid api.ZettelID) error
- func (c *Client) ExecuteCommand(ctx context.Context, command api.Command) error
- func (c *Client) GetEvaluatedSz(ctx context.Context, zid api.ZettelID, part string, sf sxpf.SymbolFactory) (sxpf.Object, error)
- func (c *Client) GetEvaluatedZettel(ctx context.Context, zid api.ZettelID, enc api.EncodingEnum) ([]byte, error)
- func (c *Client) GetMeta(ctx context.Context, zid api.ZettelID) (api.ZettelMeta, error)
- func (c *Client) GetParsedSz(ctx context.Context, zid api.ZettelID, part string, sf sxpf.SymbolFactory) (sxpf.Object, error)
- func (c *Client) GetParsedZettel(ctx context.Context, zid api.ZettelID, enc api.EncodingEnum) ([]byte, error)
- func (c *Client) GetUnlinkedReferences(ctx context.Context, zid api.ZettelID, query url.Values) (*api.ZidMetaRelatedList, error)
- func (c *Client) GetVersionJSON(ctx context.Context) (api.VersionJSON, error)
- func (c *Client) GetZettel(ctx context.Context, zid api.ZettelID, part string) ([]byte, error)
- func (c *Client) GetZettelJSON(ctx context.Context, zid api.ZettelID) (*api.ZettelDataJSON, error)
- func (c *Client) GetZettelOrder(ctx context.Context, zid api.ZettelID) (*api.ZidMetaRelatedList, error)
- func (c *Client) ListZettel(ctx context.Context, query string) ([][]byte, error)
- func (c *Client) ListZettelJSON(ctx context.Context, query string) (string, string, []api.ZidMetaJSON, error)
- func (c *Client) QueryMapMeta(ctx context.Context, query string) (api.MapMeta, error)
- func (c *Client) RefreshToken(ctx context.Context) error
- func (c *Client) RenameZettel(ctx context.Context, oldZid, newZid api.ZettelID) error
- func (c *Client) SetAuth(username, password string)
- func (c *Client) UpdateZettel(ctx context.Context, zid api.ZettelID, data []byte) error
- func (c *Client) UpdateZettelJSON(ctx context.Context, zid api.ZettelID, data *api.ZettelDataJSON) error
- type Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client contains all data to execute requests.
func (*Client) Authenticate ¶
Authenticate sets a new token by sending user name and password.
func (*Client) Base ¶
Base returns the base part of the URLs that are used to communicate with a Zettelstore.
func (*Client) CreateZettel ¶
CreateZettel creates a new zettel and returns its URL.
func (*Client) CreateZettelJSON ¶
func (c *Client) CreateZettelJSON(ctx context.Context, data *api.ZettelDataJSON) (api.ZettelID, error)
CreateZettelJSON creates a new zettel and returns its URL.
func (*Client) DeleteZettel ¶
DeleteZettel deletes a zettel with the given identifier.
func (*Client) ExecuteCommand ¶
ExecuteCommand will execute a given command at the Zettelstore.
func (*Client) GetEvaluatedSz ¶ added in v0.12.0
func (c *Client) GetEvaluatedSz(ctx context.Context, zid api.ZettelID, part string, sf sxpf.SymbolFactory) (sxpf.Object, error)
GetEvaluatedSz returns an evaluated zettel as a Sexpr-decoded data structure.
func (*Client) GetEvaluatedZettel ¶
func (c *Client) GetEvaluatedZettel(ctx context.Context, zid api.ZettelID, enc api.EncodingEnum) ([]byte, error)
GetEvaluatedZettel return an evaluated zettel in a defined encoding.
func (*Client) GetParsedSz ¶ added in v0.12.0
func (c *Client) GetParsedSz(ctx context.Context, zid api.ZettelID, part string, sf sxpf.SymbolFactory) (sxpf.Object, error)
GetParsedSz returns an parsed zettel as a Sexpr-decoded data structure.
func (*Client) GetParsedZettel ¶
func (c *Client) GetParsedZettel(ctx context.Context, zid api.ZettelID, enc api.EncodingEnum) ([]byte, error)
GetParsedZettel return a parsed zettel in a defined encoding.
func (*Client) GetUnlinkedReferences ¶
func (c *Client) GetUnlinkedReferences( ctx context.Context, zid api.ZettelID, query url.Values) (*api.ZidMetaRelatedList, error)
GetUnlinkedReferences returns connections to other zettel, embedded material, externals URLs.
func (*Client) GetVersionJSON ¶
GetVersionJSON returns version information..
func (*Client) GetZettelJSON ¶
GetZettelJSON returns a zettel as a JSON struct.
func (*Client) GetZettelOrder ¶
func (c *Client) GetZettelOrder(ctx context.Context, zid api.ZettelID) (*api.ZidMetaRelatedList, error)
GetZettelOrder returns metadata of the given zettel and, more important, metadata of zettel that are referenced in a list within the first zettel.
func (*Client) ListZettel ¶
ListZettel returns a list of all Zettel.
func (*Client) ListZettelJSON ¶
func (c *Client) ListZettelJSON(ctx context.Context, query string) (string, string, []api.ZidMetaJSON, error)
ListZettelJSON returns a list of zettel.
func (*Client) QueryMapMeta ¶ added in v0.7.0
QueryMapMeta returns a map of all metadata values with the given query action to the list of zettel IDs containing this value.
func (*Client) RefreshToken ¶
RefreshToken updates the access token
func (*Client) RenameZettel ¶
RenameZettel renames a zettel.
func (*Client) UpdateZettel ¶
UpdateZettel updates an existing zettel.
func (*Client) UpdateZettelJSON ¶
func (c *Client) UpdateZettelJSON(ctx context.Context, zid api.ZettelID, data *api.ZettelDataJSON) error
UpdateZettelJSON updates an existing zettel.