Documentation ¶
Overview ¶
Package api provides handlers for mserv's various endpoints.
Index ¶
- Constants
- Variables
- func GetFileStore() (stow.Location, error)
- func LoadPlugin(funcName, dir, fName string) (func(*coprocess.Object) (*coprocess.Object, error), error)
- type API
- func (a *API) FetchAndServeBundleFile(mw *storage.MW) (string, error)
- func (a *API) GetAllActiveMW(ctx context.Context) ([]*storage.MW, error)
- func (a *API) GetMWByID(ctx context.Context, id string) (*storage.MW, error)
- func (a *API) HandleDeleteBundle(ctx context.Context, bundleName string) error
- func (a *API) HandleNewBundle(ctx context.Context, filePath, apiID, bundleName string) (*storage.MW, error)
- func (a *API) HandleUpdateBundle(ctx context.Context, filePath, bundleName string) (*storage.MW, error)
- func (a *API) LoadMWIntoDispatcher(mw *storage.MW, pluginPath string) (*storage.MW, error)
- func (a *API) StoreBundleOnly(ctx context.Context, filePath, apiID, bundleName string) (*storage.MW, error)
- type Dispatcher
Constants ¶
View Source
const (
// FmtPluginContainer is a format string for the layout of the container names.
FmtPluginContainer = "mserv-plugin-%s"
)
Variables ¶
Functions ¶
func GetFileStore ¶
func LoadPlugin ¶
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func NewAPI ¶
func NewAPI(store storage.MservStore) *API
func (*API) FetchAndServeBundleFile ¶
func (*API) GetAllActiveMW ¶
func (*API) HandleDeleteBundle ¶
func (*API) HandleNewBundle ¶
func (a *API) HandleNewBundle(ctx context.Context, filePath, apiID, bundleName string) (*storage.MW, error)
HandleNewBundle func creates new bundle and uploads it in to the store.
func (*API) HandleUpdateBundle ¶
func (*API) LoadMWIntoDispatcher ¶
type Dispatcher ¶
type Dispatcher struct{}
Dispatcher implementation
func (*Dispatcher) Dispatch ¶
func (d *Dispatcher) Dispatch(ctx context.Context, object *coprocess.Object) (*coprocess.Object, error)
Dispatch will be called on every request:
func (*Dispatcher) DispatchEvent ¶
func (d *Dispatcher) DispatchEvent(ctx context.Context, event *coprocess.Event) (*coprocess.EventReply, error)
DispatchEvent will be called when a Tyk event is triggered:
Click to show internal directories.
Click to hide internal directories.