Documentation ¶
Index ¶
Constants ¶
View Source
const (
// InjectorContextKey is the key used to lookup the Index from the echo.Context.
InjectorContextKey = "index-injector-context-key"
)
Variables ¶
This section is empty.
Functions ¶
func MergeJSONBody ¶
func MergeJSONBody(c echo.Context, v interface{}) error
MergeJSONBody takes request params and injects them into the json body type. It is expected that the json body is either empty or top-level object.
Currently only supports string values.
Types ¶
type IndexInjector ¶
type IndexInjector struct {
// contains filtered or unexported fields
}
IndexInjector stores a pointer to an index and injects it into the context.
func NewCloudInjector ¶
func NewCloudInjector(ctx context.Context, bucketName, objectName, projectId, topicName string) (*IndexInjector, error)
func NewInjector ¶
func NewInjector(location string) (*IndexInjector, error)
NewInjector returns a new IndexInjector.
func (*IndexInjector) Middleware ¶
func (s *IndexInjector) Middleware(next echo.HandlerFunc) echo.HandlerFunc
Middleware injects the index into the context.
Click to show internal directories.
Click to hide internal directories.