mobile

package
v0.0.0-...-d0dabfa Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2020 License: MIT Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountRepoExists

func AccountRepoExists(baseRepoPath string, accountAddress string) bool

AccountRepoExists return whether or not the repo at repoPath exists

func InitRepo

func InitRepo(config *InitConfig) error

InitRepo calls core InitRepo

func LogDebug

func LogDebug(msg []byte)

func MigrateRepo

func MigrateRepo(config *MigrateConfig) error

MigrateRepo calls core MigrateRepo

func NewWallet

func NewWallet(wordCount int) (string, error)

NewWallet creates a brand new wallet and returns its recovery phrase

func NewWalletFromHuaweiOpenId

func NewWalletFromHuaweiOpenId(huaweiOpenId string) (string, error)

NewWalletFromHuaweiOpenId creates a brand new wallet using huawei open id and returns its recovery phrase

func RepoExists

func RepoExists(repoPath string) bool

RepoExists return whether or not the repo at repoPath exists

func WalletAccountAt

func WalletAccountAt(mnemonic string, index int, passphrase string) ([]byte, error)

WalletAccountAt derives the account at the given index

Types

type Callback

type Callback interface {
	Call(err error)
}

Callback is used for asyc methods

type DataCallback

type DataCallback interface {
	Call(data []byte, media string, err error)
}

DataCallback is used for asyc methods that deliver raw data

type DataCallbackWithTime

type DataCallbackWithTime interface {
	Call(data []byte, media string, time int, err error)
}

type Event

type Event struct {
	Name string
	Type int32
	Data []byte
}

Event is sent by Messenger to the bridge (data is a protobuf, name is the string value of a pb.MobileEvent_Type)

type HlogHandler

type HlogHandler interface {
	HandleLog(str string)
	LogEnd()
}

HlogHandler is implemented in application layer

type InitConfig

type InitConfig struct {
	Seed         string
	RepoPath     string
	BaseRepoPath string
	LogToDisk    bool
	Debug        bool
	IsPrivate    bool
}

InitConfig is used to setup a textile node

func (InitConfig) Repo

func (conf InitConfig) Repo() (string, error)

Repo returns the actual location of the configured repo

func (InitConfig) RepoExists

func (conf InitConfig) RepoExists() (bool, error)

RepoExists return whether or not the configured repo already exists

type IpfsAddDataCallback

type IpfsAddDataCallback interface {
	Call(path string, err error)
}

IpfsAddDataCallback is used for asyc methods that add raw data to ipfs

type IpfsCompareCallback

type IpfsCompareCallback interface {
	// n1: number of cids in first path
	// n2: number of cids in second path
	// same: number of same cids
	Call(n1 int, n2 int, same int, AminusB int, BminusA int, err error)
}

Used by mobile.IpfsComparePath

type IpfsListPathCallback

type IpfsListPathCallback interface {
	OnCid(str string)
	OnError(err error)
	OnComplete()
}

Used by mobild.IpfsListCids

type Messenger

type Messenger interface {
	Notify(event *Event)
}

Messenger is a push mechanism to the bridge

type MigrateConfig

type MigrateConfig struct {
	RepoPath string
}

MigrateConfig is used to define options during a major migration

type Mobile

type Mobile struct {
	RepoPath string
	// contains filtered or unexported fields
}

Mobile is the name of the framework (must match package name)

func NewTextile

func NewTextile(config *RunConfig, messenger Messenger) (*Mobile, error)

Create a gomobile compatible wrapper around Textile

func (*Mobile) AcceptExternalInvite

func (m *Mobile) AcceptExternalInvite(id string, key string) (string, error)

AcceptExternalInvite calls core AcceptExternalInvite

func (*Mobile) AcceptInvite

func (m *Mobile) AcceptInvite(id string) (string, error)

AcceptInvite calls core AcceptInvite

func (*Mobile) AcceptInviteViaNotification

func (m *Mobile) AcceptInviteViaNotification(id string) (string, error)

AcceptInviteViaNotification call core AcceptInviteViaNotification

func (*Mobile) AccountContact

func (m *Mobile) AccountContact() ([]byte, error)

AccountContact calls core AccountContact

func (*Mobile) AccountThread

func (m *Mobile) AccountThread() ([]byte, error)

AccountThread calls core AccountThread

func (*Mobile) AddComment

func (m *Mobile) AddComment(blockId string, body string) (string, error)

AddComment adds a comment targeted at the given block

func (*Mobile) AddContact

func (m *Mobile) AddContact(contact []byte) error

AddContact calls core AddContact

func (*Mobile) AddData

func (m *Mobile) AddData(data string, threadId string, caption string, cb ProtoCallback)

AddData adds raw data to a thread

func (*Mobile) AddExternalInvite

func (m *Mobile) AddExternalInvite(threadId string) ([]byte, error)

AddExternalInvite generates a new external invite link to a thread

func (*Mobile) AddFiles

func (m *Mobile) AddFiles(paths string, threadId string, caption string, cb ProtoCallback)

AddFiles builds a directory from paths (comma separated) and adds it to the thread Note: paths can be file system paths, IPFS hashes, or an existing file hash that may need decryption.

func (*Mobile) AddFlag

func (m *Mobile) AddFlag(blockId string) (string, error)

AddFlag adds a flag targeted at the given block

func (*Mobile) AddHlog

func (m *Mobile) AddHlog(str string)

func (*Mobile) AddIgnore

func (m *Mobile) AddIgnore(blockId string) (string, error)

AddIgnore adds an ignore targeted at the given block and unpins any associated target data

func (*Mobile) AddInvite

func (m *Mobile) AddInvite(threadId string, address string) error

AddInvite call core AddInvite

func (*Mobile) AddLike

func (m *Mobile) AddLike(blockId string) (string, error)

AddLike adds a like targeted at the given block

func (*Mobile) AddMessage

func (m *Mobile) AddMessage(threadId string, body string) (string, error)

AddMessage adds a message to a thread

func (*Mobile) AddOrUpdateThread

func (m *Mobile) AddOrUpdateThread(thrd []byte) error

AddOrUpdateThread calls core AddOrUpdateThread

func (*Mobile) AddPicture

func (m *Mobile) AddPicture(paths string, threadId string, caption string, cb ProtoCallback)

func (*Mobile) AddSchema

func (m *Mobile) AddSchema(node []byte) ([]byte, error)

AddSchema adds a new schema via schema mill

func (*Mobile) AddSimpleFile

func (m *Mobile) AddSimpleFile(path string, threadId string, cb ProtoCallback)

AddSimpleFile aims to simplify the add file process The process is supposed to be really simple:

  • Add file to ipfs and get the corresponding file cid.
  • Add cid to thread. DO NOT BUILD IPLD NODE FOR IT.
  • Get the file through ipfs.get(cid) when receive a simplefile thread block.

Note:

  • No encryption
  • The time used for each step would be kept and sent by record_service.

func (*Mobile) AddSimpleFolder

func (m *Mobile) AddSimpleFolder(path string, threadId string, cb ProtoCallback)

func (*Mobile) AddSimplePicture

func (m *Mobile) AddSimplePicture(path string, threadId string, cb ProtoCallback)

func (*Mobile) AddSyncFile

func (m *Mobile) AddSyncFile(file []byte) error

func (*Mobile) AddThread

func (m *Mobile) AddThread(config []byte) ([]byte, error)

AddThread adds a new thread with the given name

func (*Mobile) AddVideo

func (m *Mobile) AddVideo(video []byte) error

func (*Mobile) AddVideoChunk

func (m *Mobile) AddVideoChunk(vchunk []byte) error

func (*Mobile) Address

func (m *Mobile) Address() string

Address returns account address

func (*Mobile) Avatar

func (m *Mobile) Avatar() (string, error)

Avatar calls core Avatar

func (*Mobile) BigFileAtSimpleFile

func (m *Mobile) BigFileAtSimpleFile(feed []byte, cb PathCallbackWithTime)

func (*Mobile) BigFileAtStream

func (m *Mobile) BigFileAtStream(feed []byte, cid []byte, cb PathCallback)

func (*Mobile) CafeRequestNotPending

func (m *Mobile) CafeRequestNotPending(id string) error

CafeRequestNotPending marks a request as not pending (new)

func (*Mobile) CafeRequestPending

func (m *Mobile) CafeRequestPending(id string) error

CafeRequestPending marks a request as pending

func (*Mobile) CafeRequests

func (m *Mobile) CafeRequests(limit int) ([]byte, error)

CafeRequests paginates new requests

func (*Mobile) CafeSession

func (m *Mobile) CafeSession(id string) ([]byte, error)

CafeSession calls core CafeSession

func (*Mobile) CafeSessions

func (m *Mobile) CafeSessions() ([]byte, error)

CafeSessions calls core CafeSessions

func (*Mobile) CheckCafeMessages

func (m *Mobile) CheckCafeMessages(cb Callback)

CheckCafeMessages is the async flavor of checkCafeMessages

func (*Mobile) ChunksByVideoId

func (m *Mobile) ChunksByVideoId(id string) ([]byte, error)

func (*Mobile) CloseStream

func (m *Mobile) CloseStream(threadId string, streamId string) error

func (*Mobile) CompleteCafeRequest

func (m *Mobile) CompleteCafeRequest(id string) error

CompleteCafeRequest marks a request as complete

func (*Mobile) ConnectShadowTCP

func (m *Mobile) ConnectShadowTCP(ip string, port int) bool

ConnectShadowTCP connect with shadow peer through tcp directly. It would not through any error. Only return connect success or not.

func (*Mobile) ConnectShadowTCP_Async

func (m *Mobile) ConnectShadowTCP_Async(ip string, port int, cb Callback)

Async version of ConnectShadowTCP

func (*Mobile) ConnectedAddresses

func (m *Mobile) ConnectedAddresses() ([]byte, error)

func (*Mobile) Contact

func (m *Mobile) Contact(address string) ([]byte, error)

Contact calls core Contact

func (*Mobile) ContactThreads

func (m *Mobile) ContactThreads(address string) ([]byte, error)

ContactThreads calls core ContactThreads

func (*Mobile) Contacts

func (m *Mobile) Contacts() ([]byte, error)

Contacts calls core Contacts

func (*Mobile) CountUnreadNotifications

func (m *Mobile) CountUnreadNotifications() int

CountUnreadNotifications calls core CountUnreadNotifications

func (*Mobile) DataAtFeedSimpleFile

func (m *Mobile) DataAtFeedSimpleFile(feed []byte, cb DataCallbackWithTime)

func (*Mobile) DataAtFeedSimpleFolder

func (m *Mobile) DataAtFeedSimpleFolder(feed []byte, cb PathCallbackWithTime)

func (*Mobile) DataAtPath

func (m *Mobile) DataAtPath(pth string, cb DataCallback)

DataAtPath is the async version of dataAtPath

func (*Mobile) DataAtStreamFile

func (m *Mobile) DataAtStreamFile(feed []byte, cid []byte, cb DataCallback)

func (*Mobile) Decrypt

func (m *Mobile) Decrypt(input []byte) ([]byte, error)

Decrypt call core Decrypt

func (*Mobile) DeregisterCafe

func (m *Mobile) DeregisterCafe(id string, cb Callback)

DeegisterCafe is the async flavor of deregisterCafe

func (*Mobile) DiscoverContacts

func (m *Mobile) DiscoverContacts(options []byte) (*SearchHandle, error)

DiscoverContacts calls core DiscoverContacts

func (*Mobile) Encrypt

func (m *Mobile) Encrypt(input []byte) ([]byte, error)

Encrypt calls core Encrypt

func (*Mobile) FailCafeRequest

func (m *Mobile) FailCafeRequest(id string, reason string) error

FailCafeRequest deletes a request

func (*Mobile) Feed

func (m *Mobile) Feed(req []byte) ([]byte, error)

Feed calls core Feed

func (*Mobile) File

func (m *Mobile) File(blockId string) ([]byte, error)

File calls core File

func (*Mobile) FileAsStream_Text

func (m *Mobile) FileAsStream_Text(thread string, sf []byte, file_type int) ([]byte, error)

func (*Mobile) FileContent

func (m *Mobile) FileContent(hash string, cb DataCallback)

FileContent is the async version of fileContent

func (*Mobile) Files

func (m *Mobile) Files(threadId string, offset string, limit int) ([]byte, error)

Files calls core Files

func (*Mobile) GetLog

func (m *Mobile) GetLog(handler HlogHandler)

func (*Mobile) GetLogSize

func (m *Mobile) GetLogSize(handler HlogHandler, size int)

* Get size lines logs.

func (*Mobile) GetMaxWorkers

func (m *Mobile) GetMaxWorkers() int

func (*Mobile) GetRecord

func (m *Mobile) GetRecord(key string) (string, error)

func (*Mobile) GetStreamDuration

func (m *Mobile) GetStreamDuration(streamId string) int64

func (*Mobile) GetStreamMode

func (m *Mobile) GetStreamMode() int

func (*Mobile) GetSwarmAddress

func (m *Mobile) GetSwarmAddress(pid string) (string, error)

func (*Mobile) GetVideo

func (m *Mobile) GetVideo(id string) ([]byte, error)

func (*Mobile) GetVideoChunk

func (m *Mobile) GetVideoChunk(id string, chunk string) ([]byte, error)

func (*Mobile) GetVideoChunkByIndex

func (m *Mobile) GetVideoChunkByIndex(id string, index int64) ([]byte, error)

func (*Mobile) GitSummary

func (m *Mobile) GitSummary() string

GitSummary returns common GitSummary

func (*Mobile) IgnoreInvite

func (m *Mobile) IgnoreInvite(id string) error

IgnoreInvite calls core IgnoreInvite

func (*Mobile) IgnoreInviteViaNotification

func (m *Mobile) IgnoreInviteViaNotification(id string) error

IgnoreInviteViaNotification call core IgnoreInviteViaNotification

func (*Mobile) ImageFileContentForMinWidth

func (m *Mobile) ImageFileContentForMinWidth(pth string, minWidth int, cb DataCallback)

ImageFileContentForMinWidth is the async version of imageFileContentForMinWidth

func (*Mobile) Invites

func (m *Mobile) Invites() ([]byte, error)

Invites calls core Invites

func (*Mobile) IpfsAddData

func (m *Mobile) IpfsAddData(data []byte, pin bool, hashOnly bool, cb IpfsAddDataCallback)

IpfsAddData is the async version of ipfsAddData

func (*Mobile) IpfsComparePath

func (m *Mobile) IpfsComparePath(pth1 string, pth2 string, cb IpfsCompareCallback)

func (*Mobile) IpfsListCids

func (m *Mobile) IpfsListCids(pth string, cb IpfsListPathCallback)

func (*Mobile) IsAdminByAddress

func (m *Mobile) IsAdminByAddress(threadId string, peerAddr string) (bool, error)

IsAdminByAddress calls core IsAdminByAddress

func (*Mobile) IsAdminById

func (m *Mobile) IsAdminById(threadId string, peerId string) (bool, error)

IsAdminById calls core IsAdminById

func (*Mobile) IsStreamFinished

func (m *Mobile) IsStreamFinished(streamId string) bool

func (*Mobile) ListSyncFile

func (m *Mobile) ListSyncFile(address string, fileType int32) ([]byte, error)

func (*Mobile) Messages

func (m *Mobile) Messages(offset string, limit int, threadId string) ([]byte, error)

Messages calls core Messages

func (*Mobile) Name

func (m *Mobile) Name() (string, error)

Name calls core Name

func (*Mobile) Notifications

func (m *Mobile) Notifications(offset string, limit int) ([]byte, error)

Notifications call core Notifications

func (*Mobile) ObjectAtPath

func (m *Mobile) ObjectAtPath(pth string) ([]byte, error)

func (*Mobile) Online

func (m *Mobile) Online() bool

Online returns core Online

func (*Mobile) PeerId

func (m *Mobile) PeerId() (string, error)

PeerId returns the ipfs peer id

func (*Mobile) PeerUser

func (m *Mobile) PeerUser(peer string) ([]byte, error)

func (*Mobile) Profile

func (m *Mobile) Profile() ([]byte, error)

Profile calls core Profile

func (*Mobile) PublishPeer

func (m *Mobile) PublishPeer(cb Callback)

!!!!!

func (*Mobile) PublishPeerToCafe

func (m *Mobile) PublishPeerToCafe(id string, cb Callback)

func (*Mobile) PublishSyncFile

func (m *Mobile) PublishSyncFile(file []byte) error

func (*Mobile) PublishVideo

func (m *Mobile) PublishVideo(video []byte, store bool) error

func (*Mobile) PublishVideoChunk

func (m *Mobile) PublishVideoChunk(vchunk []byte) error

func (*Mobile) ReadAllNotifications

func (m *Mobile) ReadAllNotifications() error

ReadAllNotifications calls core ReadAllNotifications

func (*Mobile) ReadNotification

func (m *Mobile) ReadNotification(id string) error

ReadNotification calls core ReadNotification

func (*Mobile) RefreshCafeSession

func (m *Mobile) RefreshCafeSession(id string, cb ProtoCallback)

RefreshCafeSession is the async flavor of refreshCafeSession

func (*Mobile) RegisterCafe

func (m *Mobile) RegisterCafe(id string, token string, cb Callback)

RegisterCafe is the async flavor of registerCafe

func (*Mobile) RemoveContact

func (m *Mobile) RemoveContact(address string) error

RemoveContact calls core RemoveContact

func (*Mobile) RemoveRecordReport

func (m *Mobile) RemoveRecordReport(key string) error

func (*Mobile) RemoveThread

func (m *Mobile) RemoveThread(id string) (string, error)

RemoveThread call core RemoveThread

func (*Mobile) RemoveVideo

func (m *Mobile) RemoveVideo(id string) error

func (*Mobile) RenameThread

func (m *Mobile) RenameThread(id string, name string) error

RenameThread call core RenameThread

func (*Mobile) SearchContacts

func (m *Mobile) SearchContacts(query []byte, options []byte) (*SearchHandle, error)

SearchContacts calls core SearchContacts

func (*Mobile) SearchSyncFiles

func (m *Mobile) SearchSyncFiles(query []byte, options []byte) (*SearchHandle, error)

func (*Mobile) SearchThreadSnapshots

func (m *Mobile) SearchThreadSnapshots(query []byte, options []byte) (*SearchHandle, error)

SearchThreadSnapshots calls core SearchThreadSnapshots

func (*Mobile) SearchVideo

func (m *Mobile) SearchVideo(query []byte, options []byte) (*SearchHandle, error)

func (*Mobile) SearchVideoChunks

func (m *Mobile) SearchVideoChunks(query []byte, options []byte) (*SearchHandle, error)

func (*Mobile) Seed

func (m *Mobile) Seed() string

Seed returns account seed

func (*Mobile) SendRecordReport

func (m *Mobile) SendRecordReport(key string, peerId string) error

func (*Mobile) SendRecordReportPb

func (m *Mobile) SendRecordReportPb(report *pb.RecordReport, peerId string) error

func (*Mobile) SetAvatar

func (m *Mobile) SetAvatar(pth string, cb ProtoCallback)

SetAvatar adds the image at pth to the account thread and calls core SetAvatar

func (*Mobile) SetLogLevel

func (m *Mobile) SetLogLevel(level []byte) error

SetLogLevel calls core SetLogLevel

func (*Mobile) SetMaxWorkers

func (m *Mobile) SetMaxWorkers(n int)

func (*Mobile) SetName

func (m *Mobile) SetName(username string) error

SetName calls core SetName

func (*Mobile) SetStreamMode

func (m *Mobile) SetStreamMode(mode int)

func (*Mobile) SetStreamSpeedInterval

func (m *Mobile) SetStreamSpeedInterval(intv int64)

func (*Mobile) Shadow

func (m *Mobile) Shadow() string

func (*Mobile) ShareFiles

func (m *Mobile) ShareFiles(data string, threadId string, caption string, cb ProtoCallback)

ShareFiles adds an existing file DAG to a thread via its top level hash (data)

func (*Mobile) Sign

func (m *Mobile) Sign(input []byte) ([]byte, error)

Sign calls core Sign

func (*Mobile) SnapshotThreads

func (m *Mobile) SnapshotThreads() error

SnapshotThreads calls core SnapshotThreads

func (*Mobile) Start

func (m *Mobile) Start() error

Start the mobile node

func (*Mobile) StartRecord

func (m *Mobile) StartRecord(key string) error

func (*Mobile) StartRecordReport

func (m *Mobile) StartRecordReport(key string) error

func (*Mobile) StartStream

func (m *Mobile) StartStream(thread string, stream []byte) error

func (*Mobile) StartStream_Text

func (m *Mobile) StartStream_Text(thread string, stream []byte) error

func (*Mobile) Stop

func (m *Mobile) Stop(cb Callback)

Stop the mobile node

func (*Mobile) StopRecord

func (m *Mobile) StopRecord(key string) error

func (*Mobile) StopRecordReport

func (m *Mobile) StopRecordReport(key string) error

func (*Mobile) StreamAddFile

func (m *Mobile) StreamAddFile(streamid string, f []byte) error

func (*Mobile) StreamGetStatus

func (m *Mobile) StreamGetStatus(streamId string) string

func (*Mobile) SubscribeStream

func (m *Mobile) SubscribeStream(config string) error

func (*Mobile) Summary

func (m *Mobile) Summary() ([]byte, error)

Summary calls core Summary

func (*Mobile) SwarmConnect

func (m *Mobile) SwarmConnect(address string) (string, error)

SwarmConnect opens a new direct connection to a peer using an IPFS multiaddr

func (*Mobile) SyncAccount

func (m *Mobile) SyncAccount(options []byte) (*SearchHandle, error)

SyncAccount calls core SyncAccount

func (*Mobile) SyncFile

func (m *Mobile) SyncFile(file []byte) error

func (*Mobile) Thread

func (m *Mobile) Thread(id string) ([]byte, error)

Thread calls core Thread

func (*Mobile) ThreadAddAdmin

func (m *Mobile) ThreadAddAdmin(threadId string, peerId string) error

ThreadAddAdmin calls core ThreadAddAdmin

func (*Mobile) ThreadAddStream

func (m *Mobile) ThreadAddStream(threadId string, streamId string) error

func (*Mobile) ThreadAddVideo

func (m *Mobile) ThreadAddVideo(thread string, video string) error

func (*Mobile) ThreadAdmins

func (m *Mobile) ThreadAdmins(id string) ([]byte, error)

ThreadPeers calls core ThreadPeers

func (*Mobile) ThreadNonAdmins

func (m *Mobile) ThreadNonAdmins(id string) ([]byte, error)

ThreadPeers calls core ThreadPeers

func (*Mobile) ThreadPeers

func (m *Mobile) ThreadPeers(id string) ([]byte, error)

ThreadPeers calls core ThreadPeers

func (*Mobile) ThreadRemovePeer

func (m *Mobile) ThreadRemovePeer(threadId string, peerId string) error

RemovePeer calls core RemovePeer

func (*Mobile) Threads

func (m *Mobile) Threads() ([]byte, error)

Threads lists all threads

func (*Mobile) TryConnectShadowByRelay

func (m *Mobile) TryConnectShadowByRelay(shadowId string)

func (*Mobile) UnsubscribeStream

func (m *Mobile) UnsubscribeStream(streamid string) error

func (*Mobile) UpdateCafeRequestProgress

func (m *Mobile) UpdateCafeRequestProgress(id string, transferred int64, total int64) error

UpdateCafeRequestProgress updates the request with progress info

func (*Mobile) Verify

func (m *Mobile) Verify(input []byte, sig []byte) error

Verify calls core verify

func (*Mobile) Version

func (m *Mobile) Version() string

Version returns common Version

func (*Mobile) WaitAdd

func (m *Mobile) WaitAdd(delta int, src string)

WaitAdd calls core WaitAdd

func (*Mobile) WaitDone

func (m *Mobile) WaitDone(src string)

WaitDone marks a wait as done in the stop wait group

func (*Mobile) WriteCafeRequest

func (m *Mobile) WriteCafeRequest(group string, cb ProtoCallback)

WriteCafeRequest is the async version of writeCafeRequest

func (*Mobile) WriteTreeCSV

func (m *Mobile) WriteTreeCSV(streamId string, outPath string) error

type PathCallback

type PathCallback interface {
	Call(filepath string, media string, err error)
}

type PathCallbackWithTime

type PathCallbackWithTime interface {
	Call(filepath string, media string, time int, err error)
}

type ProtoCallback

type ProtoCallback interface {
	Call(msg []byte, err error)
}

ProtoCallback is used for asyc methods that deliver a protobuf message

type ReedSolomon

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

func NewEmptyReedSolomon

func NewEmptyReedSolomon() *ReedSolomon

func NewReedSolomon

func NewReedSolomon(shardNumber int, parityNumber int) *ReedSolomon

func (*ReedSolomon) DecodePb

func (m *ReedSolomon) DecodePb(data []byte) ([]byte, error)

func (*ReedSolomon) EncodeBytes

func (m *ReedSolomon) EncodeBytes(data []byte, shardNumber int, parityNumber int, cb ShardCallback)

func (*ReedSolomon) EncodeBytesToPb

func (m *ReedSolomon) EncodeBytesToPb(data []byte, shardNumber int, parityNumber int) ([]byte, error)

func (*ReedSolomon) OpenLog

func (m *ReedSolomon) OpenLog()

func (*ReedSolomon) PrepareCodec

func (m *ReedSolomon) PrepareCodec(shardNumber int, parityNumber int) error

type RunConfig

type RunConfig struct {
	RepoPath          string
	Debug             bool
	CafeOutboxHandler core.CafeOutboxHandler
}

RunConfig is used to define run options for a mobile node

type SearchHandle

type SearchHandle struct {
	Id string
	// contains filtered or unexported fields
}

SearchHandle is used to cancel an async search request

func (*SearchHandle) Cancel

func (h *SearchHandle) Cancel()

Cancel is used to cancel the request

type ShardCallback

type ShardCallback interface {
	OnShard(data []byte)
	OnComplete()
	OnError(err error)
}

ShardPbCallback is used to get the shards from shardlist. Note that the meaning of data is according to caller.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳