service

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Layer

type Layer[S any] interface{ Then(s S) S }

func Chain added in v0.4.0

func Chain[S any](ms ...Layer[S]) Layer[S]

type LayerFn

type LayerFn[S any] func(s S) S

func (LayerFn[S]) Then added in v0.4.0

func (fn LayerFn[S]) Then(s S) S

type Service

type Service[Req, Resp any] interface {
	// Call is the entry point for the service.
	Call(ctx context.Context, req Req) result.Result[Resp]
}

Service is the interface that provides the business logic for the service.

type ServiceFn

type ServiceFn[Req, Resp any] func(context.Context, Req) result.Result[Resp]

ServiceFn is the function type that implements the Service interface.

func (ServiceFn[Req, Resp]) Call

func (fn ServiceFn[Req, Resp]) Call(ctx context.Context, req Req) result.Result[Resp]

Jump to

Keyboard shortcuts

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