protocol

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: 0BSD Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BundleSuggestRequest

type BundleSuggestRequest struct {
	Request
	Domain string `cbor:"5,keyasint,omitempty"`
	ID     Hash   `cbor:"6,keyasint,omitempty"`
}

type BundleSuggestResponse

type BundleSuggestResponse struct {
	Response
	Present bool   `cbor:"5,keyasint,omitempty"`
	Missing []Hash `cbor:"6,keyasint,omitempty"`
}

func SuggestBundle

func SuggestBundle(key, domain string, id Hash) (*BundleSuggestResponse, error)

type BundleUploadRequest

type BundleUploadRequest struct {
	Request
	Domain string `cbor:"5,keyasint,omitempty"`
	Bundle []byte `cbor:"6,keyasint,omitempty"`
}

type BundleUploadResponse

type BundleUploadResponse struct {
	Response
	ID      Hash   `cbor:"5,keyasint,omitempty"`
	Missing []Hash `cbor:"6,keyasint,omitempty"`
}

func UploadBundle

func UploadBundle(key, domain string, bundle []byte) (*BundleUploadResponse, error)

type FinalizeUploadRequest

type FinalizeUploadRequest struct {
	Request
	Domain string `cbor:"5,keyasint,omitempty"`
	ID     Hash   `cbor:"6,keyasint,omitempty"`
}

type FinalizeUploadResponse

type FinalizeUploadResponse struct {
	Response
	URL string `cbor:"5,keyasint,omitempty"`
}

func Finalize

func Finalize(key string, domain string, id Hash) (*FinalizeUploadResponse, error)

type Hash

type Hash [32]byte

type MissingUploadRequest

type MissingUploadRequest struct {
	Request
	Domain string          `cbor:"5,keyasint,omitempty"`
	ID     Hash            `cbor:"6,keyasint,omitempty"`
	Parts  map[Hash][]byte `cbor:"7,keyasint,omitempty"`
}

type MissingUploadResponse

type MissingUploadResponse struct {
	Response
}

func UploadMissing

func UploadMissing(key string, domain string, parts map[Hash][]byte) (*MissingUploadResponse, error)

type Node

type Node struct {
	Children map[string]*Node `cbor:"1,keyasint,omitempty"`
	Hash     Hash             `cbor:"2,keyasint,omitempty"`
}

type Request

type Request struct {
	Key string `cbor:"1,keyasint"`
}

type Response

type Response struct {
	Success  bool     `cbor:"1,keyasint"`
	Errors   []string `cbor:"2,keyasint,omitempty"`
	Warnings []string `cbor:"3,keyasint,omitempty"`
}

Jump to

Keyboard shortcuts

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