internal

package
v0.0.0-...-290f48c Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2019 License: MIT Imports: 14 Imported by: 0

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.

Jump to

Keyboard shortcuts

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