handler

package module
v0.0.0-...-dd34b7f Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: Apache-2.0 Imports: 11 Imported by: 23

Documentation

Index

Constants

View Source
const (
	Key         = key("session")
	InputKey    = inputKey("input")
	DataSyncKey = syncKey("dataSync")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DataSync

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

DataSync represents data sync

func NewDataSync

func NewDataSync() *DataSync

func (*DataSync) Delete

func (d *DataSync) Delete(key string)

func (*DataSync) Get

func (d *DataSync) Get(key string) *sync.RWMutex

func (*DataSync) Put

func (d *DataSync) Put(key string)

func (*DataSync) Wait

func (d *DataSync) Wait(key string) bool

type Factory

type Factory interface {
	New(ctx context.Context, options ...Option) (Handler, error)
}

type Handler

type Handler interface {
	Exec(ctx context.Context, session Session) (interface{}, error)
}

type Option

type Option func(o *Options)

func WithArguments

func WithArguments(args []string) Option

WithArguments creates arguments option

func WithInputType

func WithInputType(inputType reflect.Type) Option

WithInputType creates inputType option

func WithLookupType

func WithLookupType(fn func(name string) (reflect.Type, error)) Option

WithLookupType creates lookupType option

func WithOutputType

func WithOutputType(outputType reflect.Type) Option

WithOutputType creates outputType option

type Options

type Options struct {
	Arguments  []string
	InputType  reflect.Type
	OutputType reflect.Type
	LookupType func(name string) (reflect.Type, error)
}

func NewOptions

func NewOptions(opts []Option) *Options

NewOptions creates an options

type Session

type Session interface {
	Validator() *validator.Service
	Differ() *differ.Service
	MessageBus() *mbus.Service
	Db(opts ...sqlx.Option) (*sqlx.Service, error)
	Stater() *state.Service
	FlushTemplate(ctx context.Context) error
	Session(ctx context.Context, route *http.Route, opts ...state.Option) (Session, error)
	Http() http.Http
	Auth() auth.Auth
	Logger() logger.Logger
}

Jump to

Keyboard shortcuts

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