vdrive

package
v0.0.0-...-531763a Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitVDrive

func InitVDrive()

Types

type Event

type Event struct {
	Kind  EventKind `json:"kind"`
	Value string    `json:"value"`
}

type EventKind

type EventKind string
const (
	EventKindJoin  EventKind = "join"
	EventKindLeave EventKind = "leave"
	EventKindKey   EventKind = "key"
)

type HostParams

type HostParams struct {
	RoomName string            `json:"room_name"`
	Binds    map[string]string `json:"binds"`
}

type JoinParams

type JoinParams struct {
	RoomName string `json:"room_name"`
	Name     string `json:"name"`
}

type Room

type Room struct {
	Events   chan Event
	Keybinds map[string]string
}

type VDrive

type VDrive struct {
	Rooms map[string]*Room
	Lock  *sync.Mutex
}

func (*VDrive) Handlers

func (r *VDrive) Handlers()

func (*VDrive) Host

func (r *VDrive) Host(w http.ResponseWriter, req *http.Request)

func (*VDrive) Join

func (r *VDrive) Join(w http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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