models

package
v0.0.0-...-6c5ee20 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 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 Message

type Message struct {
	Id        int
	UserId    string
	Text      string
	CreatedAt string
}

func NewMessageModel

func NewMessageModel() *Message

func (*Message) CreateMessage

func (m *Message) CreateMessage(message Message) (Message, error)

func (*Message) GetMessagesFromTime

func (m *Message) GetMessagesFromTime(time string) []Message

type MessageInterface

type MessageInterface interface {
	CreateMessage(message Message) (Message, error)
	GetMessagesFromTime(time string) []Message
}

type Token

type Token struct {
	Id        string
	UserId    string
	ExpiresAt string
}

func NewTokenModel

func NewTokenModel() *Token

func (*Token) CreateToken

func (t *Token) CreateToken(token Token) (Token, error)

func (*Token) GetTokenById

func (t *Token) GetTokenById(id string) (Token, error)

type TokenInterface

type TokenInterface interface {
	CreateToken(token Token) (Token, error)
	GetTokenById(id string) (Token, error)
}

type User

type User struct {
	Id             string
	Name           string
	Password       string
	LastSessionEnd string
	Connection     *websocket.Conn
}

func NewUserModel

func NewUserModel() *User

func (*User) CreateUser

func (u *User) CreateUser(user User) (User, error)

func (*User) GetUserByField

func (u *User) GetUserByField(field string, value string) (User, error)

func (*User) UpdateUser

func (u *User) UpdateUser(user User) (User, error)

type UserInterface

type UserInterface interface {
	CreateUser(user User) (User, error)
	GetUserByField(field string, value string) (User, error)
	UpdateUser(user User) (User, error)
}

Jump to

Keyboard shortcuts

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