Documentation ¶
Overview ¶
This package provides a high-level interface to the Slick implementation. It provides functions for defining schemas, writing, and querying data. As well it provides functions for joining, leaving and creating groups as well as the device group.
Index ¶
- Constants
- func DeserializeInvite(s string) (*messaging.Jpake1, error)
- func NewPin() (string, error)
- func SerializeDeviceInvite(i *DeviceGroupInvite) (string, error)
- func SerializeInvite(i *messaging.Jpake1) (string, error)
- type AppState
- type Device
- type DeviceGroupInvite
- type EAVWriter
- type Group
- type GroupUpdate
- type IntroUpdate
- type MessagesFetchedUpdate
- type Slick
- func (s *Slick) AcceptInvite(invite *messaging.Jpake1, password string) (ids.ID, error)
- func (s *Slick) AddPushNotificationToken(token string) error
- func (s *Slick) CancelInvites(groupID ids.ID) error
- func (s *Slick) CreateGroup(name string) (ids.ID, error)
- func (s *Slick) DeletePushNotificationToken(token string) error
- func (s *Slick) EAVCreateViews(views map[string]*eav.ViewDefinition) error
- func (s *Slick) EAVGet(dest interface{}, query string, vars ...interface{}) error
- func (s *Slick) EAVIndexWhere(viewName, prefix string) (string, error)
- func (s *Slick) EAVQuery(query string, vars ...interface{}) (*eav.Result, error)
- func (s *Slick) EAVSelect(dest interface{}, query string, vars ...interface{}) error
- func (s *Slick) EAVSelectors(viewName, prefix string, columnNames ...string) (string, error)
- func (s *Slick) EAVSubscribeAfterEntity(cb func(viewName string, groupID, id ids.ID), includeBackfill bool, ...) error
- func (s *Slick) EAVSubscribeAfterView(cb func(viewName string), includeBackfill bool, views ...string) error
- func (s *Slick) EAVSubscribeBeforeEntity(cb func(viewName string, groupID, id ids.ID) error, includeBackfill bool, ...) error
- func (s *Slick) EAVSubscribeBeforeView(cb func(viewName string) error, includeBackfill bool, views ...string) error
- func (s *Slick) EAVWrite(id ids.ID, ops *eav.Operations) error
- func (s *Slick) EAVWriter(g *Group) *EAVWriter
- func (s *Slick) GetMessages(key []byte) error
- func (s *Slick) Group(groupID ids.ID) (*Group, error)
- func (s *Slick) GroupState(groupID ids.ID) (*GroupUpdate, error)
- func (s *Slick) Groups() ([]*Group, error)
- func (s *Slick) Initialize(key []byte) error
- func (s *Slick) Initialized() bool
- func (s *Slick) Invite(groupID ids.ID, password string) (*messaging.Jpake1, error)
- func (s *Slick) New() bool
- func (s *Slick) NewID(authorTag [7]byte) (ids.ID, error)
- func (s *Slick) NewKey(password string) ([]byte, error)
- func (s *Slick) Open(key []byte) error
- func (s *Slick) RegisterHeyaTransport(authToken, host string, port int) error
- func (s *Slick) Running() bool
- func (s *Slick) Shutdown() error
- func (s *Slick) TransportStates() map[string]string
- func (s *Slick) Transports() *Transports
- func (s *Slick) Updates() <-chan interface{}
- type TableUpdate
- type TransportStateUpdate
- type Transports
Constants ¶
const ( // Constants for application state. StateNew = iota StateInitialized StateRunning StateClosing StateClosed // Meta-intro states useful to developers. INTRO_SUCCEEDED indicates a completely backfilled group. IntroFailed indicates something went // wrong during the invite process. IntroFailed = 1000 IntroSucceeded = 1001 )
Variables ¶
This section is empty.
Functions ¶
func SerializeDeviceInvite ¶
func SerializeDeviceInvite(i *DeviceGroupInvite) (string, error)
Types ¶
type AppState ¶
type AppState struct {
State int
}
An event indicating a change in the state of Slick.
type DeviceGroupInvite ¶
type DeviceGroupInvite struct { Invite *messaging.Jpake1 `bencode:"i"` Password string `bencode:"s"` }
func DeserializeDeviceInvite ¶
func DeserializeDeviceInvite(s string) (*DeviceGroupInvite, error)
type Group ¶
type Group struct { ID ids.ID AuthorTag [7]byte IdentityTag [4]byte MembershipTag [3]byte State int Name string // contains filtered or unexported fields }
A group.
type GroupUpdate ¶
type GroupUpdate struct { ID ids.ID AckedMemberCount uint GroupState int MemberCount uint ConnectedMemberCount uint Seq uint64 PendingMessageCount uint }
An event indicating a change in a group.
type IntroUpdate ¶
An event indicating a change in an intro.
type MessagesFetchedUpdate ¶
type MessagesFetchedUpdate struct { }
type Slick ¶
type Slick struct { DeviceGroup *deviceGroup DB *db.Database // contains filtered or unexported fields }
func (*Slick) AcceptInvite ¶
Accept a password-protected invite.
func (*Slick) AddPushNotificationToken ¶
Add a push notification token.
func (*Slick) CancelInvites ¶
Cancel all invites for a specific group.
func (*Slick) CreateGroup ¶
Create a new group.
func (*Slick) DeletePushNotificationToken ¶
Remove a push notification token.
func (*Slick) EAVCreateViews ¶
func (s *Slick) EAVCreateViews(views map[string]*eav.ViewDefinition) error
Creates multiple views in the EAV database.
func (*Slick) EAVIndexWhere ¶
func (*Slick) EAVSelectors ¶
func (*Slick) EAVSubscribeAfterEntity ¶
func (s *Slick) EAVSubscribeAfterEntity(cb func(viewName string, groupID, id ids.ID), includeBackfill bool, views ...string) error
Register callback for entities changes after they are committed
func (*Slick) EAVSubscribeAfterView ¶
func (s *Slick) EAVSubscribeAfterView(cb func(viewName string), includeBackfill bool, views ...string) error
Register callback for view changes after they are committed
func (*Slick) EAVSubscribeBeforeEntity ¶
func (s *Slick) EAVSubscribeBeforeEntity(cb func(viewName string, groupID, id ids.ID) error, includeBackfill bool, views ...string) error
Register callback for entities changes before they are committed
func (*Slick) EAVSubscribeBeforeView ¶
func (s *Slick) EAVSubscribeBeforeView(cb func(viewName string) error, includeBackfill bool, views ...string) error
Register callback for view changes before they are committed
func (*Slick) GetMessages ¶
Open an existing slick with a given key, get all messages from it and wait till it's done.
func (*Slick) GroupState ¶
func (s *Slick) GroupState(groupID ids.ID) (*GroupUpdate, error)
Get the current group state for a specific group.
func (*Slick) Initialize ¶
Initialize slick with a given key.
func (*Slick) Initialized ¶
Returns true is slick is in INITIALIZED state.
func (*Slick) RegisterHeyaTransport ¶
Register a heya transport.
func (*Slick) TransportStates ¶
Get current transport states
func (*Slick) Transports ¶
func (s *Slick) Transports() *Transports
type TableUpdate ¶
An event indicating an update to a table.
type TransportStateUpdate ¶
type Transports ¶
type Transports struct {
// contains filtered or unexported fields
}
func (*Transports) Preflight ¶
func (st *Transports) Preflight(urls []string) []bool
func (*Transports) ReportGroup ¶
func (st *Transports) ReportGroup(id ids.ID) error
func (*Transports) StatusChanged ¶
func (st *Transports) StatusChanged(f func(string, bool))
func (*Transports) URLsForGroup ¶
func (st *Transports) URLsForGroup(id ids.ID) ([]string, error)
Directories ¶
Path | Synopsis |
---|---|
This package defines (yet another) bencode encoding/decoding library.
|
This package defines (yet another) bencode encoding/decoding library. |
A thin wrapper over the system clock which can be implemented for use in tests.
|
A thin wrapper over the system clock which can be implemented for use in tests. |
This package defines a common config struct which can be used by any subsystem within slick.
|
This package defines a common config struct which can be used by any subsystem within slick. |
Handles routing application messages to the correct database handler.
|
Handles routing application messages to the correct database handler. |
This package defines a common id type which is used through out slick.
|
This package defines a common id type which is used through out slick. |
internal
|
|
db
This package defines a SQLCipher database.
|
This package defines a SQLCipher database. |
Package implements reliable messaging layer for parties identified by a URL.
|
Package implements reliable messaging layer for parties identified by a URL. |
heya
Defines package responsible for performing the actual sending and receiving of messages to URLs.
|
Defines package responsible for performing the actual sending and receiving of messages to URLs. |