models

package
v0.0.0-...-e510184 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRandomID

func GetRandomID(byteCount int) string

GetRandomID returns a string representing the requested number of random bytes in Base16. Depends on the existence of /dev/urandom which makes it Linux-specific.

Types

type Connection

type Connection struct {
	ID        string
	SessionID string
	Name      string
	Created   int64
	// contains filtered or unexported fields
}

Connection comprises all of the information about a particular member of a Session.

type RolldModel

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

RolldModel encapsulates information about the backing store database.

func NewModel

func NewModel(db *manageddb.ManagedDB) *RolldModel

NewModel create a new RolldModel instance.

func (*RolldModel) GetSession

func (model *RolldModel) GetSession(sessionID string) (*Session, error)

GetSession retrieves Session information from the database.

func (*RolldModel) NewSession

func (model *RolldModel) NewSession(connectionCount int) Session

NewSession adds a new Session to the database.

type Session

type Session struct {
	ID              string
	ConnectionCount int
	Created         int64
	// contains filtered or unexported fields
}

Session comprises all of the information about a particular instance of users together.

func (Session) AddConnection

func (session Session) AddConnection(name string) (*Connection, error)

AddConnection creates and associates a new Connection with a given Session.

func (Session) GetConnection

func (session Session) GetConnection(id string) (*Connection, error)

GetConnection retrieves Connection information from the database.

func (Session) NameTaken

func (session Session) NameTaken(name string) bool

NameTaken returns true if the given name has already been claimed in the given Session. Names must be unique within Sessions.

Jump to

Keyboard shortcuts

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