data

package
v2.0.0-...-7bc52c3 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func (c *Container) CheckReady() bool

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.

func (*Container) Reload

func (c *Container) Reload(source KernelSource.Interface) error

Reload will reload a message from database,

func (*Container) Replace

func (c *Container) Replace(source KernelSource.Interface) error

Replace will update a message context in database.

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

func NewContainer(message *Message) Interface

NewContainer will include a message automatically, the function will fill the information required for Container.

func NewMessagebox

func NewMessagebox() Interface

NewMessagebox ToDo

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

type MoonPass struct {
	ID        uint8
	RNG       io.Reader
	PublicKey []byte
}

func (*MoonPass) CheckReady

func (m *MoonPass) CheckReady() bool

func (*MoonPass) Create

func (m *MoonPass) Create(source KernelSource.Interface) error

func (*MoonPass) Destroy

func (m *MoonPass) Destroy(source KernelSource.Interface) error

func (*MoonPass) Encrypt

func (m *MoonPass) Encrypt(data []byte) []byte

func (*MoonPass) Load

func (m *MoonPass) Load(source KernelSource.Interface, filter ...interface{}) error

func (*MoonPass) Reload

func (m *MoonPass) Reload(source KernelSource.Interface) error

func (*MoonPass) Replace

func (m *MoonPass) Replace(source KernelSource.Interface) error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL