apiclient

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CTJSON     = "application/json"
	CTPackfile = "application/x-wrgl-packfile"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(origin string) (*Client, error)

func (*Client) ErrHTTP

func (c *Client) ErrHTTP(resp *http.Response) error

func (*Client) GetRefs

func (c *Client) GetRefs() (m map[string][]byte, err error)

func (*Client) PostUpdatesToReceivePack

func (c *Client) PostUpdatesToReceivePack(updates map[string]*payload.Update) (*http.Response, error)

func (*Client) PostUploadPack

func (c *Client) PostUploadPack(wants, haves [][]byte, done bool) (acks [][]byte, pr *encoding.PackfileReader, err error)

func (*Client) Request

func (c *Client) Request(method, path string, body io.Reader, headers map[string]string) (resp *http.Response, err error)

type ReceivePackSession

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

func NewReceivePackSession

func NewReceivePackSession(db objects.Store, rs ref.Store, c *Client, updates map[string]*payload.Update, remoteRefs map[string][]byte, maxPackfileSize uint64) (*ReceivePackSession, error)

func (*ReceivePackSession) Start

func (s *ReceivePackSession) Start() (updates map[string]*payload.Update, err error)

type UploadPackSession

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

func NewUploadPackSession

func NewUploadPackSession(db objects.Store, rs ref.Store, c *Client, advertised [][]byte, havesPerRoundTrip int) (*UploadPackSession, error)

func (*UploadPackSession) Start

func (n *UploadPackSession) Start() ([][]byte, error)

Jump to

Keyboard shortcuts

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