Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[POC] Decouple ee build tags for streaming middleware #6672

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

titpetric
Copy link
Contributor

No description provided.

@titpetric titpetric force-pushed the test/build/decouple-ee-build-tags branch from c181e22 to 587d634 Compare October 25, 2024 15:05
@buger
Copy link
Member

buger commented Oct 25, 2024

A JIRA Issue ID is missing from your branch name, PR title and PR description! 🦄

Your branch: test/build/decouple-ee-build-tags

Your PR title: [POC] Decouple ee build tags for streaming middleware

Your PR description: null

If this is your first time contributing to this repository - welcome!


Please refer to jira-lint to get started.

Without the JIRA Issue ID in your branch name you would lose out on automatic updates to JIRA via SCM; some GitHub status checks might fail.

Valid sample branch names:

‣ feature/shiny-new-feature--mojo-10'
‣ 'chore/changelogUpdate_mojo-123'
‣ 'bugfix/fix-some-strange-bug_GAL-2345'

Copy link
Contributor

API Changes

--- prev.txt	2024-10-25 15:07:13.594331796 +0000
+++ current.txt	2024-10-25 15:07:07.650346420 +0000
@@ -1428,6 +1428,10 @@
     SetDisabledFlags set disabled flags to true, since by default they are not
     enabled in OAS API definition.
 
+func (a *APIDefinition) StripListenPath(reqPath string) string
+    StripListenPath will strip the listen path from the URL, keeping version in
+    tact.
+
 type AnalyticsPluginConfig struct {
 	Enabled    bool   `bson:"enable" json:"enable,omitempty"`
 	PluginPath string `bson:"plugin_path" json:"plugin_path,omitempty"`
@@ -8066,6 +8070,9 @@
 	ExtensionTykStreaming = "x-tyk-streaming"
 	StreamGCInterval      = 1 * time.Minute
 )
+const Name = "StreamingMiddleware"
+    Name holds the middleware name as a constant.
+
 
 VARIABLES
 
@@ -8082,21 +8089,6 @@
 
 TYPES
 
-type APISpec struct {
-	APIID string
-	Name  string
-	IsOAS bool
-	OAS   oas.OAS
-
-	StripListenPath model.StripListenPathFunc
-}
-    APISpec is a subset of gateway.APISpec for the values the middleware
-    consumes.
-
-func NewAPISpec(id string, name string, isOasDef bool, oasDef oas.OAS, stripListenPath model.StripListenPathFunc) *APISpec
-    NewAPISpec creates a new APISpec object based on the required inputs.
-    The resulting object is a subset of `*gateway.APISpec`.
-
 type BaseMiddleware interface {
 	model.LoggerProvider
 }
@@ -8115,7 +8107,7 @@
     Manager is responsible for creating a single stream.
 
 type Middleware struct {
-	Spec *APISpec
+	Spec model.MergedAPI
 	Gw   Gateway
 
 	StreamManagerCache sync.Map // Map of payload hash to Manager
@@ -8124,7 +8116,7 @@
 }
     Middleware implements a streaming middleware.
 
-func NewMiddleware(gw Gateway, mw BaseMiddleware, spec *APISpec) *Middleware
+func NewMiddleware(gw Gateway, logger *logrus.Entry, spec model.MergedAPI) *Middleware
     NewMiddleware returns a new instance of Middleware.
 
 func (s *Middleware) CreateStreamManager(r *http.Request) *Manager
@@ -8184,6 +8176,11 @@
 }
     StreamsConfig represents a stream configuration.
 
+# Package: ./ee/register
+
+package register // import "github.com/TykTechnologies/tyk/ee/register"
+
+This package takes care of registering the EE componts to Gateway.
 # Package: ./gateway
 
 package gateway // import "github.com/TykTechnologies/tyk/gateway"
@@ -8213,8 +8210,6 @@
 
 swagger:meta
 
-Provides getStreamingMiddleware
-
 CONSTANTS
 
 const (
@@ -8671,6 +8666,9 @@
 
 func (a *APISpec) Init(authStore, sessionStore, healthStore, orgStore storage.Handler)
 
+func (a *APISpec) MergedAPI() model.MergedAPI
+    MergedAPI provides a model.MergedAPI from an APISpec.
+
 func (a *APISpec) RequestValid(r *http.Request) (bool, RequestStatus)
     RequestValid will check if an incoming request has valid version data and
     return a RequestStatus that describes the status of the request
@@ -8679,10 +8677,6 @@
 
 func (a *APISpec) StopSessionManagerPool()
 
-func (a *APISpec) StripListenPath(reqPath string) string
-    StripListenPath will strip the listen path from the URL, keeping version in
-    tact.
-
 func (a *APISpec) StripVersionPath(reqPath string) string
     StripVersionPath will strip the version from the URL. The input URL should
     already have listen path stripped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants