storage

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2018 License: MIT Imports: 6 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadSetting = errors.New("bad setting")

ErrBadSetting TODOC

View Source
var ErrCharacterNotExist = errors.New("character does not exist")

ErrCharacterNotExist TODOC

View Source
var ErrGuildNotExist = errors.New("guild does not exist")

ErrGuildNotExist TODOC

View Source
var ErrItemNotExist = errors.New("item does not exist")

ErrItemNotExist TODOC

View Source
var ErrSkillNotExist = errors.New("skill does not exist")

ErrSkillNotExist TODOC

View Source
var ErrUserNotExist = errors.New("user does not exist")

ErrUserNotExist TODOC

Functions

This section is empty.

Types

type Character

type Character interface {
	GetName() string
	GetNeededSkill(name string) (Skill, error)
	GetNeededSkills() []Skill
	GetNeededItem(name string) (Item, error)
	GetNeededItems() []Item

	SetName(name string)
	IncrNeededSkill(name string, amt uint64)
	DecrNeededSkill(name string, amt uint64)
	IncrNeededItem(name string, amt uint64)
	DecrNeededItem(name string, amt uint64)
}

Character TODOC

type Guild

type Guild interface {
	GetName() string
	GetSettings() GuildSettings

	SetName(name string)
	SetSettings(s GuildSettings)

	Serialize() ([]byte, error)
}

Guild TODOC

type GuildAPI

type GuildAPI interface {
	NewTransaction(writable bool) (GuildAPITx, error)
}

GuildAPI TODOC

func NewBoltGuildAPI

func NewBoltGuildAPI(db *bolt.DB) (GuildAPI, error)

NewBoltGuildAPI constructs a boltDB-backed GuildAPI

type GuildAPITx

type GuildAPITx interface {
	Commit() error
	Rollback() error

	GetGuild(name string) (Guild, error)
	AddGuild(name string) (Guild, error)
	SaveGuild(guild Guild) error
}

GuildAPITx TODOC

type GuildSettings

type GuildSettings struct {
	ControlSequence string
}

GuildSettings TODOC

func (*GuildSettings) GetSettingString

func (s *GuildSettings) GetSettingString(name string) (string, error)

GetSettingString TODOC

func (*GuildSettings) PrettyString

func (s *GuildSettings) PrettyString() string

PrettyString TODOC

func (*GuildSettings) SetSettingString

func (s *GuildSettings) SetSettingString(name, val string) error

SetSettingString TODOC

type Item

type Item interface {
	Name() string
	Count() uint64
}

Item TODOC

type Skill

type Skill interface {
	Name() string
	Points() uint64
}

Skill TODOC

type User

type User interface {
	GetName() string
	GetCharacter(name string) (Character, error)
	GetCharacters() []Character

	SetName(name string)
	AddCharacter(name string) Character
	DeleteCharacter(name string)

	Serialize() ([]byte, error)
}

User TODOC

type UserAPI

type UserAPI interface {
	NewTransaction(writable bool) (UserAPITx, error)
}

UserAPI TODOC

func NewBoltUserAPI

func NewBoltUserAPI(db *bolt.DB) (UserAPI, error)

NewBoltUserAPI constructs a boltDB-backed UserAPI

type UserAPITx

type UserAPITx interface {
	Commit() error
	Rollback() error

	GetUser(name string) (User, error)
	GetUsers() []User

	AddUser(name string) (User, error)
	SaveUser(user User) error
}

UserAPITx TODOC

Jump to

Keyboard shortcuts

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