app

package
v0.2.23 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Authorization *auth.Service
	Command       Command
	Query         Query
}

type Command

type Command struct {
	AddEndpoint         CommandHandler[command.AddEndpoint]
	CallWebhookEndpoint CommandHandler[command.CallWebhookEndpoint]
	SendMessage         CommandHandler[command.SendMessage]

	// Applications
	CreateApplication CommandHandler[command.CreateApplication]

	// IAM
	SignUp CommandHandler[command.Signup]
	SignIn CommandHandlerWithResult[command.SignIn, *iam.Member]

	// Event types
	CreateEventType CommandHandler[command.CreateEventType]

	// Api keys
	CreateApiKey  CommandHandlerWithResult[command.CreateApiKey, *domain.ApiKey]
	DestroyApiKey CommandHandler[command.DestroyApiKey]
}

type CommandHandler

type CommandHandler[C any] interface {
	Execute(ctx context.Context, cmd C) error
}

type CommandHandlerWithResult

type CommandHandlerWithResult[C, R any] interface {
	Execute(ctx context.Context, cmd C) (result R, err error)
}

CommandHandlerWithResult To be used in rare occasions.

type Query

type Query struct {
	AllApiKeys      QueryHandler[query.AllApiKeys, []*domain.ApiKey]
	AllEnvironments QueryHandler[query.AllEnvironments, []*domain.Environment]
}

type QueryHandler

type QueryHandler[Q, R any] interface {
	Execute(ctx context.Context, q Q) (R, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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