persist_lib

package
v2.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2018 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultBidirectionalHandler

func DefaultBidirectionalHandler(accessor SqlClientGetter) func(context.Context) (func(*Test_ExampleTableForAmazing) (Scanable, error), func() error)

func DefaultBidirectionalWithHooksHandler

func DefaultBidirectionalWithHooksHandler(accessor SqlClientGetter) func(context.Context) (func(*Test_ExampleTableForAmazing) (Scanable, error), func() error)

func DefaultClientStreamHandler

func DefaultClientStreamHandler(accessor SqlClientGetter) func(context.Context) (func(*Test_ExampleTableForAmazing) error, func() (Scanable, error), error)

func DefaultClientStreamWithHookHandler

func DefaultClientStreamWithHookHandler(accessor SqlClientGetter) func(context.Context) (func(*Test_ExampleTableForAmazing) error, func() (Scanable, error), error)

func DefaultServerStreamHandler

func DefaultServerStreamHandler(accessor SqlClientGetter) func(context.Context, *Test_NameForAmazing, func(Scanable)) error

func DefaultServerStreamWithHooksHandler

func DefaultServerStreamWithHooksHandler(accessor SqlClientGetter) func(context.Context, *Test_NameForAmazing, func(Scanable)) error

func DefaultUniarySelectHandler

func DefaultUniarySelectHandler(accessor SqlClientGetter) func(context.Context, *Test_PartialTableForAmazing, func(Scanable)) error

func DefaultUniarySelectWithHooksHandler

func DefaultUniarySelectWithHooksHandler(accessor SqlClientGetter) func(context.Context, *Test_PartialTableForAmazing, func(Scanable)) error

Types

type AmazingBidirectionalQueryParams

type AmazingBidirectionalQueryParams interface {
	GetId() int64
	GetStartTime() interface{}
	GetName() string
}

type AmazingBidirectionalWithHooksQueryParams

type AmazingBidirectionalWithHooksQueryParams interface {
	GetStartTime() interface{}
	GetName() string
	GetId() int64
}

type AmazingClientStreamQueryParams

type AmazingClientStreamQueryParams interface {
	GetStartTime() interface{}
	GetName() string
	GetId() int64
}

type AmazingClientStreamWithHookQueryParams

type AmazingClientStreamWithHookQueryParams interface {
	GetId() int64
	GetStartTime() interface{}
	GetName() string
}

type AmazingMethodReceiver

type AmazingMethodReceiver struct {
	Handlers AmazingQueryHandlers
}

func (*AmazingMethodReceiver) Bidirectional

func (p *AmazingMethodReceiver) Bidirectional(ctx context.Context) (func(*Test_ExampleTableForAmazing) (Scanable, error), func() error)

returns two functions (feed, stop) feed needs to be called for every row received. It will run the query and return the result + error// stop needs to be called to signal the transaction has finished

func (*AmazingMethodReceiver) BidirectionalWithHooks

func (p *AmazingMethodReceiver) BidirectionalWithHooks(ctx context.Context) (func(*Test_ExampleTableForAmazing) (Scanable, error), func() error)

returns two functions (feed, stop) feed needs to be called for every row received. It will run the query and return the result + error// stop needs to be called to signal the transaction has finished

func (*AmazingMethodReceiver) ClientStream

func (p *AmazingMethodReceiver) ClientStream(ctx context.Context) (func(*Test_ExampleTableForAmazing) error, func() (Scanable, error), error)

given a context, returns two functions. (feed, stop) feed will be called once for every row recieved by the handler stop will be called when the client is done streaming. it expects a row to be returned, or nil.

func (*AmazingMethodReceiver) ClientStreamWithHook

func (p *AmazingMethodReceiver) ClientStreamWithHook(ctx context.Context) (func(*Test_ExampleTableForAmazing) error, func() (Scanable, error), error)

given a context, returns two functions. (feed, stop) feed will be called once for every row recieved by the handler stop will be called when the client is done streaming. it expects a row to be returned, or nil.

func (*AmazingMethodReceiver) ServerStream

func (p *AmazingMethodReceiver) ServerStream(ctx context.Context, params *Test_NameForAmazing, next func(Scanable)) error

next must be called on each result row

func (*AmazingMethodReceiver) ServerStreamWithHooks

func (p *AmazingMethodReceiver) ServerStreamWithHooks(ctx context.Context, params *Test_NameForAmazing, next func(Scanable)) error

next must be called on each result row

func (*AmazingMethodReceiver) UniarySelect

func (p *AmazingMethodReceiver) UniarySelect(ctx context.Context, params *Test_PartialTableForAmazing, next func(Scanable)) error

next must be called on each result row

func (*AmazingMethodReceiver) UniarySelectWithHooks

func (p *AmazingMethodReceiver) UniarySelectWithHooks(ctx context.Context, params *Test_PartialTableForAmazing, next func(Scanable)) error

next must be called on each result row

type AmazingQueryHandlers

type AmazingQueryHandlers struct {
	UniarySelectHandler           func(context.Context, *Test_PartialTableForAmazing, func(Scanable)) error
	UniarySelectWithHooksHandler  func(context.Context, *Test_PartialTableForAmazing, func(Scanable)) error
	ServerStreamHandler           func(context.Context, *Test_NameForAmazing, func(Scanable)) error
	ServerStreamWithHooksHandler  func(context.Context, *Test_NameForAmazing, func(Scanable)) error
	BidirectionalHandler          func(context.Context) (func(*Test_ExampleTableForAmazing) (Scanable, error), func() error)
	BidirectionalWithHooksHandler func(context.Context) (func(*Test_ExampleTableForAmazing) (Scanable, error), func() error)
	ClientStreamHandler           func(context.Context) (func(*Test_ExampleTableForAmazing) error, func() (Scanable, error), error)
	ClientStreamWithHookHandler   func(context.Context) (func(*Test_ExampleTableForAmazing) error, func() (Scanable, error), error)
}

type AmazingServerStreamQueryParams

type AmazingServerStreamQueryParams interface {
	GetName() string
}

type AmazingServerStreamWithHooksQueryParams

type AmazingServerStreamWithHooksQueryParams interface {
	GetName() string
}

type AmazingUniarySelectQueryParams

type AmazingUniarySelectQueryParams interface {
	GetId() int64
	GetStartTime() interface{}
}

type AmazingUniarySelectWithHooksQueryParams

type AmazingUniarySelectWithHooksQueryParams interface {
	GetStartTime() interface{}
	GetId() int64
}

type Result

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

func AmazingBidirectionalQuery

func AmazingBidirectionalQuery(tx Runable, req AmazingBidirectionalQueryParams) *Result

func AmazingBidirectionalWithHooksQuery

func AmazingBidirectionalWithHooksQuery(tx Runable, req AmazingBidirectionalWithHooksQueryParams) *Result

func AmazingClientStreamQuery

func AmazingClientStreamQuery(tx Runable, req AmazingClientStreamQueryParams) *Result

func AmazingClientStreamWithHookQuery

func AmazingClientStreamWithHookQuery(tx Runable, req AmazingClientStreamWithHookQueryParams) *Result

func AmazingServerStreamQuery

func AmazingServerStreamQuery(tx Runable, req AmazingServerStreamQueryParams) *Result

func AmazingServerStreamWithHooksQuery

func AmazingServerStreamWithHooksQuery(tx Runable, req AmazingServerStreamWithHooksQueryParams) *Result

func AmazingUniarySelectQuery

func AmazingUniarySelectQuery(tx Runable, req AmazingUniarySelectQueryParams) *Result

func AmazingUniarySelectWithHooksQuery

func AmazingUniarySelectWithHooksQuery(tx Runable, req AmazingUniarySelectWithHooksQueryParams) *Result

func (*Result) Do

func (r *Result) Do(fun func(Scanable) error) error

func (*Result) Err

func (r *Result) Err() error

func (*Result) Scan

func (r *Result) Scan(dest ...interface{}) error

returns sql.ErrNoRows if it did not scan into dest

type Runable

type Runable interface {
	Query(string, ...interface{}) (*sql.Rows, error)
	QueryRow(string, ...interface{}) *sql.Row
	Exec(string, ...interface{}) (sql.Result, error)
}

type Scanable

type Scanable interface {
	Scan(dest ...interface{}) error
}

type SqlClientGetter

type SqlClientGetter func() (*sql.DB, error)

func NewSqlClientGetter

func NewSqlClientGetter(cli **sql.DB) SqlClientGetter

type Test_ExampleTableForAmazing

type Test_ExampleTableForAmazing struct {
	Id        int64
	StartTime interface{}
	Name      string
}

func (*Test_ExampleTableForAmazing) GetId

this could be used in a query, so generate the getters/setters

func (*Test_ExampleTableForAmazing) GetName

func (p *Test_ExampleTableForAmazing) GetName() string

func (*Test_ExampleTableForAmazing) GetStartTime

func (p *Test_ExampleTableForAmazing) GetStartTime() interface{}

func (*Test_ExampleTableForAmazing) SetId

func (p *Test_ExampleTableForAmazing) SetId(param int64)

func (*Test_ExampleTableForAmazing) SetName

func (p *Test_ExampleTableForAmazing) SetName(param string)

func (*Test_ExampleTableForAmazing) SetStartTime

func (p *Test_ExampleTableForAmazing) SetStartTime(param interface{})

type Test_NameForAmazing

type Test_NameForAmazing struct {
	Name string
}

func (*Test_NameForAmazing) GetName

func (p *Test_NameForAmazing) GetName() string

this could be used in a query, so generate the getters/setters

func (*Test_NameForAmazing) SetName

func (p *Test_NameForAmazing) SetName(param string)

type Test_PartialTableForAmazing

type Test_PartialTableForAmazing struct {
	Id        int64
	StartTime interface{}
}

func (*Test_PartialTableForAmazing) GetId

this could be used in a query, so generate the getters/setters

func (*Test_PartialTableForAmazing) GetStartTime

func (p *Test_PartialTableForAmazing) GetStartTime() interface{}

func (*Test_PartialTableForAmazing) SetId

func (p *Test_PartialTableForAmazing) SetId(param int64)

func (*Test_PartialTableForAmazing) SetStartTime

func (p *Test_PartialTableForAmazing) SetStartTime(param interface{})

Jump to

Keyboard shortcuts

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