msg

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandEventMarshaler

type CommandEventMarshaler interface {
	Marshal(v any) (*message.Message, error)
	Unmarshal(msg *message.Message, v any) error
}

type EnnoblementConsumer

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

func NewEnnoblementConsumer

func NewEnnoblementConsumer(
	marshaler CommandEventMarshaler,
	publisher message.Publisher,
	subscriber message.Subscriber,
	logger watermill.LoggerAdapter,
	svc EnnoblementService,
) *EnnoblementConsumer

func (*EnnoblementConsumer) Register

func (e *EnnoblementConsumer) Register(router *message.Router)

type EnnoblementPublisher

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

func NewEnnoblementPublisher

func NewEnnoblementPublisher(publisher message.Publisher, marshaler CommandEventMarshaler) *EnnoblementPublisher

func (*EnnoblementPublisher) CmdRefresh

type EnnoblementService

type EnnoblementService interface {
	Refresh(ctx context.Context, key, url string) error
}

type GobMarshaler

type GobMarshaler struct{}

func (GobMarshaler) Marshal

func (m GobMarshaler) Marshal(v any) (*message.Message, error)

func (GobMarshaler) Unmarshal

func (m GobMarshaler) Unmarshal(msg *message.Message, v any) error

type PlayerConsumer

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

func NewPlayerConsumer

func NewPlayerConsumer(
	marshaler CommandEventMarshaler,
	publisher message.Publisher,
	subscriber message.Subscriber,
	logger watermill.LoggerAdapter,
	svc PlayerService,
) *PlayerConsumer

func (*PlayerConsumer) Register

func (p *PlayerConsumer) Register(router *message.Router)

type PlayerService

type PlayerService interface {
	Refresh(ctx context.Context, key, url string) (int64, error)
}

type ServerConsumer

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

func NewServerConsumer

func NewServerConsumer(
	marshaler CommandEventMarshaler,
	publisher message.Publisher,
	subscriber message.Subscriber,
	logger watermill.LoggerAdapter,
	svc ServerService,
) *ServerConsumer

func (*ServerConsumer) Register

func (s *ServerConsumer) Register(router *message.Router)

type ServerPublisher

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

func NewServerPublisher

func NewServerPublisher(publisher message.Publisher, marshaler CommandEventMarshaler) *ServerPublisher

func (*ServerPublisher) CmdRefresh

func (s *ServerPublisher) CmdRefresh(ctx context.Context, payloads ...domain.RefreshServersCmdPayload) error

type ServerService

type ServerService interface {
	Refresh(ctx context.Context, host, versionCode string) ([]domain.Server, error)
	UpdateInfoAndConfig(ctx context.Context, key, url string) error
	UpdateNumPlayers(ctx context.Context, key string, numPlayers int64) error
	UpdateNumTribes(ctx context.Context, key string, numTribes int64) error
	UpdateNumVillages(ctx context.Context, key string, numVillages int64) error
}

type TribeConsumer

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

func NewTribeConsumer

func NewTribeConsumer(
	marshaler CommandEventMarshaler,
	publisher message.Publisher,
	subscriber message.Subscriber,
	logger watermill.LoggerAdapter,
	svc TribeService,
) *TribeConsumer

func (*TribeConsumer) Register

func (t *TribeConsumer) Register(router *message.Router)

type TribeService

type TribeService interface {
	Refresh(ctx context.Context, key, url string) (int64, error)
	UpdateDominance(ctx context.Context, serverKey string, numPlayerVillages int64) error
}

type VillageConsumer

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

func NewVillageConsumer

func NewVillageConsumer(
	marshaler CommandEventMarshaler,
	publisher message.Publisher,
	subscriber message.Subscriber,
	logger watermill.LoggerAdapter,
	svc VillageService,
) *VillageConsumer

func (*VillageConsumer) Register

func (v *VillageConsumer) Register(router *message.Router)

type VillageService

type VillageService interface {
	Refresh(ctx context.Context, key, url string) (domain.RefreshVillagesResult, error)
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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