server

package
v1.0.1-beta Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection struct {
	// contains filtered or unexported fields
}

func NewCollection

func NewCollection() *Collection

NewCollection creates and initialize an instance of Collection.

func (*Collection) All

func (collection *Collection) All() ([]Message, error)

All retreives all the items in MyCollecttion and returns them in a slice.

func (*Collection) Create

func (collection *Collection) Create(msg Message) (Message, error)

Create adds the given item to the collection and returns it AFTER having set its id.

func (*Collection) Delete

func (_ *Collection) Delete(_ MessageID) error

Delete deletes the given item from the collection.

func (*Collection) Item

func (collection *Collection) Item(ID MessageID) (Message, error)

Item retreives the item with the given ID from Collection and returns it.

func (*Collection) Update

func (collection *Collection) Update(msg Message) error

Update updates the given item in the collection.

type Message

type Message struct {
	Id   MessageID         `json:"id,omitempty"`
	Info tekken.PlayerInfo `json:"info,omitempty"`
}

func (Message) ID

func (msg Message) ID() MessageID

type MessageID

type MessageID string

type Socket

type Socket struct {
	*livegollection.LiveGollection[MessageID, Message]
	Addr string
	Port int
}

func NewSocket

func NewSocket(addr string) *Socket

Jump to

Keyboard shortcuts

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