handler

package
v0.9.14 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 Httper added in v0.9.12

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

func NewHttp added in v0.9.12

func NewHttp(executor *Executor, resource *view.Resource) *Httper

func (*Httper) FailWithCode added in v0.9.12

func (h *Httper) FailWithCode(statusCode int, err error) error

func (*Httper) NewRequest added in v0.9.12

func (h *Httper) NewRequest(ctx context.Context, opts ...hstate.Option) (*http.Request, error)

func (*Httper) Redirect added in v0.9.12

func (h *Httper) Redirect(ctx context.Context, route *dhttp.Route, request *http.Request) error

func (*Httper) RequestOf added in v0.9.12

func (h *Httper) RequestOf(ctx context.Context, any interface{}) (*http.Request, 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