box

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	sync.RWMutex
	store.User
	// contains filtered or unexported fields
}

func (*Client) GetEmail

func (client *Client) GetEmail() string

func (*Client) GetId

func (client *Client) GetId() int

func (*Client) GetName

func (client *Client) GetName() string

func (*Client) GetPassword

func (client *Client) GetPassword() string

func (*Client) GetXid

func (client *Client) GetXid() string

type Config

type Config struct {
	Addr         string
	ReadTimeout  time.Duration
	WriteTimeout time.Duration
	IdleTimeout  time.Duration
}

type Hub

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

func NewHub

func NewHub(redisOpt *redis.Options, roomStore *store.RoomStore, userStore *store.UserStore) (*Hub, error)

func (*Hub) Run

func (hub *Hub) Run()

type Message

type Message struct {
	Type   string  `json:"type"`
	Action string  `json:"action"`
	Room   *Room   `json:"room"`
	Body   string  `json:"body"`
	Sender *Client `json:"sender"`
}

func (*Message) UnmarshalJSON

func (message *Message) UnmarshalJSON(data []byte) error

type PubSub added in v1.1.1

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

type Realm added in v1.1.1

type Realm string

type Room

type Room struct {
	store.Room

	Private bool `json:"private"`
	// contains filtered or unexported fields
}

func (*Room) GetDescription

func (room *Room) GetDescription() string

func (*Room) GetId

func (room *Room) GetId() int

func (*Room) GetName

func (room *Room) GetName() string

func (*Room) GetOwnerId

func (room *Room) GetOwnerId() string

func (*Room) GetPrivate

func (room *Room) GetPrivate() bool

func (*Room) GetXid

func (room *Room) GetXid() string

func (*Room) Run

func (room *Room) Run()

type Server

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

func NewServer

func NewServer(cfg *Config, redisOpt *redis.Options, roomStore *store.RoomStore, userStore *store.UserStore) *Server

func (*Server) Start

func (s *Server) Start(ctx context.Context)

Jump to

Keyboard shortcuts

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