service

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2022 License: MIT Imports: 8 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(client TWHelpClient) *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, client TWHelpClient, logger *zap.Logger, maxGroupsPerServer int) *Group

func (*Group) CleanUp added in v0.1.3

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

func (*Group) Create

func (g *Group) Create(ctx context.Context, params domain.CreateGroupParams) (domain.Group, error)

func (*Group) Delete

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

func (*Group) Get

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

func (*Group) List

func (g *Group) List(ctx context.Context, params domain.ListGroupsParams) ([]domain.Group, error)

func (*Group) SetBarbarians

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

func (*Group) SetChannelGains

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

func (*Group) SetChannelLosses

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

func (*Group) SetInternals

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

type GroupReader

type GroupReader interface {
	Get(ctx context.Context, id, serverID string) (domain.Group, error)
	List(ctx context.Context, params domain.ListGroupsParams) ([]domain.Group, error)
}

type GroupRepository

type GroupRepository interface {
	Create(ctx context.Context, params domain.CreateGroupParams) (domain.Group, error)
	Update(ctx context.Context, id, serverID string, params domain.UpdateGroupParams) (domain.Group, error)
	List(ctx context.Context, params domain.ListGroupsParams) ([]domain.Group, error)
	Get(ctx context.Context, id, serverID string) (domain.Group, error)
	Delete(ctx context.Context, id, serverID string) error
	DeleteMany(ctx context.Context, id ...string) error
}

type Monitor

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

func NewMonitor

func NewMonitor(
	repo MonitorRepository,
	groupSvc GroupReader,
	client TWHelpClient,
	logger *zap.Logger,
	maxMonitorsPerGroup int,
) *Monitor

func (*Monitor) Create

func (m *Monitor) Create(ctx context.Context, groupID, serverID, tribeTag string) (domain.Monitor, error)

func (*Monitor) Delete

func (m *Monitor) Delete(ctx context.Context, id, serverID string) error

func (*Monitor) Execute

func (*Monitor) List

func (m *Monitor) List(ctx context.Context, groupID, serverID string) ([]domain.MonitorWithTribe, error)

type MonitorRepository

type MonitorRepository interface {
	Create(ctx context.Context, params domain.CreateMonitorParams) (domain.Monitor, error)
	List(ctx context.Context, groupID string) ([]domain.Monitor, error)
	Get(ctx context.Context, id string) (domain.Monitor, error)
	Delete(ctx context.Context, id string) error
}

type TWHelpClient

type TWHelpClient interface {
	ListVersions(ctx context.Context) ([]twhelp.Version, error)
	ListServers(
		ctx context.Context,
		version string,
		params twhelp.ListServersQueryParams,
	) ([]twhelp.Server, error)
	GetServer(ctx context.Context, version, server string) (twhelp.Server, error)
	GetTribeByID(ctx context.Context, version, server string, id int64) (twhelp.Tribe, error)
	GetTribeByTag(ctx context.Context, version, server, tag string) (twhelp.Tribe, error)
	ListEnnoblements(
		ctx context.Context,
		version, server string,
		queryParams twhelp.ListEnnoblementsQueryParams,
	) ([]twhelp.Ennoblement, error)
}

Jump to

Keyboard shortcuts

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