msg

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2022 License: MIT Imports: 9 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,
	snapshotSvc PlayerSnapshotService,
) *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 PlayerSnapshotService added in v0.3.0

type PlayerSnapshotService interface {
	Create(ctx context.Context, key string, date time.Time) 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
	UpdatePlayerSnapshotsCreatedAt(ctx context.Context, key string) error
	UpdateTribeSnapshotsCreatedAt(ctx context.Context, key string) error
}

type SnapshotPublisher added in v0.3.0

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

func NewSnapshotPublisher added in v0.3.0

func NewSnapshotPublisher(publisher message.Publisher, marshaler CommandEventMarshaler) *SnapshotPublisher

func (*SnapshotPublisher) CmdCreatePlayers added in v0.3.0

func (s *SnapshotPublisher) CmdCreatePlayers(ctx context.Context, payloads ...domain.CreateSnapshotsCmdPayload) error

func (*SnapshotPublisher) CmdCreateTribes added in v0.3.0

func (s *SnapshotPublisher) CmdCreateTribes(ctx context.Context, payloads ...domain.CreateSnapshotsCmdPayload) 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,
	snapshotSvc TribeSnapshotService,
) *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 TribeSnapshotService added in v0.3.0

type TribeSnapshotService interface {
	Create(ctx context.Context, key string, date time.Time) 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