nodemaintainer

package
v0.0.0-...-ebe581b Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blockchain

type Blockchain interface {
	AddNode(opt *blockchain.AddNodeOptions) error
	GetNode(id []byte) (blockchain.Node, error)
	NodeOnline(opt *blockchain.NodeOperateOptions) error
	Heartbeat(opt *blockchain.NodeHeartBeatOptions) error
	ListNodesExpireSlice(opt *blockchain.ListNodeSliceOptions) ([][2]string, error)
}

type NewNodeMaintainerOptions

type NewNodeMaintainerOptions struct {
	LocalNode peer.Local

	Blockchain Blockchain

	SliceStorage SliceStorage
	ProveStorage ProveStorage
}

type NodeMaintainer

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

NodeMaintainer runs if local node is storage-node, and its main work is to clean expired encrypted slices

and to send heartbeats regularly in order to claim it's alive

func (*NodeMaintainer) HeartBeat

func (m *NodeMaintainer) HeartBeat(ctx context.Context)

HeartBeat sends heart beat onto blockchain

func (*NodeMaintainer) NodeAutoRegister

func (m *NodeMaintainer) NodeAutoRegister() error

NodeAutoRegister storage-node automatically register in blockchain

func (*NodeMaintainer) StartFileClear

func (m *NodeMaintainer) StartFileClear(ctx context.Context)

StartFileClear starts task to clear files

func (*NodeMaintainer) StopFileClear

func (m *NodeMaintainer) StopFileClear()

StopFileClear stops task clearing files

func (*NodeMaintainer) StopHeartBeat

func (m *NodeMaintainer) StopHeartBeat()

StopHeartBeat stops sending heart beats onto blockchain

type ProveStorage

type ProveStorage interface {
	Save(key string, value io.Reader) error
	Load(key string) (io.ReadCloser, error)
	Delete(key string) (bool, error)
	Exist(key string) (bool, error)
	LoadStr(key string) (string, error)
	SaveAndUpdate(key string, value io.Reader) error
}

ProveStorage is Storage interface used in `Replication Holding Proof` process

type SliceStorage

type SliceStorage interface {
	Load(key string, index string) (io.ReadCloser, error)
	Exist(key string, index string) (bool, error)
	Delete(key string, index string) error
	LoadStr(key string, index string) (string, error)
}

Jump to

Keyboard shortcuts

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