chat

package
v0.0.0-...-7efc56f Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2021 License: MIT Imports: 5 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        string    `firestore:"id"`
	Text      string    `firestore:"text"`
	Image     string    `firestore:"image"`
	UserID    string    `firestore:"userId"`
	Username  string    `firestore:"-"`
	CreatedAt time.Time `firestore:"createdAt"`
}

Message - チャットメッセージ エンティティ

func (*Message) Proto

func (m *Message) Proto() *chat.Message

type Repository

type Repository interface {
	ListRoom(ctx context.Context, p *firestore.Params, qs []*firestore.Query) (Rooms, error)
	GetRoom(ctx context.Context, roomID string) (*Room, error)
	CreateRoom(ctx context.Context, cr *Room) error
	UpdateRoom(ctx context.Context, cr *Room) error
	CreateMessage(ctx context.Context, roomID string, cm *Message) error
}

Repository - Chatレポジトリ

type Room

type Room struct {
	ID            string    `firestore:"id"`
	UserIDs       []string  `firestore:"users"`
	CreatedAt     time.Time `firestore:"createdAt"`
	UpdatedAt     time.Time `firestore:"updatedAt"`
	LatestMessage *Message  `firestore:"latestMessage"`
	InstanceIDs   []string  `firestore:"-"`
}

Room - チャットルーム エンティティ

func (*Room) Proto

func (r *Room) Proto() *chat.Room

type Rooms

type Rooms []*Room

func (Rooms) Proto

func (rs Rooms) Proto() []*chat.Room

type Uploader

type Uploader interface {
	Image(ctx context.Context, roomID string, data []byte) (string, error)
}

Uploader - Chatアップローダ

type Validation

type Validation interface {
	Room(ctx context.Context, cr *Room) error
	Message(ctx context.Context, cm *Message) error
}

Validation - Chatドメインバリデーション

Jump to

Keyboard shortcuts

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