handler

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FactoryType = reflect.TypeOf((*handler.Factory)(nil)).Elem()
View Source
var Type = reflect.TypeOf((*handler.Handler)(nil)).Elem()

Functions

This section is empty.

Types

type DBProvider

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

func (*DBProvider) Db

func (d *DBProvider) Db() (*sql.DB, error)

type Executor

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

func NewExecutor

func NewExecutor(aView *view.View, aSession *session.Session, opts ...Option) *Executor

func (Executor) Clone

func (o Executor) Clone(opts []Option) *options

func (*Executor) Execute

func (e *Executor) Execute(ctx context.Context) error

func (*Executor) ExpandAndExecute

func (e *Executor) ExpandAndExecute(ctx context.Context) (*executor.Session, error)

func (*Executor) HandlerSession

func (e *Executor) HandlerSession(ctx context.Context, opts ...Option) (*extension.Session, error)

func (*Executor) NewHandlerSession

func (e *Executor) NewHandlerSession(ctx context.Context, opts ...Option) (handler.Session, error)

func (Executor) Options

func (o Executor) Options(opts []Option) []Option

func (*Executor) Session

func (e *Executor) Session(ctx context.Context) (*executor.Session, error)

type Handler

type Handler struct {
	Type       string
	Arguments  []string
	InputType  string
	OutputType string
	Output     reflect.Type
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(handler handler.Handler) *Handler

func (*Handler) Call

func (h *Handler) Call(ctx context.Context, session handler.Session) (interface{}, error)

func (*Handler) Init

func (h *Handler) Init(ctx context.Context, resource *view.Resource) (err error)

type Option

type Option func(o *options)

func WithEmbedFS

func WithEmbedFS(fs *embed.FS) Option

func WithTypes

func WithTypes(types ...*state.Type) Option

type Service

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

func (*Service) Allocate

func (s *Service) Allocate(ctx context.Context, tableName string, dest interface{}, selector string) error

func (*Service) CanBatch

func (s *Service) CanBatch(table string) bool

func (*Service) CanBatchGlobally

func (s *Service) CanBatchGlobally() bool

func (*Service) Db

func (s *Service) Db(ctx context.Context) (*sql.DB, error)

func (*Service) Delete

func (s *Service) Delete(tableName string, data interface{}) error

func (*Service) Dialect

func (s *Service) Dialect(ctx context.Context) (*info.Dialect, error)

func (*Service) Execute

func (s *Service) Execute(DML string, options ...sqlx.ExecutorOption) error

func (*Service) Flush

func (s *Service) Flush(ctx context.Context, tableName string) error

func (*Service) Insert

func (s *Service) Insert(tableName string, data interface{}) error

func (*Service) Load

func (s *Service) Load(ctx context.Context, tableName string, data interface{}) error

func (*Service) Read

func (s *Service) Read(ctx context.Context, dest interface{}, SQL string, params ...interface{}) error

func (*Service) Tx

func (s *Service) Tx(ctx context.Context) (*sql.Tx, error)

func (*Service) Update

func (s *Service) Update(tableName string, data interface{}) error

func (*Service) Validator

func (s *Service) Validator() *validator.Service

type Validator

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

func (*Validator) Validate

func (v *Validator) Validate(ctx context.Context, any interface{}, options ...validator.Option) (*validator.Validation, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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