Documentation
¶
Index ¶
- Variables
- type DBProvider
- type Form
- type Injector
- type NamedQuerySelector
- type Option
- func WithBody(body []byte) Option
- func WithConstants(key string, value string) Option
- func WithForm(form *Form) Option
- func WithHeader(name, value string) Option
- func WithHeaders(headers http.Header) Option
- func WithHttpRequest(httpRequest *http.Request) Option
- func WithInput(input interface{}) Option
- func WithPathParameter(name, value string) Option
- func WithQuery(query url.Values) Option
- func WithQueryParameter(name, value string) Option
- func WithQueryParameters(name string, values []string) Option
- func WithQuerySelector(selectors ...*NamedQuerySelector) Option
- func WithScope(scope string) Option
- func WithSqlTx(sqlTx *sql.Tx) Option
- type Options
- func (s *Options) Body() []byte
- func (s *Options) Constants() map[string]interface{}
- func (s *Options) Form() *Form
- func (s *Options) Headers() http.Header
- func (s *Options) HttpRequest() *http.Request
- func (s *Options) Input() interface{}
- func (s *Options) PathParameters() map[string]string
- func (s *Options) Query() url.Values
- func (s *Options) QuerySelectors() QuerySelectors
- func (s *Options) Scope() string
- func (s *Options) SqlTx() *sql.Tx
- type QuerySelector
- type QuerySelectors
- type Service
- func (s Service) Bind(ctx context.Context, state interface{}, opt ...Option) error
- func (s Service) Into(ctx context.Context, state interface{}, opt ...Option) error
- func (s Service) Value(ctx context.Context, key string) (interface{}, bool, error)
- func (s Service) ValuesOf(ctx context.Context, any interface{}) (map[string]interface{}, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var DBProviderKey dBProviderKey = "dbProvider"
Functions ¶
This section is empty.
Types ¶
type DBProvider ¶
DBProvider represents a database provider
type Form ¶
type Injector ¶
type Injector interface {
//deprecated use bind instead
Into(ctx context.Context, any interface{}, opt ...Option) error
Bind(ctx context.Context, any interface{}, opt ...Option) error
Value(ctx context.Context, key string) (interface{}, bool, error)
ValuesOf(ctx context.Context, any interface{}) (map[string]interface{}, error)
}
type NamedQuerySelector ¶
type NamedQuerySelector struct {
Name string `json:",omitempty"`
QuerySelector
}
type Option ¶
type Option func(o *Options)
Option represents state option
func WithConstants ¶
WithConstants returns option with constants
func WithHeaders ¶
WithHeaders returns option with headers
func WithHttpRequest ¶
WithHttpRequest returns option with scope
func WithPathParameter ¶
WithPathParameter returns option with path parameters
func WithQueryParameter ¶
WithQueryParameter returns option with query parameters
func WithQueryParameters ¶
WithQueryParameters returns option with query parameters
func WithQuerySelector ¶
func WithQuerySelector(selectors ...*NamedQuerySelector) Option
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options represents state options
func (*Options) HttpRequest ¶
HttpRequest returns http request
func (*Options) PathParameters ¶
PathParameters returns path parameters
func (*Options) QuerySelectors ¶
func (s *Options) QuerySelectors() QuerySelectors
type QuerySelector ¶
type QuerySelector struct {
Columns []string `json:",omitempty"`
Fields []string `json:",omitempty"`
OrderBy string `json:",omitempty"`
Offset int `json:",omitempty"`
Limit int `json:",omitempty"`
Page int `json:",omitempty"`
Criteria string `json:",omitempty"`
Placeholders []interface{} `json:",omitempty"`
}
func (*QuerySelector) CurrentLimit ¶
func (s *QuerySelector) CurrentLimit() int
func (*QuerySelector) CurrentOffset ¶
func (s *QuerySelector) CurrentOffset() int
func (*QuerySelector) CurrentPage ¶
func (s *QuerySelector) CurrentPage() int
func (*QuerySelector) SetCriteria ¶
func (s *QuerySelector) SetCriteria(expanded string, placeholders []interface{})
type QuerySelectors ¶
type QuerySelectors []*NamedQuerySelector
func (QuerySelectors) Find ¶
func (s QuerySelectors) Find(name string) *NamedQuerySelector
Click to show internal directories.
Click to hide internal directories.