Documentation ¶
Index ¶
- Constants
- Variables
- type AddDataResult
- type Config
- type Contact
- type Overview
- type Profile
- type Update
- type UpdateType
- type Wallet
- func (w *Wallet) AcceptExternalThreadInvite(blockId string, key []byte) (mh.Multihash, error)
- func (w *Wallet) AcceptThreadInvite(blockId string) (mh.Multihash, error)
- func (w *Wallet) AcceptThreadInviteViaNotification(id string) (mh.Multihash, error)
- func (w *Wallet) AddDevice(name string, pk libp2pc.PubKey) error
- func (w *Wallet) AddPhoto(path string) (*AddDataResult, error)
- func (w *Wallet) AddThread(name string, secret libp2pc.PrivKey, join bool) (*thread.Thread, error)
- func (w *Wallet) ConnectPeer(addrs []string) ([]string, error)
- func (w *Wallet) ContactThreads(id string) []*thread.Thread
- func (w *Wallet) Contacts() []*Contact
- func (w *Wallet) CountUnreadNotifications() int
- func (w *Wallet) CreateReferral(req *cmodels.ReferralRequest) (*cmodels.ReferralResponse, error)
- func (w *Wallet) Devices() []repo.Device
- func (w *Wallet) Done() <-chan struct{}
- func (w *Wallet) FetchMessages() error
- func (w *Wallet) GetAvatarId() (*string, error)
- func (w *Wallet) GetBlock(id string) (*repo.Block, error)
- func (w *Wallet) GetBlockByDataId(dataId string) (*repo.Block, error)
- func (w *Wallet) GetCafeAddr() string
- func (w *Wallet) GetCafeApiAddr() string
- func (w *Wallet) GetDataAtPath(path string) ([]byte, error)
- func (w *Wallet) GetId() (string, error)
- func (w *Wallet) GetNotifications(offset string, limit int) []repo.Notification
- func (w *Wallet) GetPeerStatus(peerId string) (string, error)
- func (w *Wallet) GetPhotoKey(id string) (string, error)
- func (w *Wallet) GetPrivKey() (libp2pc.PrivKey, error)
- func (w *Wallet) GetProfile(peerId string) (*Profile, error)
- func (w *Wallet) GetPubKey() (libp2pc.PubKey, error)
- func (w *Wallet) GetPubKeyString() (string, error)
- func (w *Wallet) GetRepoPath() string
- func (w *Wallet) GetThread(id string) (*int, *thread.Thread)
- func (w *Wallet) GetTokens(forceRefresh bool) (*repo.CafeTokens, error)
- func (w *Wallet) GetUsername() (*string, error)
- func (w *Wallet) InviteDevices(thrd *thread.Thread) error
- func (w *Wallet) Ipfs() *core.IpfsNode
- func (w *Wallet) IsOnline() bool
- func (w *Wallet) IsSignedIn() (bool, error)
- func (w *Wallet) ListReferrals(key string) (*cmodels.ReferralResponse, error)
- func (w *Wallet) NewEnvelope(message *pb.Message) (*pb.Envelope, error)
- func (w *Wallet) Notifications() <-chan repo.Notification
- func (w *Wallet) Online() <-chan struct{}
- func (w *Wallet) Overview() (*Overview, error)
- func (w *Wallet) Peers() ([]libp2pn.Conn, error)
- func (w *Wallet) PhotoThreads(id string) []*thread.Thread
- func (w *Wallet) PingPeer(addrs string, num int, out chan string) error
- func (w *Wallet) PublishProfile(prof *Profile) (*util.IpnsEntry, error)
- func (w *Wallet) ReadAllNotifications() error
- func (w *Wallet) ReadNotification(id string) error
- func (w *Wallet) RemoveDevice(id string) error
- func (w *Wallet) RemoveThread(id string) (mh.Multihash, error)
- func (w *Wallet) ResolveProfile(name string) (*path.Path, error)
- func (w *Wallet) SendMessage(env *pb.Envelope, peerId string, hash *string) error
- func (w *Wallet) SetAvatarId(id string) error
- func (w *Wallet) SignIn(creds *cmodels.Credentials) error
- func (w *Wallet) SignOut() error
- func (w *Wallet) SignUp(reg *cmodels.Registration) error
- func (w *Wallet) Start() error
- func (w *Wallet) Started() bool
- func (w *Wallet) Stop() error
- func (w *Wallet) ThreadInfo(id string) (*thread.Info, error)
- func (w *Wallet) ThreadUpdates() <-chan thread.Update
- func (w *Wallet) Threads() []*thread.Thread
- func (w *Wallet) Updates() <-chan Update
- func (w *Wallet) VerifyEnvelope(env *pb.Envelope) error
- func (w *Wallet) Version() string
Constants ¶
const (
DefaultPointerPrefixLength = 14
)
Variables ¶
var ErrNoCafeHost = errors.New("cafe host address is not set")
var ErrOffline = errors.New("node is offline")
var ErrStarted = errors.New("node is started")
var ErrStopped = errors.New("node is stopped")
var ErrThreadLoaded = errors.New("thread is loaded")
Functions ¶
This section is empty.
Types ¶
type AddDataResult ¶
type AddDataResult struct { Id string `json:"id"` Key string `json:"key"` Archive *client.Archive `json:"archive,omitempty"` }
AddDataResult wraps added data content id and key
type Contact ¶
type Contact struct { Id string `json:"id"` Pk string `json:"pk"` ThreadIds []string `json:"thread_ids"` }
Contact is wrapper around Peer, with thread info
type Overview ¶
type Overview struct { SwarmSize int `json:"swarm_size"` DeviceCount int `json:"device_count"` ThreadCount int `json:"thread_count"` PhotoCount int `json:"photo_count"` ContactCount int `json:"contact_count"` }
Overview is a wallet overview object
type Update ¶
type Update struct { Id string `json:"id"` Name string `json:"name"` Type UpdateType `json:"type"` }
type UpdateType ¶
type UpdateType int
const ( ThreadAdded UpdateType = iota ThreadRemoved DeviceAdded DeviceRemoved )
type Wallet ¶
type Wallet struct {
// contains filtered or unexported fields
}
Wallet is the main Textile node structure
func (*Wallet) AcceptExternalThreadInvite ¶
AcceptExternalThreadInvite attemps to download an encrypted thread key from an external invite, add the thread, and notify the inviter of the join
func (*Wallet) AcceptThreadInvite ¶
AcceptThreadInvite attemps to download an encrypted thread key from an internal invite, add the thread, and notify the inviter of the join
func (*Wallet) AcceptThreadInviteViaNotification ¶
AcceptThreadInviteViaNotification uses an invite notification to accept an invite to a thread
func (*Wallet) AddPhoto ¶
func (w *Wallet) AddPhoto(path string) (*AddDataResult, error)
AddPhoto add a photo to the local ipfs node
func (*Wallet) ConnectPeer ¶
ConnectPeer connect to another ipfs peer (i.e., ipfs swarm connect)
func (*Wallet) ContactThreads ¶
ContactThreads returns all threads with the given peer
func (*Wallet) CountUnreadNotifications ¶
CountUnreadNotifications counts unread notifications
func (*Wallet) CreateReferral ¶
func (w *Wallet) CreateReferral(req *cmodels.ReferralRequest) (*cmodels.ReferralResponse, error)
CreateReferral requests a referral from a cafe via key
func (*Wallet) FetchMessages ¶
func (*Wallet) GetAvatarId ¶
GetAvatarId returns the current user's avatar id, which will be the id of a photo
func (*Wallet) GetBlockByDataId ¶
GetBlockByDataId searches for a local block associated with the given data id
func (*Wallet) GetCafeAddr ¶
GetCafeAddr returns the cafe address if set
func (*Wallet) GetCafeApiAddr ¶
GetCafeApiAddr returns the cafe address if set
func (*Wallet) GetDataAtPath ¶
GetDataAtPath returns raw data behind an ipfs path
func (*Wallet) GetNotifications ¶
func (w *Wallet) GetNotifications(offset string, limit int) []repo.Notification
GetNotifications lists notifications
func (*Wallet) GetPhotoKey ¶
GetPhotoKey returns a the decrypted AES key for a photo set
func (*Wallet) GetPrivKey ¶
GetPrivKey returns the current user's master secret key
func (*Wallet) GetProfile ¶
GetProfile return a model representation of a peer profile
func (*Wallet) GetPubKeyString ¶
GetPubKeyString returns the base64 encoded public ipfs peer key
func (*Wallet) GetRepoPath ¶
func (*Wallet) GetTokens ¶
func (w *Wallet) GetTokens(forceRefresh bool) (*repo.CafeTokens, error)
GetTokens returns cafe json web tokens, refreshing if needed or if forceRefresh is true
func (*Wallet) GetUsername ¶
GetUsername returns the current user's username
func (*Wallet) InviteDevices ¶
InviteDevices sends a thread invite to all devices
func (*Wallet) IsSignedIn ¶
IsSignedIn returns whether or not a user is signed in
func (*Wallet) ListReferrals ¶
func (w *Wallet) ListReferrals(key string) (*cmodels.ReferralResponse, error)
ListReferrals lists existing referrals from a cafe via key
func (*Wallet) NewEnvelope ¶
func (*Wallet) Notifications ¶
func (w *Wallet) Notifications() <-chan repo.Notification
func (*Wallet) PhotoThreads ¶
PhotoThreads lists threads which contain a photo (known to the local peer)
func (*Wallet) PublishProfile ¶
PublishProfile publishes the peer profile to ipns
func (*Wallet) ReadAllNotifications ¶
ReadAllNotifications marks all notification as read
func (*Wallet) ReadNotification ¶
ReadNotification marks a notification as read
func (*Wallet) RemoveDevice ¶
RemoveDevice removes a device
func (*Wallet) RemoveThread ¶
RemoveThread removes a thread
func (*Wallet) ResolveProfile ¶
ResolveProfile looks up a peer's profile on ipns
func (*Wallet) SendMessage ¶
func (*Wallet) SetAvatarId ¶
SetAvatarId updates profile at our peer id with new avatar address
func (*Wallet) SignIn ¶
func (w *Wallet) SignIn(creds *cmodels.Credentials) error
SignIn requests a token with a username from a cafe and saves them locally
func (*Wallet) SignUp ¶
func (w *Wallet) SignUp(reg *cmodels.Registration) error
SignUp requests a new username and token from a cafe and saves them locally
func (*Wallet) ThreadInfo ¶
ThreadInfo gets thread info