service

package
v0.2.65 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply[I any](input *I, options ...Option[I])

Types

type Option

type Option[I any] func(i *I)

type Service

type Service[I any, O any] struct {
	// contains filtered or unexported fields
}

func New

func New[I any, O any](ctx context.Context, parent handler.Session, route *xhttp.Route) (*Service[I, O], error)

func NewWithInjector

func NewWithInjector[I any, O any](route *xhttp.Route, getInjector func(ctx context.Context, route xhttp.Route) (state.Injector, error)) *Service[I, O]

NewWithInjector creates a service that resolves an injector via the supplied callback at execution time. It is useful when the caller only has an injector-provider function (instead of a handler.Session).

func (*Service[I, O]) Bind

func (s *Service[I, O]) Bind(ctx context.Context, dest interface{}, opts ...state.Option) error

func (*Service[I, O]) Execute

func (s *Service[I, O]) Execute(ctx context.Context, opts ...state.Option) (*O, error)

func (*Service[I, O]) Run

func (s *Service[I, O]) Run(ctx context.Context, input *I, opts ...state.Option) (*O, error)

func (*Service[I, O]) RunWithSelector

func (s *Service[I, O]) RunWithSelector(ctx context.Context, input *I, selector *state.NamedQuerySelector, opts ...state.Option) (*O, error)

Jump to

Keyboard shortcuts

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