Documentation ¶
Overview ¶
Package state includes torrent state struct
Index ¶
- Constants
- Variables
- func Write(writer io.Writer, state *State) error
- type State
- func (*State) Descriptor() ([]byte, []int)deprecated
- func (x *State) GetCompleted() bool
- func (x *State) GetDownloadedBytes() int64
- func (x *State) GetFileHash() string
- func (x *State) GetFileName() string
- func (x *State) GetFileSize() int64
- func (x *State) GetPaused() bool
- func (x *State) GetPeersCount() int64
- func (x *State) GetProgressPerc() float32
- func (x *State) GetRatio() float32
- func (x *State) GetUploadedBytes() int64
- func (*State) ProtoMessage()
- func (x *State) ProtoReflect() protoreflect.Message
- func (x *State) Reset()
- func (x *State) String() string
Constants ¶
View Source
const FileExtension = ".state.json"
Variables ¶
View Source
var File_pkg_state_state_proto protoreflect.FileDescriptor
Functions ¶
Types ¶
type State ¶
type State struct { FileHash string `protobuf:"bytes,1,opt,name=file_hash,json=fileHash,proto3" json:"file_hash,omitempty"` FileName string `protobuf:"bytes,2,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"` FileSize int64 `protobuf:"varint,3,opt,name=file_size,json=fileSize,proto3" json:"file_size,omitempty"` PeersCount int64 `protobuf:"varint,4,opt,name=peers_count,json=peersCount,proto3" json:"peers_count,omitempty"` DownloadedBytes int64 `protobuf:"varint,5,opt,name=downloaded_bytes,json=downloadedBytes,proto3" json:"downloaded_bytes,omitempty"` UploadedBytes int64 `protobuf:"varint,6,opt,name=uploaded_bytes,json=uploadedBytes,proto3" json:"uploaded_bytes,omitempty"` ProgressPerc float32 `protobuf:"fixed32,7,opt,name=progress_perc,json=progressPerc,proto3" json:"progress_perc,omitempty"` Ratio float32 `protobuf:"fixed32,8,opt,name=ratio,proto3" json:"ratio,omitempty"` Completed bool `protobuf:"varint,9,opt,name=completed,proto3" json:"completed,omitempty"` Paused bool `protobuf:"varint,10,opt,name=paused,proto3" json:"paused,omitempty"` // contains filtered or unexported fields }
func (*State) Descriptor
deprecated
func (*State) GetCompleted ¶
func (*State) GetDownloadedBytes ¶
func (*State) GetFileHash ¶
func (*State) GetFileName ¶
func (*State) GetFileSize ¶ added in v0.3.0
func (*State) GetPeersCount ¶
func (*State) GetProgressPerc ¶ added in v0.4.0
func (*State) GetUploadedBytes ¶
func (*State) ProtoMessage ¶
func (*State) ProtoMessage()
func (*State) ProtoReflect ¶
func (x *State) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.