framework

package
v0.0.0-...-94c8c1a Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunTestcaseScenarios

func RunTestcaseScenarios[REQUEST, RESPONSE, OUTPORT any](t *testing.T, f func(o OUTPORT) Inport[REQUEST, RESPONSE], scenarioList ...TestScenario[REQUEST, RESPONSE, OUTPORT])

Types

type ApplicationData

type ApplicationData struct {
	AppName       string `json:"app_name"`
	AppInstanceID string `json:"app_instance_id"`
	StartTime     string `json:"start_time"`
}

func NewApplicationData

func NewApplicationData(appName string) ApplicationData

type BaseController

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

func (*BaseController) AddUsecase

func (r *BaseController) AddUsecase(inports ...any)

func (*BaseController) GetUsecase

func (r *BaseController) GetUsecase(nameStructType any) (any, error)

type ControllerRegisterer

type ControllerRegisterer interface {
	ControllerStarter
	UsecaseRegisterer
	RegisterRouter()
	RegisterMetrics(serviceName string)
}

type ControllerStarter

type ControllerStarter interface {
	Start()
}

type Inport

type Inport[REQUEST, RESPONSE any] interface {
	Execute(ctx context.Context, req REQUEST) (*RESPONSE, error)
}

func GetInport

func GetInport[Req, Res any](usecase any, err error) Inport[Req, Res]

type Runner

type Runner interface {
	Run(cfg *configs.Config) error
}

type TestScenario

type TestScenario[REQUEST, RESPONSE, OUTPORT any] struct {
	Name           string
	InportRequest  REQUEST
	InportResponse *RESPONSE
	Outport        OUTPORT
	ExpectedError  error
}

type UsecaseRegisterer

type UsecaseRegisterer interface {
	AddUsecase(inports ...any)
	GetUsecase(nameStructType any) (any, error)
}

func NewBaseController

func NewBaseController() UsecaseRegisterer

Directories

Path Synopsis
model

Jump to

Keyboard shortcuts

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