Documentation ¶
Index ¶
- Variables
- func ConflictError(err error) bool
- func Init(repoPath string, version string) error
- func MigrateUp(repoPath string, pinCode string, testnet bool) error
- func Stat(repoPath string) error
- type Block
- type BlockStore
- type BlockType
- type CafeClient
- type CafeClientMessage
- type CafeClientMessageStore
- type CafeClientNonce
- type CafeClientNonceStore
- type CafeClientStore
- type CafeClientThread
- type CafeClientThreadStore
- type CafeMessage
- type CafeMessageStore
- type CafeRequest
- type CafeRequestStore
- type CafeRequestType
- type CafeSession
- type CafeSessionStore
- type ConfigStore
- type Contact
- type ContactStore
- type Datastore
- type File
- type FileStore
- type Migration
- type Notification
- type NotificationStore
- type NotificationType
- type ProfileStore
- type Queryable
- type Thread
- type ThreadInvite
- type ThreadInviteStore
- type ThreadMessage
- type ThreadMessageStore
- type ThreadPeer
- type ThreadPeerStore
- type ThreadState
- type ThreadStore
- type ThreadType
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMigrationRequired = errors.New("repo needs migration")
View Source
var ErrRepoCorrupted = errors.New("repo is corrupted")
View Source
var ErrRepoDoesNotExist = errors.New("repo does not exist, initialization is required")
View Source
var ErrRepoExists = errors.New("repo not empty, reinitializing would overwrite your account")
Functions ¶
func ConflictError ¶
Types ¶
type BlockStore ¶
type CafeClient ¶
type CafeClientMessage ¶
type CafeClientMessageStore ¶
type CafeClientNonce ¶
type CafeClientNonceStore ¶
type CafeClientNonceStore interface { Add(nonce *CafeClientNonce) error Get(value string) *CafeClientNonce Delete(value string) error }
type CafeClientStore ¶
type CafeClientStore interface { Add(account *CafeClient) error Get(id string) *CafeClient Count() int List() []CafeClient ListByAddress(address string) []CafeClient UpdateLastSeen(id string, date time.Time) error Delete(id string) error }
type CafeClientThread ¶
type CafeClientThreadStore ¶
type CafeClientThreadStore interface { AddOrUpdate(thrd *CafeClientThread) error ListByClient(clientId string) []CafeClientThread Delete(id string, clientId string) error DeleteByClient(clientId string) error }
type CafeMessage ¶
type CafeMessageStore ¶
type CafeMessageStore interface { Queryable Add(msg *CafeMessage) error List(offset string, limit int) []CafeMessage AddAttempt(id string) error Delete(id string) error }
type CafeRequest ¶
type CafeRequestStore ¶
type CafeRequestStore interface { Queryable Add(req *CafeRequest) error List(offset string, limit int) []CafeRequest Delete(id string) error DeleteByCafe(cafeId string) error }
type CafeRequestType ¶
type CafeRequestType int
const ( CafeStoreRequest CafeRequestType = iota CafeStoreThreadRequest CafePeerInboxRequest )
func (CafeRequestType) Description ¶
func (rt CafeRequestType) Description() string
type CafeSession ¶
type CafeSessionStore ¶
type CafeSessionStore interface { AddOrUpdate(session *CafeSession) error Get(cafeId string) *CafeSession List() []CafeSession Delete(cafeId string) error }
type ConfigStore ¶
type ContactStore ¶
type Datastore ¶
type Datastore interface { Config() ConfigStore Profile() ProfileStore Contacts() ContactStore Files() FileStore Threads() ThreadStore ThreadInvites() ThreadInviteStore ThreadPeers() ThreadPeerStore ThreadMessages() ThreadMessageStore Blocks() BlockStore Notifications() NotificationStore CafeSessions() CafeSessionStore CafeRequests() CafeRequestStore CafeMessages() CafeMessageStore CafeClientNonces() CafeClientNonceStore CafeClients() CafeClientStore CafeClientThreads() CafeClientThreadStore CafeClientMessages() CafeClientMessageStore Ping() error Close() }
type File ¶
type File struct { Mill string `json:"mill"` Checksum string `json:"checksum"` Source string `json:"source"` Opts string `json:"opts,omitempty"` Hash string `json:"hash"` Key string `json:"key,omitempty"` Media string `json:"media"` Name string `json:"name,omitempty"` Size int `json:"size"` Added time.Time `json:"added"` Meta map[string]interface{} `json:"meta,omitempty"` Targets []string `json:"targets,omitempty"` }
type FileStore ¶
type FileStore interface { Queryable Add(file *File) error Get(hash string) *File GetByPrimary(mill string, checksum string) *File GetBySource(mill string, source string, opts string) *File AddTarget(hash string, target string) error RemoveTarget(hash string, target string) error Count() int Delete(hash string) error }
type Migration ¶
type Migration interface { Up(repoPath string, pinCode string, testnet bool) error Down(repoPath string, pinCode string, testnet bool) error Major() bool }
Migration performs minor up and down migrations
type Notification ¶
type Notification struct { Id string `json:"id"` Date time.Time `json:"date"` ActorId string `json:"actor_id"` Subject string `json:"subject"` SubjectId string `json:"subject_id"` BlockId string `json:"block_id,omitempty"` Target string `json:"target,omitempty"` Type NotificationType `json:"type"` Body string `json:"body"` Read bool `json:"read"` }
type NotificationStore ¶
type NotificationStore interface { Queryable Add(notification *Notification) error Get(id string) *Notification Read(id string) error ReadAll() error List(offset string, limit int) []Notification CountUnread() int Delete(id string) error DeleteByActor(actorId string) error DeleteBySubject(subjectId string) error DeleteByBlock(blockId string) error }
type NotificationType ¶
type NotificationType int
const ( InviteReceivedNotification NotificationType = iota AccountPeerJoinedNotification PeerJoinedNotification PeerLeftNotification MessageAddedNotification FilesAddedNotification CommentAddedNotification LikeAddedNotification )
func (NotificationType) Description ¶
func (n NotificationType) Description() string
type ProfileStore ¶
type Thread ¶
type Thread struct { Id string `json:"id"` Key string `json:"key"` PrivKey []byte `json:"sk"` Name string `json:"name"` Schema string `json:"schema"` Initiator string `json:"initiator"` Type ThreadType `json:"type"` State ThreadState `json:"state"` Head string `json:"head"` }
type ThreadInvite ¶
type ThreadInviteStore ¶
type ThreadInviteStore interface { Queryable Add(invite *ThreadInvite) error Get(id string) *ThreadInvite List() []ThreadInvite Delete(id string) error }
type ThreadMessage ¶
type ThreadMessageStore ¶
type ThreadMessageStore interface { Queryable Add(msg *ThreadMessage) error List(offset string, limit int) []ThreadMessage Delete(id string) error }
type ThreadPeer ¶
type ThreadPeerStore ¶
type ThreadPeerStore interface { Queryable Add(peer *ThreadPeer) error List() []ThreadPeer ListById(id string) []ThreadPeer ListByThread(threadId string) []ThreadPeer ListUnwelcomedByThread(threadId string) []ThreadPeer WelcomeByThread(thread string) error Count(distinct bool) int Delete(id string, thread string) error DeleteById(id string) error DeleteByThread(thread string) error }
type ThreadState ¶
type ThreadState int
const ( ThreadLoading ThreadState = iota ThreadLoaded )
func (ThreadState) Description ¶
func (ts ThreadState) Description() string
type ThreadStore ¶
type ThreadType ¶
type ThreadType int
const ( PrivateThread ThreadType = iota // invites not allowed ReadOnlyThread // all non-initiator writes ignored PublicThread // only non-initiator file writes ignored (annotations allowed) OpenThread // all writes allowed )
in order of decreasing privacy
func ThreadTypeFromString ¶
func ThreadTypeFromString(desc string) (ThreadType, error)
func (ThreadType) Description ¶
func (tt ThreadType) Description() string
Click to show internal directories.
Click to hide internal directories.