db

package
v0.0.0-...-7fb72bf Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionOptions

type ConnectionOptions struct {
	Address string
	HostKey string
}

type DataFriendList

type DataFriendList struct {
	Friends []string `json:"friends"`
}

type DataSession

type DataSession struct {
	Host string `json:"host"`
}

type Db

type Db interface {
	GetFriendList(ctx context.Context, id string) ([]string, error)
	SetFriendList(ctx context.Context, id string, friends []string) error

	GetSessionData(ctx context.Context, ids []string) (map[string]DataSession, error)
	SetSessionData(ctx context.Context, id string, data DataSession) error

	Subscribe(ctx context.Context) (chan PresenceChangedEvent, error)

	SendNotification(ctx context.Context, n PresenceChangedEvent) error
}

func New

func New(opts ConnectionOptions) Db

type PresenceChangedEvent

type PresenceChangedEvent struct {
	PlayerID  string
	NotifyIDs []string
	Online    bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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