inmemory

package
v0.0.0-...-b6b6a87 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandBus

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

CommandBus is an in-memory implementation of the command.Bus.

func NewCommandBus

func NewCommandBus() *CommandBus

NewCommandBus initializes a new instance of CommandBus.

func (*CommandBus) Close

func (b *CommandBus) Close() error

Close is a no-op in im-memory implementation

func (*CommandBus) Dispatch

func (b *CommandBus) Dispatch(ctx context.Context, cmd command.Command) error

Dispatch implements the command.Bus interface.

func (*CommandBus) Register

func (b *CommandBus) Register(cmdType command.Type, handler command.Handler)

Register implements the command.Bus interface.

type EventBus

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

EventBus is an in-memory implementation of the event.Bus.

func NewEventBus

func NewEventBus() *EventBus

NewEventBus initializes a new EventBus.

func (*EventBus) Close

func (b *EventBus) Close() error

func (*EventBus) Publish

func (b *EventBus) Publish(ctx context.Context, events []event.Event) error

Publish implements the event.Bus interface.

func (*EventBus) Subscribe

func (b *EventBus) Subscribe(evtType event.Type, handler event.Handler)

Subscribe implements the event.Bus interface.

type LockUser

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

type Repository

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

func NewLockedUserRepository

func NewLockedUserRepository() *Repository

func (*Repository) GetCurrentLock

func (repo *Repository) GetCurrentLock(guildID string) (string, chan bool)

func (*Repository) ReleaseUserLock

func (repo *Repository) ReleaseUserLock(guildID string)

func (*Repository) SetLock

func (repo *Repository) SetLock(guildID string, userID string)

Jump to

Keyboard shortcuts

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