reading

package
v0.0.0-...-cea2a50 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 0 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 {
	Nick    UserId `json:"nick"`
	Payload string `json:"payload"`
	ID      int    `json:"id"`
}

type Repository

type Repository interface {
	ReadUsers() ([]User, error)
	ReadUser(UserId) (User, error)
	ReadRooms() ([]Room, error)
	ReadRoom(string) (Room, error)
}

type Room

type Room struct {
	Messages map[UserId][]Message `json:"messages"`
	Name     string               `json:"name"`
}

type Service

type Service interface {
	ReadUsers() ([]User, error)
	ReadUser(UserId) (User, error)
	ReadRooms() ([]Room, error)
	ReadRoom(string) (Room, error)
}

func NewService

func NewService(r Repository) Service

type User

type User struct {
	Nick       UserId `json:"nick"`
	Email      string `json:"email"`
	Name       string `json:"name"`
	SecondName string `json:"second_name"`
}

type UserId

type UserId string

Jump to

Keyboard shortcuts

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