model

package
v0.0.0-...-3478735 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PasswordHash

func PasswordHash(password string) []byte

func VerifyPasswordHash

func VerifyPasswordHash(hash []byte, password string) bool

Types

type Channel

type Channel struct {
	Id             Id
	RevisionNumber int

	CreatorUserId Id
	CreationTime  time.Time
	Name          string
}

type Id

type Id []byte

Id represents a node id. Ids are cryptographically secure random byte strings long enough for us to generate them without having worry about collisions with pre-existing ids.

func GenerateId

func GenerateId() Id

GenerateId generates a new Id.

func (Id) Before

func (id Id) Before(other Id) bool

func (Id) MarshalBinary

func (id Id) MarshalBinary() ([]byte, error)

type Message

type Message struct {
	Id             Id
	RevisionNumber int

	UserId    Id
	ChannelId Id
	Time      time.Time
	Body      string
}

type User

type User struct {
	Id             Id
	RevisionNumber int

	Handle       string
	PasswordHash []byte
}

Jump to

Keyboard shortcuts

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