service

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CharactersService

type CharactersService interface {
	r.CharactersRepository

	IsCharacterNameTaken(name string) bool
	GetCharacterTemplates() []characters.CharacterTemplate

	CreateNewCharacter(dto *dto.CreateCharacterDTO) (*characters.Character, error)
}

CharactersService delives logical functions on top of the charactersheets Repo

func NewCharactersService

func NewCharactersService(charactersRepo r.CharactersRepository) CharactersService

NewCharactersService 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 {
	CharactersService() CharactersService
	PartiesService() PartiesService
	UsersService() UsersService
	RoomsService() RoomsService
	ScriptsService() ScriptsService
	ItemsService() ItemsService

	Runner() scripts.ScriptRunner
}

Facade ...

func NewFacade

func NewFacade(db *db.Client, runner scripts.ScriptRunner) Facade

NewFacade creates a new service facade

type ItemsService

type ItemsService interface {
	Items() r.ItemsRepository
	ItemTemplates() r.ItemTemplatesRepository

	CreateItemFromTemplate(templateID string) (*items.Item, error)

	ItemSlots() items.ItemSlots
	ItemQualities() items.ItemQualities
	ItemTypes() items.ItemTypes
	ItemSubTypes() items.ItemSubTypes
}

ItemsService delives logical functions on top of the charactersheets Repo

func NewItemsService

func NewItemsService(itemsRepo r.ItemsRepository, itemsTemplateRepo r.ItemTemplatesRepository, scriptService ScriptsService, runner scripts.ScriptRunner) ItemsService

NewItemsService creates a nwe item service

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 *characters.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 RoomValueHelpEntry

type RoomValueHelpEntry struct {
	ID   string `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
}

RoomValueHelpEntry ...

type RoomsService

type RoomsService interface {
	r.RoomsRepository

	ValueHelp() ([]RoomValueHelpEntry, error)
}

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 ScriptsService

type ScriptsService interface {
	r.ScriptsRepository

	ScriptTypes() scripts.ScriptTypes
}

ScriptsService delives logical functions on top of the charactersheets Repo

func NewScriptsService

func NewScriptsService(repo r.ScriptsRepository) ScriptsService

NewScriptsService creates a nwe item service

type UsersService

type UsersService interface {
	r.UsersRepository

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

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