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) CreateZettelData(ctx context.Context, data api.ZettelData) (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 sx.SymbolFactory) (sx.Object, error)
- func (c *Client) GetEvaluatedZettel(ctx context.Context, zid api.ZettelID, enc api.EncodingEnum) ([]byte, error)
- func (c *Client) GetMetaData(ctx context.Context, zid api.ZettelID) (api.MetaRights, error)
- func (c *Client) GetParsedSz(ctx context.Context, zid api.ZettelID, part string, sf sx.SymbolFactory) (sx.Object, error)
- func (c *Client) GetParsedZettel(ctx context.Context, zid api.ZettelID, enc api.EncodingEnum) ([]byte, error)
- func (c *Client) GetVersionInfo(ctx context.Context) (VersionInfo, error)
- func (c *Client) GetZettel(ctx context.Context, zid api.ZettelID, part string) ([]byte, error)
- func (c *Client) GetZettelData(ctx context.Context, zid api.ZettelID) (api.ZettelData, error)
- func (c *Client) QueryAggregate(ctx context.Context, query string) (api.Aggregate, error)
- func (c *Client) QueryZettel(ctx context.Context, query string) ([][]byte, error)
- func (c *Client) QueryZettelData(ctx context.Context, query string) (string, string, []api.ZidMetaRights, 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) UpdateZettelData(ctx context.Context, zid api.ZettelID, data api.ZettelData) error
- type Error
- type VersionInfo
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) CreateZettelData ¶
CreateZettelData 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 ¶
func (c *Client) GetEvaluatedSz(ctx context.Context, zid api.ZettelID, part string, sf sx.SymbolFactory) (sx.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) GetMetaData ¶
GetMetaData returns the metadata of a zettel.
func (*Client) GetParsedSz ¶
func (c *Client) GetParsedSz(ctx context.Context, zid api.ZettelID, part string, sf sx.SymbolFactory) (sx.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) GetVersionInfo ¶
func (c *Client) GetVersionInfo(ctx context.Context) (VersionInfo, error)
GetVersionInfo returns version information..
func (*Client) GetZettel ¶
GetZettel returns a zettel as a string.
func (*Client) GetZettelData ¶
GetZettelData returns a zettel as a struct of its parts.
func (*Client) QueryAggregate ¶
QueryAggregate returns a aggregate as a result of a query. It is most often used in a query with an action, where the action is either a metadata key of type Word, WordSet, or TagSet.
func (*Client) QueryZettel ¶
QueryZettel returns a list of all Zettel.
func (*Client) QueryZettelData ¶
func (c *Client) QueryZettelData(ctx context.Context, query string) (string, string, []api.ZidMetaRights, error)
QueryZettelData returns a list of zettel metadata.
func (*Client) RefreshToken ¶
RefreshToken updates the access token
func (*Client) RenameZettel ¶
RenameZettel renames a zettel.
func (*Client) SetAuth ¶
SetAuth sets authentication data.
func (*Client) UpdateZettel ¶
UpdateZettel updates an existing zettel.
type Error ¶
Error encapsulates the possible client call errors.
Source Files
¶
- client.go