mobile

package
v0.7.8 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2020 License: MIT Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountRepoExists added in v0.7.4

func AccountRepoExists(baseRepoPath string, accountAddress string) bool

AccountRepoExists return whether or not the repo at repoPath exists

func InitRepo added in v0.1.10

func InitRepo(config *InitConfig) error

InitRepo calls core InitRepo

func MigrateRepo added in v0.1.10

func MigrateRepo(config *MigrateConfig) error

MigrateRepo calls core MigrateRepo

func NewWallet added in v0.1.10

func NewWallet(wordCount int) (string, error)

NewWallet creates a brand new wallet and returns its recovery phrase

func RepoExists added in v0.7.4

func RepoExists(repoPath string) bool

RepoExists return whether or not the repo at repoPath exists

func WalletAccountAt added in v0.1.10

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

WalletAccountAt derives the account at the given index

Types

type Callback added in v0.1.10

type Callback interface {
	Call(err error)
}

Callback is used for asyc methods

type DataCallback added in v0.5.0

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

DataCallback is used for asyc methods that deliver raw data

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 InitConfig added in v0.1.10

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

InitConfig is used to setup a textile node

func (InitConfig) Repo added in v0.7.4

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

Repo returns the actual location of the configured repo

func (InitConfig) RepoExists added in v0.7.2

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

RepoExists return whether or not the configured repo already exists

type Messenger

type Messenger interface {
	Notify(event *Event)
}

Messenger is a push mechanism to the bridge

type MigrateConfig added in v0.1.10

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 added in v0.1.10

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

Create a gomobile compatible wrapper around Textile

func (*Mobile) AcceptExternalInvite added in v0.1.10

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

AcceptExternalInvite calls core AcceptExternalInvite

func (*Mobile) AcceptInvite added in v0.1.12

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

AcceptInvite calls core AcceptInvite

func (*Mobile) AcceptInviteViaNotification added in v0.1.10

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

AcceptInviteViaNotification call core AcceptInviteViaNotification

func (*Mobile) AccountContact added in v0.1.10

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

AccountContact calls core AccountContact

func (*Mobile) AccountThread added in v0.1.13

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

AccountThread calls core AccountThread

func (*Mobile) AddComment added in v0.1.10

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

AddComment adds a comment targeted at the given block

func (*Mobile) AddContact added in v0.1.10

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

AddContact calls core AddContact

func (*Mobile) AddData added in v0.3.0

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

AddData adds raw data to a thread

func (*Mobile) AddExternalInvite added in v0.1.10

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

AddExternalInvite generates a new external invite link to a thread

func (*Mobile) AddFiles added in v0.1.10

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 added in v0.1.10

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

AddFlag adds a flag targeted at the given block

func (*Mobile) AddIgnore added in v0.1.10

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 added in v0.1.10

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

AddInvite call core AddInvite

func (*Mobile) AddLike added in v0.1.10

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

AddLike adds a like targeted at the given block

func (*Mobile) AddMessage added in v0.1.10

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

AddMessage adds a message to a thread

func (*Mobile) AddOrUpdateThread added in v0.1.10

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

AddOrUpdateThread calls core AddOrUpdateThread

func (*Mobile) AddSchema added in v0.1.10

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

AddSchema adds a new schema via schema mill

func (*Mobile) AddThread

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

AddThread adds a new thread with the given name

func (*Mobile) Address added in v0.1.10

func (m *Mobile) Address() string

Address returns account address

func (*Mobile) Avatar added in v0.1.10

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

Avatar calls core Avatar

func (*Mobile) CafeRequestNotPending added in v0.4.2

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

CafeRequestNotPending marks a request as not pending (new)

func (*Mobile) CafeRequestPending added in v0.3.0

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

CafeRequestPending marks a request as pending

func (*Mobile) CafeRequests added in v0.1.12

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

CafeRequests paginates new requests

func (*Mobile) CafeSession added in v0.1.10

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

CafeSession calls core CafeSession

func (*Mobile) CafeSessions added in v0.1.10

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

CafeSessions calls core CafeSessions

func (*Mobile) CancelIpfsPubsubSub added in v0.7.6

func (m *Mobile) CancelIpfsPubsubSub(queryId string)

CancelIpfsPubsubSub is used to cancel the request

func (*Mobile) CheckCafeMessages added in v0.1.10

func (m *Mobile) CheckCafeMessages(cb Callback)

CheckCafeMessages is the async flavor of checkCafeMessages

func (*Mobile) CompleteCafeRequest added in v0.3.0

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

CompleteCafeRequest marks a request as complete

func (*Mobile) Contact added in v0.1.10

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) DataAtPath added in v0.1.10

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

DataAtPath is the async version of dataAtPath

func (*Mobile) Decrypt added in v0.1.10

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

Decrypt call core Decrypt

func (*Mobile) DeregisterCafe added in v0.1.10

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

DeegisterCafe is the async flavor of deregisterCafe

func (*Mobile) Encrypt added in v0.1.10

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

Encrypt calls core Encrypt

func (*Mobile) FailCafeRequest added in v0.3.0

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

FailCafeRequest deletes a request

func (*Mobile) Feed added in v0.1.10

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

Feed calls core Feed

func (*Mobile) File added in v0.7.2

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

File calls core File

func (*Mobile) FileContent added in v0.2.0

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

FileContent is the async version of fileContent

func (*Mobile) Files added in v0.1.10

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

Files calls core Files

func (*Mobile) GitSummary added in v0.1.10

func (m *Mobile) GitSummary() string

GitSummary returns common GitSummary

func (*Mobile) IgnoreInvite added in v0.1.12

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

IgnoreInvite calls core IgnoreInvite

func (*Mobile) IgnoreInviteViaNotification added in v0.1.10

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

IgnoreInviteViaNotification call core IgnoreInviteViaNotification

func (*Mobile) ImageFileContentForMinWidth added in v0.2.0

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

ImageFileContentForMinWidth is the async version of imageFileContentForMinWidth

func (*Mobile) Invites added in v0.1.12

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

Invites calls core Invites

func (*Mobile) IpfsPubsubPub added in v0.7.6

func (m *Mobile) IpfsPubsubPub(topic string, data string) error

IpfsPubsubPub publishes a message to a given pubsub topic

func (*Mobile) IpfsPubsubSub added in v0.7.6

func (m *Mobile) IpfsPubsubSub(topic string) (string, error)

IpfsPubsubSub Subscribes to messages on a given topic

func (*Mobile) Messages added in v0.1.10

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

Messages calls core Messages

func (*Mobile) Name added in v0.1.10

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

Name calls core Name

func (*Mobile) Notifications added in v0.1.10

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

Notifications call core Notifications

func (*Mobile) Online added in v0.4.2

func (m *Mobile) Online() bool

Online returns core Online

func (*Mobile) PeerId added in v0.1.10

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

PeerId returns the ipfs peer id

func (*Mobile) Profile added in v0.1.10

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

Profile calls core Profile

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 added in v0.1.10

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

RefreshCafeSession is the async flavor of refreshCafeSession

func (*Mobile) RegisterCafe added in v0.1.10

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

RegisterCafe is the async flavor of registerCafe

func (*Mobile) RemoveContact added in v0.1.10

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

RemoveContact calls core RemoveContact

func (*Mobile) RemoveThread

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

RemoveThread call core RemoveThread

func (*Mobile) RenameThread added in v0.1.10

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

RenameThread call core RenameThread

func (*Mobile) SearchContacts added in v0.1.10

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

SearchContacts calls core SearchContacts

func (*Mobile) SearchThreadSnapshots added in v0.1.10

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

SearchThreadSnapshots calls core SearchThreadSnapshots

func (*Mobile) Seed added in v0.1.10

func (m *Mobile) Seed() string

Seed returns account seed

func (*Mobile) SetAvatar added in v0.1.10

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 added in v0.1.10

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

SetLogLevel calls core SetLogLevel

func (*Mobile) SetName added in v0.1.10

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

SetName calls core SetName

func (*Mobile) ShareFiles added in v0.3.0

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 added in v0.7.0

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

Sign calls core Sign

func (*Mobile) SnapshotThreads added in v0.1.10

func (m *Mobile) SnapshotThreads() error

SnapshotThreads calls core SnapshotThreads

func (*Mobile) Start

func (m *Mobile) Start() error

Start the mobile node

func (*Mobile) Stop

func (m *Mobile) Stop(cb Callback)

Stop the mobile node

func (*Mobile) Summary added in v0.1.10

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

Summary calls core Summary

func (*Mobile) SwarmConnect added in v0.7.2

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

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

func (*Mobile) SyncAccount added in v0.1.10

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

SyncAccount calls core SyncAccount

func (*Mobile) Thread added in v0.1.10

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

Thread calls core Thread

func (*Mobile) ThreadPeers added in v0.1.10

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

ThreadPeers calls core ThreadPeers

func (*Mobile) Threads

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

Threads lists all threads

func (*Mobile) UpdateCafeRequestProgress added in v0.4.2

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

UpdateCafeRequestProgress updates the request with progress info

func (*Mobile) Verify added in v0.7.0

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

Verify calls core verify

func (*Mobile) Version added in v0.1.10

func (m *Mobile) Version() string

Version returns common Version

func (*Mobile) WaitAdd added in v0.6.11

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

WaitAdd calls core WaitAdd

func (*Mobile) WaitDone added in v0.6.11

func (m *Mobile) WaitDone(src string)

WaitDone marks a wait as done in the stop wait group

func (*Mobile) WriteCafeRequest added in v0.3.0

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

WriteCafeRequest is the async version of writeCafeRequest

type ProtoCallback added in v0.5.0

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

ProtoCallback is used for asyc methods that deliver a protobuf message

type RunConfig added in v0.1.10

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

RunConfig is used to define run options for a mobile node

type SearchHandle added in v0.1.10

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

SearchHandle is used to cancel an async search request

func (*SearchHandle) Cancel added in v0.1.10

func (h *SearchHandle) Cancel()

Cancel is used to cancel the request

Jump to

Keyboard shortcuts

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