mobile

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2019 License: MIT Imports: 28 Imported by: 0

README

@textile/go-mobile

banner


MIT License CircleCI

This repository contains pre-built Textile mobile clients for iOS and Android.

See textile-mobile for the Textile Photos iOS/Android app.

What is Textile?

Textile provides encrypted, recoverable, schema-based, and cross-application data storage built on IPFS and libp2p. We like to think of it as a decentralized data wallet with built-in protocols for sharing and recovery, or more simply, an open and programmable iCloud.

Install

yarn add @textile/go-mobile

License

MIT

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(phrase string, index int, password string) ([]byte, error)

WalletAccountAt derives the account at the given index

Types

type Callback added in v0.1.10

type Callback interface {
	Call(data []byte, err error)
}

Callback is used for asyc methods (data is a protobuf)

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 notifies the thread of a join

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) 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) 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(dir []byte, threadId string, caption string) ([]byte, error)

AddFiles adds a prepared file to a thread

func (*Mobile) AddFilesByTarget added in v0.1.10

func (m *Mobile) AddFilesByTarget(target string, threadId string, caption string) ([]byte, error)

AddFilesByTarget adds a prepared file to a thread by referencing its top level hash

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

func (m *Mobile) CafeSession(peerId 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) 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) ([]byte, error)

DataAtPath calls core 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(peerId string) error

DeegisterCafe calls core DeregisterCafe

func (*Mobile) Encrypt added in v0.1.10

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

Encrypt calls core Encrypt

func (*Mobile) Feed added in v0.1.10

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

Feed calls core Feed

func (*Mobile) FileData added in v0.1.10

func (m *Mobile) FileData(hash string) (string, error)

FileData returns a data url of a raw file under a path

func (*Mobile) Files added in v0.1.10

func (m *Mobile) Files(offset string, limit int, threadId string) ([]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) IgnoreInviteViaNotification added in v0.1.10

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

IgnoreInviteViaNotification call core IgnoreInviteViaNotification

func (*Mobile) ImageFileDataForMinWidth added in v0.1.10

func (m *Mobile) ImageFileDataForMinWidth(pth string, minWidth int) (string, error)

ImageFileDataForMinWidth returns a data url of an image at or above requested size, or the next best option. Note: Now that consumers are in control of image sizes via schemas, handling this here doesn't feel right. We can eventually push this up to RN, Obj-C, Java. Note: pth is <target>/<index>, e.g., "Qm.../0"

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

func (m *Mobile) OnlineCh() <-chan struct{}

OnlineCh returns core OnlineCh

func (*Mobile) PeerId added in v0.1.10

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

PeerId returns the ipfs peer id

func (*Mobile) PrepareFiles added in v0.1.10

func (m *Mobile) PrepareFiles(data string, threadId string, cb Callback)

PrepareFiles processes base64 encoded data for a thread, but does NOT share it

func (*Mobile) PrepareFilesByPath added in v0.1.10

func (m *Mobile) PrepareFilesByPath(path string, threadId string, cb Callback)

PrepareFilesByPath processes a file by path for a thread, but does NOT share it

func (*Mobile) PrepareFilesByPathSync added in v0.1.10

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

PrepareFilesByPath processes a file by path for a thread, but does NOT share it

func (*Mobile) PrepareFilesSync added in v0.1.10

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

PrepareFiles processes base64 encoded data for a thread, but does NOT share it

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(peerId string) ([]byte, error)

RefreshCafeSession calls core RefreshCafeSession

func (*Mobile) RegisterCafe added in v0.1.10

func (m *Mobile) RegisterCafe(host string, token string) error

RegisterCafe calls core 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(hash string) error

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

func (m *Mobile) Version() string

Version returns common Version

type RunConfig added in v0.1.10

type RunConfig struct {
	RepoPath string
	Debug    bool
}

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