Documentation ¶
Index ¶
Constants ¶
const (
// MaxPC is the maximum number of characters an account can have.
MaxPC = 4
)
Variables ¶
var ( // ErrInvalidEntityType is raised when an entity doesn't respect the correct type. ErrInvalidEntityType = errors.New("invalid entity type") )
Functions ¶
This section is empty.
Types ¶
type E ¶
type E struct { ID ulid.ID `json:"id"` Type Type `json:"type"` Name string `json:"name"` HP uint64 `json:"hp"` MP uint64 `json:"mp"` Position Position `json:"position"` }
E represents a dynamic entity.
type Mapper ¶
type Mapper interface { SetEntity(E, int64) error GetEntity(Subset) (E, error) DelEntity(Subset) error }
Mapper is an interface for E object.
type PCLeft ¶
type PCLeft int
PCLeft represents the number of character an account can still create.
type PCLeftMapper ¶
type PCLeftMapper interface { SetPCLeft(PCLeft, ulid.ID) error GetPCLeft(PCLeftSubset) (PCLeft, error) }
PCLeftMapper interfaces creation/retrieval of PCLeft.
type PCLeftSubset ¶
PCLeftSubset represents a subset of PCLeft per account.
type PCMapper ¶
type PCMapper interface { SetPC(PC, ulid.ID) error GetPC(PCSubset) (PC, error) ListPC(PCSubset) ([]PC, error) }
PCMapper is an interface to create a new PC.
type Permission ¶
Permission represents a links between 2 objects (token/identities/etc.).
type PermissionMapper ¶
type PermissionMapper interface { SetPermission(Permission) error GetPermission(PermissionSubset) (Permission, error) ListPermission(PermissionSubset) ([]Permission, error) DelPermission(PermissionSubset) error }
PermissionMapper defines Permission operations.
type PermissionSubset ¶
PermissionSubset is the subset to retrieve a Permission.
type Template ¶
type Template E
Template alias an entity. It represents semi static data. When creating PC/Entities, those templates are used.
type TemplateMapper ¶
type TemplateMapper interface { SetEntityTemplate(Template) error GetEntityTemplate(TemplateSubset) (Template, error) ListEntityTemplate() ([]Template, error) }
TemplateMapper is an interface for Template object.
type TemplateSubset ¶
type TemplateSubset struct {
Type Type
}
TemplateSubset is a subset to retrieve one template.