api

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ADNLProofResponse added in v0.5.0

type ADNLProofResponse struct {
	Key       []byte `json:"key"`
	Signature []byte `json:"signature"`
}

type Bag

type Bag struct {
	BagID         string `json:"bag_id"`
	Description   string `json:"description"`
	Downloaded    uint64 `json:"downloaded"`
	Size          uint64 `json:"size"`
	Peers         uint64 `json:"peers"`
	DownloadSpeed uint64 `json:"download_speed"`
	UploadSpeed   uint64 `json:"upload_speed"`
	FilesCount    uint64 `json:"files_count"`
	DirName       string `json:"dir_name"`
	Completed     bool   `json:"completed"`
	HeaderLoaded  bool   `json:"header_loaded"`
	InfoLoaded    bool   `json:"info_loaded"`
	Active        bool   `json:"active"`
	Seeding       bool   `json:"seeding"`
}

type BagDetailed

type BagDetailed struct {
	Bag
	BagPiecesNum  uint32 `json:"bag_pieces_num"`
	HasPiecesMask []byte `json:"has_pieces_mask"`
	Files         []File `json:"files"`
	Peers         []Peer `json:"peers"`

	PieceSize  uint32 `json:"piece_size"`
	BagSize    uint64 `json:"bag_size"`
	MerkleHash string `json:"merkle_hash"`
	Path       string `json:"path"`
}

type Created

type Created struct {
	BagID string `json:"bag_id"`
}

type Credentials

type Credentials struct {
	Login    string
	Password string
}

type Error

type Error struct {
	Error string `json:"error"`
}

type File

type File struct {
	Index uint32 `json:"index"`
	Name  string `json:"name"`
	Size  uint64 `json:"size"`
}

type List

type List struct {
	Bags []Bag `json:"bags"`
}

type Ok

type Ok struct {
	Ok bool `json:"ok"`
}

type Peer

type Peer struct {
	Addr          string `json:"addr"`
	ID            string `json:"id"`
	UploadSpeed   uint64 `json:"upload_speed"`
	DownloadSpeed uint64 `json:"download_speed"`
}

type ProofResponse added in v0.2.0

type ProofResponse struct {
	Proof []byte `json:"proof"`
}

type Server

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

func NewServer

func NewServer(connector storage.NetConnector, store *db.Storage) *Server

func (*Server) SetCredentials

func (s *Server) SetCredentials(credentials *Credentials)

func (*Server) Start

func (s *Server) Start(addr string) error

Jump to

Keyboard shortcuts

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