Documentation ¶
Index ¶
- type Client
- func (c *Client) AddFile(directory, pathname string) error
- func (c *Client) DeleteFile(directory string, pathname string) error
- func (Client) HandlerName() string
- func (c *Client) OnConnect(ctx context.Context, conn *rpc.Connection, _ rpc.GenericClient, ...) error
- func (c *Client) OnConnectError(err error, wait time.Duration)
- func (c *Client) OnDisconnected(_ context.Context, status rpc.DisconnectStatus)
- func (c *Client) OnDoCommandError(err error, wait time.Duration)
- func (c *Client) RenameFile(directory string, orig, curr string) error
- func (c *Client) SearchWord(directory, word string) ([]string, error)
- func (c *Client) SearchWordStrict(directory, word string) ([]string, error)
- func (c *Client) ShouldRetry(rpcName string, err error) bool
- func (c *Client) ShouldRetryOnConnect(err error) bool
- type DirectoryInfo
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 the necessary information for a KBFS Search Client. TODO: Add a lock to protect directoryInfos if adding directories during execution is allowed.
func CreateClient ¶
func CreateClient(ctx context.Context, ipAddr string, port int, directories []string, lenMS, lenSalt int, fpRate float64, numUniqWords uint64, verbose bool) (*Client, error)
CreateClient creates a new `Client` instance with the parameters and returns a pointer the the instance. Returns an error on any failure.
func (*Client) AddFile ¶
AddFile indexes a file in `directory` with the given `pathname` and writes the index to the server.
func (*Client) DeleteFile ¶
DeleteFile deletes the index on the server associated with `pathname` in `directory`.
func (Client) HandlerName ¶
HandlerName implements the ConnectionHandler interface.
func (*Client) OnConnect ¶
func (c *Client) OnConnect(ctx context.Context, conn *rpc.Connection, _ rpc.GenericClient, server *rpc.Server) error
OnConnect implements the ConnectionHandler interface.
func (*Client) OnConnectError ¶
OnConnectError implements the ConnectionHandler interface.
func (*Client) OnDisconnected ¶
func (c *Client) OnDisconnected(_ context.Context, status rpc.DisconnectStatus)
OnDisconnected implements the ConnectionHandler interface.
func (*Client) OnDoCommandError ¶
OnDoCommandError implements the ConnectionHandler interface.
func (*Client) RenameFile ¶
RenameFile is called when a file in `directory` has been renamed from `orig` to `curr`. This will rename their corresponding indexes. Returns an error if the filenames are invalid.
func (*Client) SearchWord ¶
SearchWord performs a search request on the search server and returns the list of filenames in `directory` possibly containing the `word`. NOTE: False positives are possible.
func (*Client) SearchWordStrict ¶
SearchWordStrict is similar to `SearchWord`, but it uses a `grep` command to eliminate the possible false positives. The `word` must have an exact match (cases ignored) in the file.
func (*Client) ShouldRetry ¶
ShouldRetry implements the ConnectionHandler interface.
func (*Client) ShouldRetryOnConnect ¶
ShouldRetryOnConnect implements the ConnectionHandler interface.
type DirectoryInfo ¶
type DirectoryInfo struct {
// contains filtered or unexported fields
}
DirectoryInfo holds necessary information for a KBFS-mounted directory.