protocol

package
v0.0.0-...-45dc9e5 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type AuthenticateRequest

type AuthenticateRequest struct {
	APIToken  string `json:"apitoken"`
	ProjectID int    `json:"project_id"`
	Version
}

type DownloadRequest

type DownloadRequest struct {
	Path string `json:"path"`
	Version
}

type FileBlockRequest

type FileBlockRequest struct {
	Path              string `json:"path"`
	Block             []byte `json:"block"`
	ContentType       string `json:"content_type"`
	ContentLength     int64  `json:"content_length"`
	UploadOffset      int64  `json:"upload_offset"`
	Checksum          string `json:"checksum"`
	ChecksumAlgorithm string `json:"check_algorithm"`
	Version
}

type FileInfo

type FileInfo struct {
	Name              string    `json:"name"`
	IsDir             bool      `json:"is_dir"`
	Size              int64     `json:"size"`
	Checksum          string    `json:"checksum"`
	ChecksumAlgorithm string    `json:"checksum_algorithm"`
	UploadComplete    bool      `json:"upload_complete"`
	CreatedAt         time.Time `json:"created_at"`
	UpdatedAt         time.Time `json:"updated_at"`
}

type FileInfoRequest

type FileInfoRequest struct {
	Path string `json:"path"`
	Version
}

type FileInfoResponse

type FileInfoResponse struct {
	UploadOffset      int64     `json:"upload_offset"`
	CurrentChecksum   string    `json:"current_checksum"`
	ChecksumAlgorithm string    `json:"checksum_algorithm"`
	ExpiresAt         time.Time `json:"expires_at"`
	Version
}

type FinishUploadRequest

type FinishUploadRequest struct {
	Path         string `json:"path"`
	FileChecksum string `json:"file_checksum"`
	Version
}

type IncomingRequestType

type IncomingRequestType struct {
	RequestType RequestType `json:"request_type"`
}

type ListDirectoryResponse

type ListDirectoryResponse struct {
	Path   string     `json:"path"`
	Status string     `json:"status"`
	Files  []FileInfo `json:"files"`
	Version
}

type PauseUploadRequest

type PauseUploadRequest struct {
	Path string `json:"path"`
	Version
}

type RequestType

type RequestType int
const (
	AuthenticateReq RequestType = iota
	DownloadReq
	FileInfoReq
	FinishUploadReq
	ListDirectoryReq
	PauseUploadReq
	FileBlockReq
	ServerInfoReq
	UploadFileReq
	ServerConnectRequestType
)

type ServerInfoResponse

type ServerInfoResponse struct {
	MaxSize                 int64    `json:"max_size"`
	ChecksumAlgorithms      []string `json:"checksum_algorithms"`
	BlockChecksumsSupported bool     `json:"block_checksums_supported"`
	UploadExpirationTime    int      `json:"upload_expiration_time"`
	Version
}

type StatusResponse

type StatusResponse struct {
	Path           string `json:"path"`
	ForRequestType string `json:"for_request_type"`
	Status         string `json:"status"`
	IsError        bool
	Version
}

type UploadFileRequest

type UploadFileRequest struct {
	Path string `json:"path"`
	Size int64  `json:"size"`
	Version
}

type Version

type Version struct {
	Version string `json:"version"`
}

Jump to

Keyboard shortcuts

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