fs

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Path string `koanf:"path"`
}

Config represents the file store config structure.

type File

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

File represents the file implementation of the Store interface.

func New

func New(cfg Config, log *log.Logger) (*File, error)

New returns a new Redis store.

func (*File) AddRoom

func (m *File) AddRoom(r store.Room, ttl time.Duration) error

AddRoom adds a room to the store.

func (*File) AddSession

func (m *File) AddSession(sessID, handle, roomID string, ttl time.Duration) error

AddSession adds a sessionID room to the store.

func (*File) ClearSessions

func (m *File) ClearSessions(roomID string) error

ClearSessions deletes all the sessions in a room.

func (*File) ExtendRoomTTL

func (m *File) ExtendRoomTTL(id string, ttl time.Duration) error

ExtendRoomTTL extends a room's TTL.

func (*File) Get

func (m *File) Get(key string) ([]byte, error)

Get value from a key.

func (*File) GetRoom

func (m *File) GetRoom(id string) (store.Room, error)

GetRoom gets a room from the store.

func (*File) GetSession

func (m *File) GetSession(sessID, roomID string) (store.Sess, error)

GetSession retrieves a peer session from the store.

func (*File) RemoveRoom

func (m *File) RemoveRoom(id string) error

RemoveRoom deletes a room from the store.

func (*File) RemoveSession

func (m *File) RemoveSession(sessID, roomID string) error

RemoveSession deletes a session ID from a room.

func (*File) RoomExists

func (m *File) RoomExists(id string) (bool, error)

RoomExists checks if a room exists in the store.

func (*File) Set

func (m *File) Set(key string, data []byte) error

Set a value.

Jump to

Keyboard shortcuts

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