Documentation ¶
Index ¶
- Variables
- func CalcFileBlockSizeAndScanSize(fsize int64) (int64, int64)
- func GetFileState(c chain.Chainer, fileHash string) (string, error)
- func VerifySign(pkey, signmsg, sign []byte) (bool, error)
- type Client
- type ConMgr
- type Filler
- type Fillermetamap
- type Message
- func Decode(b []byte) (m *Message, err error)
- func NewCloseMsg(fileName string, status Status) *Message
- func NewEndMsg(fileName string, size uint64, lastmark bool) *Message
- func NewFileMsg(fileName string, buf []byte) *Message
- func NewFillerEndMsg(fileName string, size uint64) *Message
- func NewFillerMsg(fileName string, buf []byte) *Message
- func NewHeadMsg(fileName string, fid string, lastmark bool, pkey, signmsg, sign []byte) *Message
- func NewNotifyFillerMsg(fileName string, status Status) *Message
- func NewNotifyMsg(fileName string, status Status) *Message
- type MsgType
- type NetConn
- type Node
- func (n *Node) AddConns()
- func (n *Node) ClearConns()
- func (node *Node) CoroutineMgr()
- func (n *Node) FileBackupManagement(fid string, fsize int64, chunks []string)
- func (n *Node) GetConns() uint8
- func (n *Node) InitLock()
- func (n *Node) NewClient(conn NetConn, dir string, files []string) Client
- func (n *Node) NewServer(conn NetConn) Server
- func (n *Node) Run()
- func (n *Node) SendFile(fid string, pkey, signmsg, sign []byte) error
- func (n *Node) Start()
- type Notify
- type Scheduler
- type Server
- type Status
- type TagInfo
- type TcpCon
Constants ¶
This section is empty.
Variables ¶
View Source
var ( C_Filler chan Filler C_FillerMeta chan chain.FillerMetaInfo FillerMap *Fillermetamap )
View Source
var ( MAGIC_BYTES = []byte("cess") EmErr = fmt.Errorf("dont have msg") )
Functions ¶
func VerifySign ¶
Types ¶
type Fillermetamap ¶
type Fillermetamap struct { Fillermetas map[string][]chain.FillerMetaInfo // contains filtered or unexported fields }
func (*Fillermetamap) Add ¶
func (this *Fillermetamap) Add(pubkey string, data chain.FillerMetaInfo)
func (*Fillermetamap) Delete ¶
func (this *Fillermetamap) Delete(pubkey string)
func (*Fillermetamap) GetNum ¶
func (this *Fillermetamap) GetNum(pubkey string) int
type Message ¶
type Message struct { MsgType MsgType `json:"msg_type"` FileName string `json:"file_name"` FileHash string `json:"file_hash"` FileSize uint64 `json:"file_size"` LastMark bool `json:"last_mark"` Pubkey []byte `json:"pub_key"` SignMsg []byte `json:"sign_msg"` Sign []byte `json:"sign"` Bytes []byte `json:"bytes"` }
func NewCloseMsg ¶
func NewFileMsg ¶
func NewFillerEndMsg ¶
func NewFillerMsg ¶
func NewHeadMsg ¶
func NewNotifyFillerMsg ¶
func NewNotifyMsg ¶
type Node ¶
type Node struct { Confile confile.Confiler Chain chain.Chainer Logs logger.Logger Cache db.Cacher Conn *ConMgr FileDir string TagDir string FillerDir string // contains filtered or unexported fields }
func (*Node) AddConns ¶
func (n *Node) AddConns()
AddConns is used to add a connection number record
func (*Node) ClearConns ¶
func (n *Node) ClearConns()
ClearConns is used to clear a connection number record
func (*Node) CoroutineMgr ¶
func (node *Node) CoroutineMgr()
CoroutineMgr is the management program of the cooperation program, which can start the cooperation program that unexpectedly exits.
func (*Node) FileBackupManagement ¶
file backup management
type TcpCon ¶
type TcpCon struct {
// contains filtered or unexported fields
}
func (*TcpCon) GetRemoteAddr ¶
func (*TcpCon) HandlerLoop ¶
func (t *TcpCon) HandlerLoop()
Click to show internal directories.
Click to hide internal directories.