Documentation ¶
Index ¶
- Variables
- func RegisterObjects(objects ...Object) (err error)
- type ClassicObjectBuilder
- type Isolator
- func (p *Isolator) Invoke(fn interface{}, args ...interface{}) (ret Result)
- func (p *Isolator) InvokeWithSession(session *Session, fn interface{}, args ...interface{}) (ret Result)
- func (p *Isolator) ObjectSessionOptions(obj Object, opts ...SessionOption)
- func (p *Isolator) ObjectsSessionOptions(objs []Object, opts ...SessionOption)
- func (p *Isolator) Options(opts ...IsolatorOption)
- type IsolatorOption
- type Object
- type ObjectBuilder
- type Result
- type Session
- type SessionOnErrorFunc
- type SessionOnSuccessFunc
- type SessionOption
- type Sessions
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultObjectBuilder = NewClassicObjectBuilder()
)
Functions ¶
func RegisterObjects ¶
Types ¶
type ClassicObjectBuilder ¶
type ClassicObjectBuilder struct {
// contains filtered or unexported fields
}
func (*ClassicObjectBuilder) DeriveObjects ¶
func (*ClassicObjectBuilder) RegisterObjects ¶
func (p *ClassicObjectBuilder) RegisterObjects(objects ...Object) (err error)
type Isolator ¶
type Isolator struct { ObjectBuilder ObjectBuilder // contains filtered or unexported fields }
func NewIsolator ¶
func NewIsolator(opts ...IsolatorOption) *Isolator
Invoke is a func for reflect Call logic func
fn:= func(arg1, arg2, arg3 string) (interface{}, error) { if(arg1!="xxxx") { return nil, error.New("arg1 error") } return func(obj1 Repo1, obj2 Repo2) (result string, err error) { ...... return "good" }, nil }
Repo1, Repo2 is build by object builder
func (*Isolator) InvokeWithSession ¶
func (*Isolator) ObjectSessionOptions ¶
func (p *Isolator) ObjectSessionOptions(obj Object, opts ...SessionOption)
func (*Isolator) ObjectsSessionOptions ¶
func (p *Isolator) ObjectsSessionOptions(objs []Object, opts ...SessionOption)
func (*Isolator) Options ¶
func (p *Isolator) Options(opts ...IsolatorOption)
type IsolatorOption ¶
type IsolatorOption func(*Isolator)
func IsolatorObjectBuilder ¶
func IsolatorObjectBuilder(builder ObjectBuilder) IsolatorOption
type ObjectBuilder ¶
type ObjectBuilder interface { RegisterObjects(objects ...Object) (err error) DeriveObjects(session *Session, types ...reflect.Type) (objects []Object, err error) }
func NewClassicObjectBuilder ¶
func NewClassicObjectBuilder() ObjectBuilder
type Session ¶
type Session struct { ID string Context context.Context CreateTime int64 OnError SessionOnErrorFunc OnSuccess SessionOnSuccessFunc }
func NewSession ¶
func NewSession(opts ...SessionOption) *Session
func (*Session) Options ¶
func (p *Session) Options(opts ...SessionOption)
type SessionOnErrorFunc ¶
type SessionOnSuccessFunc ¶
type SessionOnSuccessFunc func(*Session)
type SessionOption ¶
type SessionOption func(*Session)
func SessionOnError ¶
func SessionOnError(fn SessionOnErrorFunc) SessionOption
func SessionOnSuccess ¶
func SessionOnSuccess(fn SessionOnSuccessFunc) SessionOption
type Sessions ¶
type Sessions struct {
// contains filtered or unexported fields
}
func NewSessions ¶
func NewSessions() *Sessions
func (*Sessions) RegisterObjectOptions ¶
func (p *Sessions) RegisterObjectOptions(obj Object, opts ...SessionOption)
Click to show internal directories.
Click to hide internal directories.