api

package
v0.0.0-...-283dfc7 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendInit

func SendInit(code int, err error, writer io.Writer, stderr io.Writer)

SendInit answers to init

func SendProgress

func SendProgress(oid string, bytesSoFar int64, bytesSinceLast int, writer io.Writer, stderr io.Writer)

SendProgress reports progress on operations

func SendResponse

func SendResponse(r interface{}, writer io.Writer, stderr io.Writer) error

SendResponse sends an actual response to lfs

func SendTransfer

func SendTransfer(oid string, code int, err error, path string, writer io.Writer, stderr io.Writer)

SendTransfer sends a transfer message back to lfs

Types

type Error

type Error struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}
type Header struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

Header struct

type InitResponse

type InitResponse struct {
	Error *Error `json:"error,omitempty"`
}

InitResponse with response for init

type Message

type Message struct {
	Event  string `json:"event"`
	Oid    string `json:"oid"`
	Size   *int64 `json:"size,omitempty"`
	Path   string `json:"path,omitempty"`
	Action string `json:"action,omitempty"`
	Error  *Error `json:"error,omitempty"`
}

Error struct

type ProgressResponse

type ProgressResponse struct {
	Event          string `json:"event"`
	Oid            string `json:"oid"`
	BytesSoFar     int64  `json:"bytesSoFar"`
	BytesSinceLast int    `json:"bytesSinceLast"`
}

ProgressResponse blah

type Request

type Request struct {
	Event               string `json:"event"`
	Operation           string `json:"operation"`
	Concurrent          bool   `json:"concurrent"`
	ConcurrentTransfers int    `json:"concurrenttransfers"`
	Oid                 string `json:"oid"`
	Size                int64  `json:"size"`
	Path                string `json:"path"`
}

Request struct which can accept anything

type TransferResponse

type TransferResponse struct {
	Event string `json:"event"`
	Oid   string `json:"oid"`
	Path  string `json:"path,omitempty"` // always blank for upload
	Error *Error `json:"error,omitempty"`
}

TransferResponse generic transfer response

Jump to

Keyboard shortcuts

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