service

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Choice

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

func NewChoice

func NewChoice(twhelpSvc TWHelpService) *Choice

func (*Choice) Versions

func (c *Choice) Versions(ctx context.Context) ([]domain.Choice, error)

type Group

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

func NewGroup

func NewGroup(repo GroupRepository, twhelpSvc TWHelpService, logger *zap.Logger, maxGroupsPerServer, maxMonitorsPerGroup int) *Group

func (*Group) AddTribe added in v0.4.0

func (g *Group) AddTribe(ctx context.Context, id, serverID, tribeTag string) (domain.GroupWithMonitors, error)

func (*Group) CleanUp added in v0.1.3

func (g *Group) CleanUp(ctx context.Context) error

func (*Group) Create

func (*Group) Delete

func (g *Group) Delete(ctx context.Context, id, serverID string) error

func (*Group) Execute added in v0.4.0

func (*Group) Get

func (g *Group) Get(ctx context.Context, id, serverID string) (domain.GroupWithMonitors, error)

func (*Group) GetWithTribes added in v0.4.0

func (g *Group) GetWithTribes(ctx context.Context, id, serverID string) (domain.GroupWithMonitorsAndTribes, error)

func (*Group) ListServer added in v0.4.0

func (g *Group) ListServer(ctx context.Context, serverID string) ([]domain.GroupWithMonitors, error)

func (*Group) RemoveTribe added in v0.4.0

func (g *Group) RemoveTribe(ctx context.Context, id, serverID, tribeTag string) (domain.GroupWithMonitors, error)

func (*Group) SetBarbarians

func (g *Group) SetBarbarians(ctx context.Context, id, serverID string, barbarians bool) (domain.GroupWithMonitors, error)

func (*Group) SetChannelGains

func (g *Group) SetChannelGains(ctx context.Context, id, serverID, channel string) (domain.GroupWithMonitors, error)

func (*Group) SetChannelLosses

func (g *Group) SetChannelLosses(ctx context.Context, id, serverID, channel string) (domain.GroupWithMonitors, error)

func (*Group) SetInternals

func (g *Group) SetInternals(ctx context.Context, id, serverID string, internals bool) (domain.GroupWithMonitors, error)

func (*Group) SetLanguageTag added in v0.4.0

func (g *Group) SetLanguageTag(ctx context.Context, id, serverID, languageTag string) (domain.GroupWithMonitors, error)

type GroupRepository

type GroupRepository interface {
	Create(ctx context.Context, params domain.CreateGroupParams) (domain.GroupWithMonitors, error)
	Update(ctx context.Context, id string, params domain.UpdateGroupParams) (domain.GroupWithMonitors, error)
	AddMonitor(ctx context.Context, id string, tribeID int64) (domain.GroupWithMonitors, error)
	DeleteMonitors(ctx context.Context, id string, monitorID ...string) (domain.GroupWithMonitors, error)
	List(ctx context.Context, params domain.ListGroupsParams) ([]domain.GroupWithMonitors, error)
	Get(ctx context.Context, id string) (domain.GroupWithMonitors, error)
	Delete(ctx context.Context, id string) error
	DeleteMany(ctx context.Context, id ...string) error
}

type TWHelpService added in v0.4.1

type TWHelpService interface {
	ListVersions(ctx context.Context) ([]domain.TWVersion, error)
	ListOpenServers(ctx context.Context, version string, offset, limit int32) ([]domain.TWServer, error)
	ListClosedServers(ctx context.Context, version string, offset, limit int32) ([]domain.TWServer, error)
	GetOpenServer(ctx context.Context, versionCode, serverKey string) (domain.TWServer, error)
	GetServer(ctx context.Context, versionCode, serverKey string) (domain.TWServer, error)
	GetTribeByID(ctx context.Context, versionCode, serverKey string, id int64) (domain.Tribe, error)
	GetExistingTribeByTag(ctx context.Context, versionCode, serverKey, tribeTag string) (domain.Tribe, error)
	ListTribesByTag(ctx context.Context, versionCode, serverKey string, tribeTags []string, offset, limit int32) ([]domain.Tribe, error)
	ListVillagesByCoords(ctx context.Context, versionCode, serverKey string, coords []string, offset, limit int32) ([]domain.Village, error)
	ListEnnoblementsSince(ctx context.Context, versionCode, serverKey string, since time.Time, offset, limit int32) ([]domain.Ennoblement, error)
}

type Village added in v0.4.1

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

func NewVillage added in v0.4.1

func NewVillage(repo VillageRepository, twhelpSvc TWHelpService) *Village

func (*Village) TranslateCoords added in v0.4.1

func (*Village) TranslateCoordsFromHash added in v0.4.1

func (v *Village) TranslateCoordsFromHash(ctx context.Context, paramsSHA256Hash string, page int32) (domain.TranslateVillageCoordsResult, error)

type VillageRepository added in v0.4.1

type VillageRepository interface {
	SaveTranslateCoordsParams(ctx context.Context, params domain.TranslateVillageCoordsParams) error
	GetTranslateCoordsParams(ctx context.Context, sha256Hash string) (domain.TranslateVillageCoordsParams, error)
}

Jump to

Keyboard shortcuts

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