mobile

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2019 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 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
	LogToDisk bool
	Debug     bool
}

InitConfig is used to setup a textile node

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

func (m *Mobile) CheckCafeMessages() error

CheckCafeMessages calls core 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) 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) 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) 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() error

Stop the mobile node

func (*Mobile) Summary added in v0.1.10

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

Summary calls core Summary

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

func (m *Mobile) Version() string

Version returns common Version

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