service

package
v0.0.0-...-881765e Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 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 CharacterSheetsService

type CharacterSheetsService interface {
	GetCharacterSheets() ([]*e.CharacterSheet, error)
	GetCharacterSheetByID(id string) (*e.CharacterSheet, error)
	CreateCharacterSheet(characterSheet *e.CharacterSheet) (*e.CharacterSheet, error)
	DeleteCharacterSheetByID(id string) error

	UpdateCharacterSheetByID(id string, characterSheet *e.CharacterSheet) error
}

CharacterSheetsService delives logical functions on top of the charactersheets Repo

func NewCharacterSheetsService

func NewCharacterSheetsService(characterSheetsRepo r.CharacterSheetsRepository) CharacterSheetsService

NewCharacterSheetsService creates a nwe item service

type CreatePartyDTO

type CreatePartyDTO struct {
	Name       string   `json:"name,omitempty"`
	Characters []string `json:"characters,omitempty"`
}

CreatePartyDTO data

type Facade

type Facade interface {
	CharacterSheetsService() CharacterSheetsService
	PartiesService() PartiesService
	UsersService() UsersService
	RoomsService() RoomsService
}

Facade ...

func NewFacade

func NewFacade(db *db.Client) Facade

NewFacade creates a new service facade

type PartiesService

type PartiesService interface {
	GetPartyByID(id string) (*e.Party, error)
	GetParties() ([]*e.Party, error)
	CreateParty(createParty *CreatePartyDTO) (*e.Party, error)
	UpdateParty(id string, party *entities.Party) error
	DeletePartyByID(id string) error

	AddCharacterToParty(party *e.Party, character *e.Character) error
}

PartiesService delives logical functions on top of the charactersheets Repo

func NewPartiesService

func NewPartiesService(partiesrepo r.PartiesRepository) PartiesService

NewPartiesService creates a nwe item service

type RoomsService

type RoomsService interface {
	r.RoomsRepository
}

RoomsService delives logical functions on top of the rooms Repo

func NewRoomsService

func NewRoomsService(roomsRepository r.RoomsRepository) RoomsService

NewRoomsService creates a new rooms service

type UsersService

type UsersService interface {
	r.UsersRepository

	FindOrCreateNewUser(id string) (*e.User, error)
}

UsersService delives logical functions on top of the users Repo

func NewUsersService

func NewUsersService(usersRepository r.UsersRepository) UsersService

NewUsersService creates a new users service

Jump to

Keyboard shortcuts

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