language

package module
v0.0.1-a.4-3 Latest Latest
Warning

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

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

README

townland/language

Documentation

Index

Constants

This section is empty.

Variables

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",
	},
}

Functions

This section is empty.

Types

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 {
	PUID  *string   `json:"puid,omitempty"`  // puid who said
	At    int64     `json:"at,omitempty"`    // send timestamp
	Event string    `json:"event,omitempty"` // event name in Type "event" and "request"
	Type  *string   `json:"type,omitempty"`  // "event", "request", "auth", "handshake"
	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

func (*Speak) SetAtNow

func (speak *Speak) SetAtNow() *Speak

func (*Speak) SetEvent

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

func (*Speak) SetFrom

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

func (*Speak) SetGuest

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

func (*Speak) SetPUID

func (lanauage *Speak) SetPUID(puid *string) *Speak

func (*Speak) SetTo

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

Jump to

Keyboard shortcuts

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