encounter

package
v0.0.0-...-10f3eee Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	ID        string    `json:"id"`
	StartDate time.Time `json:"start_date"`
	EndDate   time.Time `json:"end_date"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	Status    Status    `json:"status"`
	PlayerID  string    `json:"player_id"`
	MonsterID string    `json:"monster_id"`
	RoomID    string    `json:"room_id"`
}

type Redis

type Redis struct {
	// contains filtered or unexported fields
}

func NewRedis

func NewRedis(cfg *RedisConfig) (*Redis, error)

func (*Redis) Create

func (r *Redis) Create(ctx context.Context, encounter *entities.Encounter) (*entities.Encounter, error)

func (*Redis) Get

func (r *Redis) Get(ctx context.Context, id string) (*entities.Encounter, error)

func (*Redis) Update

func (r *Redis) Update(ctx context.Context, encounter *entities.Encounter) (*entities.Encounter, error)

type RedisConfig

type RedisConfig struct {
	Client redis.UniversalClient
}

type Repository

type Repository interface {
	Create(ctx context.Context, encounter *entities.Encounter) (*entities.Encounter, error)
	Update(ctx context.Context, encounter *entities.Encounter) (*entities.Encounter, error)
	Get(ctx context.Context, id string) (*entities.Encounter, error)
}

type Status

type Status string
const (
	StatusUnset    Status = ""
	StatusActive   Status = "active"
	StatusInactive Status = "inactive"
)

Jump to

Keyboard shortcuts

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