Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AfterFetcher ¶
type AfterFetcher interface {
//AfterFetch one of the lifecycle hooks, returns bool if response was closed (i.e. response.WriteHeader())
//or just an error if it is needed to stop the routers flow.
//view is type of *[]T or *[]*T
AfterFetch(data interface{}, response http.ResponseWriter, request *http.Request) (responseClosed bool, err error)
}
AfterFetcher represents Lifecycle hook with is called after view was read from Database. It is important to specify View type for assertion type purposes.
type BeforeFetcher ¶
type BeforeFetcher interface {
//BeforeFetch one of the lifecycle hooks, returns bool if response was closed (i.e. response.WriteHeader())
//or just an error if it is needed to stop the routers flow.
BeforeFetch(response http.ResponseWriter, request *http.Request) (responseClosed bool, err error)
}
BeforeFetcher represents Lifecycle hook which is called before view was read from the Database.
type Codec ¶
type Codec interface {
LifecycleVisitor
ResultType() reflect.Type
}
type LifecycleVisitor ¶
LifecycleVisitor visitor can implement BeforeFetcher and/or AfterFetcher
func NewVisitor ¶ added in v0.2.2
func NewVisitor(name string, visitor Valuer) LifecycleVisitor
type Valuer ¶ added in v0.2.2
type Visitors ¶
type Visitors map[string]LifecycleVisitor
func NewVisitors ¶
func NewVisitors(visitors ...LifecycleVisitor) Visitors
func (Visitors) Register ¶
func (v Visitors) Register(visitor LifecycleVisitor)
Click to show internal directories.
Click to hide internal directories.