client

package
v0.0.0-...-1fd911f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2016 License: BSD-3-Clause Imports: 20 Imported by: 0

Documentation

Index

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

func (c *Client) AddFile(directory, pathname string) error

AddFile indexes a file in `directory` with the given `pathname` and writes the index to the server.

func (*Client) DeleteFile

func (c *Client) DeleteFile(directory string, pathname string) error

DeleteFile deletes the index on the server associated with `pathname` in `directory`.

func (Client) HandlerName

func (Client) HandlerName() string

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

func (c *Client) OnConnectError(err error, wait time.Duration)

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

func (c *Client) OnDoCommandError(err error, wait time.Duration)

OnDoCommandError implements the ConnectionHandler interface.

func (*Client) RenameFile

func (c *Client) RenameFile(directory string, orig, curr string) error

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

func (c *Client) SearchWord(directory, word string) ([]string, error)

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

func (c *Client) SearchWordStrict(directory, word string) ([]string, error)

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

func (c *Client) ShouldRetry(rpcName string, err error) bool

ShouldRetry implements the ConnectionHandler interface.

func (*Client) ShouldRetryOnConnect

func (c *Client) ShouldRetryOnConnect(err error) bool

ShouldRetryOnConnect implements the ConnectionHandler interface.

type DirectoryInfo

type DirectoryInfo struct {
	// contains filtered or unexported fields
}

DirectoryInfo holds necessary information for a KBFS-mounted directory.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL