Documentation
¶
Overview ¶
Package client is the controller side of the sync endpoint protocol. It decides every action; the endpoint executes and computes nothing.
Index ¶
- type Client
- func (c *Client) Handshake(markerMode syncv1.MarkerMode, expectedSessionID string) (*syncv1.HandshakeResponse, error)
- func (c *Client) Scan(cache []*syncv1.CachedDigest) (*syncv1.ScanResponse, error)
- func (c *Client) StagePut(digest string, size int64, src io.Reader) error
- func (c *Client) StageQuery(digests []string) (*syncv1.StageQueryResponse, error)
- func (c *Client) Supply(path, expectedDigest string, dst io.Writer) (*syncv1.SupplyResponse, error)
- func (c *Client) Transition(changes []*syncv1.Change) ([]*syncv1.Result, 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 speaks to one endpoint over one stream. The protocol is strictly one request in flight, so a Client is not safe for concurrent use.
func (*Client) Handshake ¶
func (c *Client) Handshake(markerMode syncv1.MarkerMode, expectedSessionID string) (*syncv1.HandshakeResponse, error)
Handshake opens the session. markerMode decides whether the endpoint may create a root marker: sync does, cp never does.
func (*Client) Scan ¶
func (c *Client) Scan(cache []*syncv1.CachedDigest) (*syncv1.ScanResponse, error)
func (*Client) StagePut ¶
StagePut streams one file into the endpoint's staging directory and verifies the digest it computed over what actually arrived.
func (*Client) StageQuery ¶
func (c *Client) StageQuery(digests []string) (*syncv1.StageQueryResponse, error)
StageQuery reports which of the digests the endpoint does not already hold. Content it has from an earlier cycle is never sent twice.