Documentation ¶
Index ¶
- Variables
- func CountContainersByTimestamp(source *KernelSource.ContainerSource, timestamp time.NanoTime) int
- type Container
- func (c *Container) CheckReady() bool
- func (c *Container) Create(source KernelSource.Interface) error
- func (c *Container) Destroy(_ KernelSource.Interface) error
- func (c *Container) Load(source KernelSource.Interface, filter ...interface{}) error
- func (c *Container) Reload(source KernelSource.Interface) error
- func (c *Container) Replace(source KernelSource.Interface) error
- type Interface
- type Message
- type Messagebox
- func (m *Messagebox) CheckReady() bool
- func (m *Messagebox) Create(source KernelSource.Interface) error
- func (m *Messagebox) Destroy(source KernelSource.Interface) error
- func (m *Messagebox) Load(source KernelSource.Interface, filter ...interface{}) error
- func (m *Messagebox) Reload(source KernelSource.Interface) error
- func (m *Messagebox) Replace(source KernelSource.Interface) error
- type MoonMessage
- type MoonPass
- func (m *MoonPass) CheckReady() bool
- func (m *MoonPass) Create(source KernelSource.Interface) error
- func (m *MoonPass) Destroy(source KernelSource.Interface) error
- func (m *MoonPass) Encrypt(data []byte) []byte
- func (m *MoonPass) Load(source KernelSource.Interface, filter ...interface{}) error
- func (m *MoonPass) Reload(source KernelSource.Interface) error
- func (m *MoonPass) Replace(source KernelSource.Interface) error
- type MoonPassConfirm
- type SyncMessagebox
Constants ¶
This section is empty.
Variables ¶
var (
ErrorBadMethodCallException = errors.New("bad_method_call_exception")
)
Functions ¶
func CountContainersByTimestamp ¶
func CountContainersByTimestamp(source *KernelSource.ContainerSource, timestamp time.NanoTime) int
CountContainersByTimestamp ToDo
Types ¶
type Container ¶
type Container struct { UUID string `rethinkdb:"id,omitempty" json:"uuid"` Message *Message `rethinkdb:"message" json:"message"` CreatedTime time.NanoTime `rethinkdb:"createdTime" json:"createdTime"` Canceled bool `rethinkdb:"canceled" json:"canceled"` }
Container is the data structure, only can be modified by server only, to include a message into database.
func FetchContainersByTimestamp ¶
func FetchContainersByTimestamp(source *KernelSource.ContainerSource, timestamp time.NanoTime, limit int64) []Container
FetchContainersByTimestamp ToDo
func (*Container) CheckReady ¶
CheckReady will check model is ready.
func (*Container) Create ¶
func (c *Container) Create(source KernelSource.Interface) error
Create will create a new message to database.
func (*Container) Destroy ¶
func (c *Container) Destroy(_ KernelSource.Interface) error
Destroy is the method can not be called.
func (*Container) Load ¶
func (c *Container) Load(source KernelSource.Interface, filter ...interface{}) error
Load will load a message from database, filter is the message ID.
type Interface ¶
type Interface interface { CheckReady() bool Load(source source.Interface, filter ...interface{}) error Reload(source source.Interface) error Create(source source.Interface) error Replace(source source.Interface) error Destroy(source source.Interface) error }
func NewContainer ¶
NewContainer will include a message automatically, the function will fill the information required for Container.
func NewMoonPass ¶
func NewMoonPass() Interface
type Message ¶
type Message struct { Content string `rethinkdb:"content" json:"content"` ContentType int `rethinkdb:"contentType" json:"contentType"` Origin string `rethinkdb:"origin" json:"origin"` }
Message is the data structure from client, to be created the message by including into Container.
type Messagebox ¶
type Messagebox struct { CreatedTime time.NanoTime `rethinkdb:"createdTime" json:"createdTime"` LastSeen time.NanoTime `rethinkdb:"lastSeen" json:"lastSeen"` Metadata interface{} `rethinkdb:"metadata" json:"metadata"` Origin string `rethinkdb:"origin" json:"origin"` Target string `rethinkdb:"target" json:"target"` }
func (*Messagebox) CheckReady ¶
func (m *Messagebox) CheckReady() bool
CheckReady will check model is ready.
func (*Messagebox) Create ¶
func (m *Messagebox) Create(source KernelSource.Interface) error
Create ToDo
func (*Messagebox) Destroy ¶
func (m *Messagebox) Destroy(source KernelSource.Interface) error
Destroy ToDo
func (*Messagebox) Load ¶
func (m *Messagebox) Load(source KernelSource.Interface, filter ...interface{}) error
Load ToDo
func (*Messagebox) Reload ¶
func (m *Messagebox) Reload(source KernelSource.Interface) error
Reload ToDo
func (*Messagebox) Replace ¶
func (m *Messagebox) Replace(source KernelSource.Interface) error
Replace ToDo
type MoonMessage ¶
type MoonMessage struct { }
type MoonPass ¶
func (*MoonPass) CheckReady ¶
type MoonPassConfirm ¶
type MoonPassConfirm struct { MoonPass *MoonPass Hash string `json:"hash"` Data []byte `json:"data"` }
func NewMoonPassConfirm ¶
func NewMoonPassConfirm(moonPass *MoonPass, hash string, data []byte) *MoonPassConfirm
type SyncMessagebox ¶
type SyncMessagebox struct { Messagebox ExtraData interface{} `json:"extraData"` }
SyncMessagebox this is the wrapper to wrap client a messagebox with extra data.
func FetchSyncMessageboxesByTimestamp ¶
func FetchSyncMessageboxesByTimestamp(source *KernelSource.MessageboxSource, timestamp time.NanoTime, limit int64) []SyncMessagebox
FetchSyncMessageboxesByTimestamp ToDo