protocol

package
v0.0.0-...-32ff903 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseNode

type BaseNode interface {
	NewStream(ctx context.Context, p peer.ID, pids ...protocol.ID) (network.Stream, error)
	SetStreamHandler(pid protocol.ID, handler network.StreamHandler)
}

type DownloadTicket

type DownloadTicket struct {
	Owner curve.Point
	Cid   cid.Cid
	TxID  cid.Cid
}

type Error

type Error interface {
	Code() uint32
	Msg() string
	Error() string
	IsNil() bool
}

func NewError

func NewError(code uint32, msg string) Error

func NilError

func NilError() Error

func UnknownError

func UnknownError(msg string) Error

type MessagePool

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

func NewMessagePool

func NewMessagePool() *MessagePool

func (*MessagePool) Push

func (mp *MessagePool) Push(protocol string, msg interface{}) error

func (*MessagePool) Wait

func (mp *MessagePool) Wait(ctx context.Context, protocol string) (interface{}, error)

type OtChoice

type OtChoice struct {
	Cid   cid.Cid
	Owner curve.Point
	Y     curve.Point
	L     curve.Point
}

type OtClient

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

func NewOtClient

func NewOtClient(node BaseNode) *OtClient

func (*OtClient) SendChoice

func (p *OtClient) SendChoice(ctx context.Context, peerID peer.ID, choice *OtChoice) Error

type OtServer

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

OtServer type

func NewOtServer

func NewOtServer(node OtServerNode) *OtServer

type OtServerNode

type OtServerNode interface {
	BaseNode
	OnChoiceRequest(choice *OtChoice) Error
}

type PreArgs

type PreArgs struct {
	Cid    cid.Cid
	LPrime curve.Point
	ReKeys []curve.Point
	TxID   cid.Cid
}

type PreClient

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

PreClient type

func NewPreClient

func NewPreClient(node BaseNode) *PreClient

func (*PreClient) SendReEncrypt

func (p *PreClient) SendReEncrypt(ctx context.Context, peerID peer.ID, args *PreArgs) Error

type PreServer

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

PreServer type

func NewPreServer

func NewPreServer(node PreServerNode) *PreServer

type PreServerNode

type PreServerNode interface {
	BaseNode
	OnReEncryptRequest(args *PreArgs) Error
}

type StorageClient

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

StorageClient type

func NewStorageClient

func NewStorageClient(node BaseNode) *StorageClient

func (*StorageClient) SendDownloadRequest

func (p *StorageClient) SendDownloadRequest(ctx context.Context, peerID peer.ID, ticket *DownloadTicket) (string, error)

func (*StorageClient) SendUploadRequest

func (p *StorageClient) SendUploadRequest(ctx context.Context, peerID peer.ID, ticket *UploadTicket) (string, error)

type StorageServer

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

StorageServer type

func NewStorageServer

func NewStorageServer(node StorageServerNode) *StorageServer

type StorageServerNode

type StorageServerNode interface {
	BaseNode
	OnUploadRequest(ticket *UploadTicket) (string, Error)
	OnDownloadRequest(ticket *DownloadTicket) (string, Error)
}

type UploadTicket

type UploadTicket struct {
	Owner curve.Point
	Set   uint32
	Cid   cid.Cid
	Size  uint64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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