room

package
v0.0.0-...-6823467 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateDTO

type CreateDTO struct {
	Name string `json:"name"`
}

CreateDTO -

type DTO

type DTO struct {
	ID        uuid.UUID `json:"id,string,omitempty"`
	Name      string    `json:"name"`
	Status    string    `json:"status"`
	TeamID    string    `json:"team_id"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

DTO -

func ToRoomDTO

func ToRoomDTO(room Room) DTO

ToRoomDTO -

func ToRoomDTOs

func ToRoomDTOs(rooms []Room) []DTO

ToRoomDTOs -

type Repository

type Repository struct {
	DbConn *sqlx.DB
}

Repository -

func NewRoomRepository

func NewRoomRepository(dbConn *sqlx.DB) Repository

NewRoomRepository -

func (*Repository) Create

func (r *Repository) Create(ctx context.Context, room Room) (Room, error)

Create -

func (*Repository) Delete

func (r *Repository) Delete(ctx context.Context, ID uuid.UUID) error

Delete -

func (*Repository) FindAll

func (r *Repository) FindAll(ctx context.Context) ([]Room, error)

FindAll -

func (*Repository) FindByID

func (r *Repository) FindByID(ctx context.Context, ID uuid.UUID) (Room, error)

FindByID -

func (*Repository) Update

func (r *Repository) Update(ctx context.Context, ID uuid.UUID, room Room) (Room, error)

Update -

type Room

type Room struct {
	ID        uuid.UUID `db:"id"`
	Name      string    `db:"name"`
	Status    string    `db:"status"`
	TeamID    string    `db:"team_id"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

Room -

func ToRoom

func ToRoom(roomDTO DTO) Room

ToRoom -

type UpdateDTO

type UpdateDTO struct {
	Name string `json:"name"`
}

UpdateDTO -

type UseCase

type UseCase struct {
	RoomRepository Repository
}

UseCase -

func NewRoomUseCase

func NewRoomUseCase(roomRepository Repository) UseCase

NewRoomUseCase -

func (*UseCase) Create

func (u *UseCase) Create(ctx context.Context, room Room) (Room, error)

Create -

func (*UseCase) Delete

func (u *UseCase) Delete(ctx context.Context, ID uuid.UUID) error

Delete -

func (*UseCase) FindAll

func (u *UseCase) FindAll(ctx context.Context) ([]Room, error)

FindAll -

func (*UseCase) FindByID

func (u *UseCase) FindByID(ctx context.Context, ID uuid.UUID) (Room, error)

FindByID -

func (*UseCase) Update

func (u *UseCase) Update(ctx context.Context, ID uuid.UUID, room Room) (Room, error)

Update -

Jump to

Keyboard shortcuts

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