models

package
v0.0.0-...-287125d Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTableName

func GetTableName(name string) string

Types

type HRTF

type HRTF struct {
	ID        string  `json:"id" bson:"id"`
	Name      string  `json:"name" bson:"name"`
	Age       uint    `json:"age" bson:"age"`
	Azimuth   float64 `json:"azimuth" bson:"azimuth"`
	Elevation float64 `json:"elevation" bson:"elevation"`
	Data      float64 `json:"data" bson:"data"`
}

func GetHRTF

func GetHRTF(id string) (*HRTF, error)

func NewHRTF

func NewHRTF(id string, name string, age uint, azimuth, elevation, data float64) *HRTF

func (*HRTF) Create

func (h *HRTF) Create() error

func (*HRTF) Save

func (h *HRTF) Save() error

func (*HRTF) TableName

func (h *HRTF) TableName() string

type Session

type Session struct {
	SessionID string    `json:"session_id" bson:"session_id"`
	UserName  string    `json:"user_name" bson:"user_name"`
	Time      time.Time `json:"time" bson:"time"`
}

func GetOldSessions

func GetOldSessions(t time.Time) ([]Session, error)

func GetRecentSessions

func GetRecentSessions(t time.Time) ([]Session, error)

func GetSession

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

func NewSession

func NewSession(sessionId, userName string, timeDate time.Time) *Session

func (*Session) Create

func (s *Session) Create() error

func (*Session) Delete

func (s *Session) Delete() error

func (*Session) Save

func (s *Session) Save() error

func (*Session) TableName

func (s *Session) TableName() string

type User

type User struct {
	ID        string `json:"id" bson:"id"`
	UserName  string `json:"user_name" bson:"user_name"`
	Password  string `json:"password" bson:"password"`
	FirstName string `json:"first_name" bson:"first_name"`
	LastName  string `json:"last_name" bson:"last_name"`
	Role      string `json:"role" bson:"role"`
}

func GetUser

func GetUser(id string) (*User, error)

func GetUserByUserName

func GetUserByUserName(un string) (*User, error)

func NewUser

func NewUser(id, username, password, firstname, lastname, role string) *User

func (*User) Create

func (u *User) Create() error

func (*User) Save

func (u *User) Save() error

func (*User) TableName

func (u *User) TableName() string

Jump to

Keyboard shortcuts

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