Documentation ¶
Overview ¶
Package client defines a client for the dependency service defined by the service package.
Index ¶
- type Client
- func (c *Client) Close() error
- func (c *Client) Match(ctx context.Context, req *service.MatchReq, f func(*graph.Row) error) (int, error)
- func (c *Client) Rank(ctx context.Context, req *service.RankReq) (*service.RankRsp, error)
- func (c *Client) Receive(ctx context.Context, f func(*jrpc2.Request))
- func (c *Client) RepoStatus(ctx context.Context, repo string) (*service.RepoStatusRsp, error)
- func (c *Client) Resolve(ctx context.Context, pkg string) (*service.ResolveRsp, error)
- func (c *Client) Reverse(ctx context.Context, req *service.ReverseReq, ...) (int, error)
- func (c *Client) Scan(ctx context.Context, req *service.ScanReq) (*service.ScanRsp, error)
- func (c *Client) SetToken(token string)
- func (c *Client) Update(ctx context.Context, req *service.UpdateReq) (*service.UpdateRsp, 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
}
A Client implements a JSON-RPC client to the dependency service exported by the service package.
func Dial ¶
Dial establishes a connection to the dependency service at addr. If ctx contains a deadline, that timeout governs the dial operation and not the operation of the resulting client.
func (*Client) Match ¶
func (c *Client) Match(ctx context.Context, req *service.MatchReq, f func(*graph.Row) error) (int, error)
Match calls the eponymous method of the service and delivers a response to f for each result row. If f reports an error, pagination stops and that error is reported to the caller of Match. The total number of matching rows is returned.
func (*Client) Rank ¶
Rank calls the eponymous method of the service. If the server requires a write token, the caller must provide one via SetToken.
func (*Client) Receive ¶
Receive calls f with each server notification received by c as long as ctx is active. Calls to f are synchronous with request processing.
func (*Client) RepoStatus ¶
RepoStatus calls the eponymous method of the service.
func (*Client) Reverse ¶
func (c *Client) Reverse(ctx context.Context, req *service.ReverseReq, f func(*service.ReverseDep) error) (int, error)
Reverse calls the eponymous method of the service and delivers a result to f for each reverse dependency found. If f reports an error, pagination stops and that error is reported to the caller of Reverse. The total number of matching rows is returned.
func (*Client) Scan ¶
Scan calls the eponymous method of the service. If the server requires a write token, the caller must provide one via SetToken.