chat

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: Apache-2.0, BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PayloadName defines the name of the chat payload.
	PayloadName = "chat"
)

Variables

View Source
var Type = payload.NewType(payloadType, PayloadName)

Type represents the identifier which addresses the chat payload type.

Functions

This section is empty.

Types

type BlockReceivedEvent

type BlockReceivedEvent struct {
	From      string
	To        string
	Block     string
	Timestamp time.Time
	BlockID   string
}

BlockReceivedEvent defines the information passed when a chat event fires.

type Chat

type Chat struct {
	*Events
}

Chat manages chats happening over the Tangle.

func NewChat

func NewChat() *Chat

NewChat creates a new Chat.

type Events

type Events struct {
	BlockReceived *event.Event[*BlockReceivedEvent]
}

Events define events occurring within a Chat.

type Payload

type Payload struct {
	model.Immutable[Payload, *Payload, payloadModel] `serix:"0"`
}

Payload represents the chat payload type.

func NewPayload

func NewPayload(from, to, block string) *Payload

NewPayload creates a new chat payload.

func (*Payload) Block

func (p *Payload) Block() string

Block returns the block contents.

func (*Payload) From

func (p *Payload) From() string

From returns an author of the block.

func (*Payload) To

func (p *Payload) To() string

To returns a recipient of the block.

func (*Payload) Type

func (p *Payload) Type() payload.Type

Type returns the type of the Payload.

Jump to

Keyboard shortcuts

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