package module
v0.0.2 Latest Latest

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

Go to latest
Published: Oct 27, 2021 License: MIT Imports: 1 Imported by: 4






This section is empty.


View Source
var (
	EVENT     = "event"
	REQUEST   = "request"
	HANDSHAKE = "handshake"
	AUTH      = "auth"
	TOWNNAME  = "townland"
	ROOM      = "mayor"
	FROM      = Building{
		Home: &TOWNNAME,
		Room: &ROOM,
View Source
var Default defaults = defaults{
	BadMessage: Speak{
		Type:  &EVENT,
		From:  &FROM,
		Event: "bad-message",
	BadToken: Speak{
		Type:  &EVENT,
		From:  &FROM,
		Event: "bad-token",
	Authed: Speak{
		Type:  &EVENT,
		From:  &FROM,
		Event: "authed",
	ReAuth: Speak{
		Type:  &EVENT,
		From:  &FROM,
		Event: "reauth",
	UnAuth: Speak{
		Type:  &EVENT,
		From:  &FROM,
		Event: "unauth",
	Handshaked: Speak{
		Type:  &EVENT,
		From:  &FROM,
		Event: "handshaked",
	NotHandshaked: Speak{
		Type:  &EVENT,
		From:  &FROM,
		Event: "not-handshaked",


This section is empty.


type Building

type Building struct {
	Home *string `json:"home"`
	Room *string `json:"room"`

func (*Building) GetUUID

func (building *Building) GetUUID() *string

type Speak

type Speak struct {
	CUID  *string   `json:"cuid,omitempty"`  // civilian unique id
	Type  *string   `json:"type"`            // "event", "request", "auth", "handshake"
	At    int64     `json:"at,omitempty"`    // send timestamp
	Event string    `json:"event,omitempty"` // event name in Type "event" and "request"
	From  *Building `json:"from,omitempty"`  // from who
	To    *Building `json:"to,omitempty"`    // to who
	Guest *bool     `json:"guest,omitempty"` // is temp user
	Data  string    `json:"data,omitempty"`  // sended data

func (*Speak) Reverse

func (speak *Speak) Reverse() *Speak

reverse listener and speaker

func (*Speak) SetAtNow

func (speak *Speak) SetAtNow() *Speak

set said unix time

func (*Speak) SetCUID

func (lanauage *Speak) SetCUID(Cuid *string) *Speak

change civilian unique id

func (*Speak) SetEvent

func (lanauage *Speak) SetEvent(name string) *Speak

set event name

func (*Speak) SetFrom

func (speak *Speak) SetFrom(building *Building) *Speak

set home and room of who saying

func (*Speak) SetGuest

func (speak *Speak) SetGuest(value bool) *Speak

set civilian is guest and temporary

func (*Speak) SetTo

func (speak *Speak) SetTo(building *Building) *Speak

set home and room of who listen what i am saying

Jump to

Keyboard shortcuts

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