pipelines

package
v0.0.0-...-0fffe9f Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: Apache-2.0 Imports: 65 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XCacheHeader = "x-cache"
	XPipelineID  = "x-pipeline-id"
)
View Source
const (
	PIPELINE_ID_KEY          = "pipeline-id"
	PIPELINE_VERSION_KEY     = "pipeline-version"
	PIPELINE_ROUTE_INDEX_KEY = "pipeline-route-index"
	PIPELINE_IS_VALIDATE_KEY = "pipeline-is-validate"
)
View Source
const (
	OpenAIAPIURL string = "https://api.openai.com/v1"
)
View Source
const PipelineValidateIndicatorKey = contextKey("pipeline-is-validate")
View Source
const WgCtxKey = contextKey("diff-update-wg")

CtxKey is a key against which wg will get stored in the context.

Variables

View Source
var CONTEXT_RESERVED_KEYS = []string{"request", "response", "console_logs", "stageChanges"}
View Source
var MARKDOWN_DESCRIPTION = map[string]string{
	"routes":          "**This is a required field**\n\nPipeline routes.\n\nRoutes is an array of route which essentially indicates which routes the pipeline will be listening to. In other words, which routes will trigger the pipeline can be defined using this field.\n\nFollowing is an example of routes:\n\n```yml\nroutes:\n  - path: good-books-ds-pipeline/_reactivesearch\n    method: POST\n    classify:\n      category: reactivesearch\n```\n\nAbove code indicates that the pipeline will be triggered if the route is `good-books-ds-pipeline/_reactivesearch` and the method is `POST`.",
	"trigger":         "Trigger expression is to define the condition of Pipeline invocation. For example, only execute pipeline if query is \\'mobile phone\\'. Check the documentation at [here](https://docs.reactivesearch.io/docs/search/rules/#configure-if-condition).\n\nFollowing is an example trigger for a pipeline that searches for mobile phones:\n\n```yml\ntrigger:\n  type: always\n  expression: $query exactlyMatches \"iphone x\"\n```\n\nAbove trigger will **always** run and execute the expression provided to it.",
	"stages":          "**This is a required field**\n\nPipeline stages.\n\nStages can be thought of as steps of the pipeline that are executed (not always in the order of specification).\n\nFollowing is an example of pipeline stages:\n\n```yml\n\nstages:\n  - use: authorization\n  - use: useCache\n  - id: echo something\n    script: \"console.log(\\'Echoing something from a JS script instead of shell!\\');\"\n  - use: reactivesearchQuery\n    continueOnError: false\n  - use: elasticsearchQuery\n    continueOnError: false\n  - use: recordAnalytics\n```\n\nAbove uses some pre-built stages as well as a stage where the `script` field is used to just run some custom JavaScript. More can be read about the pre-built stages in the following section.",
	"url":             "The `url` field is used to specify the URL that is supposed to be hit during validating the global environment before adding it.",
	"method":          "It might be important to specify the method field in order to get the `expected_status`. This can be done by passing the method as a string. By default the value is set to `GET`.\n\nSome of the other valid options are:\n\n- `POST`\n- `PUT`\n- `PATCH`",
	"body":            "At times, there might be the need to pass the body in a response in order to get the `expected_status`. This is also supported by passing the body in the `body` field.\n\nThe body should be passed as a **string**. If JSON, this should be a stringified JSON.",
	"headers":         "Headers can be essential to alter the response received from hitting a particular URL. Headers can be passed during validating by using the `headers` field.\n\nFor eg, a `Content-Type` header can be passed in the following way:\n\n```yml\nglobal_envs:\n  - label: ES URL\n    key: ES_URL\n    value: http://localhost:9200\n    validate:\n      headers:\n        \"Content-Type\": \"application/json\"\n```",
	"expected_status": "The `expected_status` field is used to make sure the validation was successful. It is an integer that should match the status code of the validate request when it is successful.",
	"value":           "To define the matching values to boost results, for e.g show items with '['holiday-sale', 'premium values']' for 'tag' data field above other items. This key also supports other types of values in order to support `range` and `geo` type of queries.\n\nTo use with `geo` for boosting, value can be ```yaml\nlocation: '23.7555,76.4444'\ndistance: 100\nunit:'km'\n```\n\nTo use with `range` for boosting, value can be ```yaml\nstart: 23\nend: 45\n```",
}
View Source
var RSToSolr = map[string]ConvertFunc{
	"dataField":        convertDataField(),
	"value":            convertValue(),
	"queryFormat":      convertQueryFormat(),
	"size":             convertSize(),
	"from":             convertFrom(),
	"includeFields":    convertIncludeFields(),
	"react":            convertReactField(),
	"sortBy":           convertSortBy(),
	"highlight":        convertHighlight(),
	"highlightConfig":  convertHighlightConfig(),
	"calendarinterval": convertCalendarInterval(),
	"deepPagination":   convertDeepPagination(),
	"includeValues":    convertIncludeValues(),
	"excludeValues":    convertExcludeValues(),

	"id": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return *query.ID, "", nil
	},
	"index": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return *query.ID, "", nil
	},
	"execute": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return "execute", strconv.FormatBool(*query.Execute), nil
	},
	"type": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return query.Type.String(), "", nil
	},
	"showDistinctSuggestions": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return fmt.Sprint(*query.ShowDistinctSuggestions), "", nil
	},
	"enablePredictiveSuggestions": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return fmt.Sprint(*query.EnablePredictiveSuggestions), "", nil
	},
	"maxPredictedWords": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return fmt.Sprint(*query.MaxPredictedWords), "", nil
	},
	"enableSynonyms": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return fmt.Sprint(*query.EnableSynonyms), "", nil
	},
	"applyStopwords": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return fmt.Sprint(*query.ApplyStopwords), "", nil
	},
	"customStopwords": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return strings.Join(*query.Stopwords, ", "), "", nil
	},
	"urlField": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return *query.URLField, "", nil
	},
	"categoryField": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return *query.CategoryField, "", nil
	},
	"highlightField": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return strings.Join(query.HighlightField, ", "), "", nil
	},
	"searchLanguage": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return *query.SearchLanguage, "", nil
	},
	"indexSuggestionsConfig": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return "", "", nil
	},
	"enableIndexSuggestions": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return "", "", nil
	},
	"enablePopularSuggestions": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return "", "", nil
	},
	"enableFeaturedSuggestions": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return "", "", nil
	},
	"enableRecentSuggestions": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return "", "", nil
	},
	"enableEndpointSuggestions": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return "", "", nil
	},
	"showMissing": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return "", "", nil
	},
	"defaultQuery": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return "", "", nil
	},
	"customQuery": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return "", "", nil
	},
	"includeNullValues": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return "", "", nil
	},
	"popularSuggestionsConfig": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return "", "", nil
	},
	"recentSuggestionsConfig": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return "", "", nil
	},
	"featuredSuggestionsConfig": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return "", "", nil
	},
	"aggregations": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return "", "", nil
	},
	"aggregationSize": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return "", "", nil
	},
	"interval": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return "", "", nil
	},
	"sortField": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return "", "", nil
	},
	"deepPaginationConfig": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return "", "", nil
	},
	"endpoint": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return "", "", nil
	},
	"selectAllLabel": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return "", "", nil
	},
	"searchboxId": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return "", "", nil
	},
	"excludeFields": func(query *querytranslate.Query, allQueries *[]querytranslate.Query) (string, string, *Error) {
		return "", "", nil
	},
}

RSToSolr contains a map of functions that will convert the passed RS Query value to it's equivalent Solr query.

Functions

func AddPipelineToCache

func AddPipelineToCache(pipeline ESPipelineDoc)

Add the passed pipeline to cache

func AddVar

func AddVar(varDoc PipelineVar)

AddVar will add the passed var to cache

func ApplyDefaultSearchSettings

func ApplyDefaultSearchSettings(originalQuery querytranslate.Query, defaultSettings querytranslate.Query) querytranslate.Query

func BlacklistedPaths

func BlacklistedPaths() []string

BlacklistedPaths will return an array of strings that are blacklisted path patterns.

func CatchAllHandler

func CatchAllHandler() http.HandlerFunc

CatchAllHandler will handle the catch-all route in case it matches.

This handler will invoke the pipeline handler but before that the req properties will be updated so that the request actually has the pipeline route properties

func CatchAllMatcher

func CatchAllMatcher() mux.MatcherFunc

CatchAllMatcher will act as a matcher function for the catch-all route and determine whether or not the attached handler should be called.

func DeletePipelineFromCache

func DeletePipelineFromCache(pipelineID string) bool

Delete the pipeline from the cache

func GetAIAnswerInputSchema

func GetAIAnswerInputSchema() map[string]interface{}

GetAIAnswerInputSchema will return the schema for the AIAnswer stage

func GetAddFilterInputSchema

func GetAddFilterInputSchema() map[string]interface{}

func GetBoostInputSchema

func GetBoostInputSchema() map[string]interface{}

func GetCustomDataInputSchema

func GetCustomDataInputSchema() map[string]interface{}

func GetElasticsearchQueryInputSchema

func GetElasticsearchQueryInputSchema() map[string]interface{}

func GetHTTPRequestInputSchema

func GetHTTPRequestInputSchema() map[string]interface{}

func GetHideResultsInputSchema

func GetHideResultsInputSchema() map[string]interface{}

func GetHttpMethods

func GetHttpMethods() []string

Get valid http methods for router

func GetKNNInputSchema

func GetKNNInputSchema() map[string]interface{}

func GetMongoDBQueryInputSchema

func GetMongoDBQueryInputSchema() map[string]interface{}

func GetOpenAIEmbeddingsIndexInputSchema

func GetOpenAIEmbeddingsIndexInputSchema() map[string]interface{}

GetOpenAIEmbeddingsIndexInputSchema will return the schema for Open AI Embeddings Index stage

func GetOpenAIEmbeddingsInputSchema

func GetOpenAIEmbeddingsInputSchema() map[string]interface{}

GetOpenAIEmbeddingsInputSchema will return the schema for Open AI Embeddings stage

func GetPipelineSchema

func GetPipelineSchema() ([]byte, error)

func GetPromotedResultsInputSchema

func GetPromotedResultsInputSchema() map[string]interface{}

func GetReflactor

func GetReflactor() *jsonschema.Reflector

func GetRemoveWordsInputSchema

func GetRemoveWordsInputSchema() map[string]interface{}

func GetReplaceSearchInputSchema

func GetReplaceSearchInputSchema() map[string]interface{}

func GetReplaceWordsInputSchema

func GetReplaceWordsInputSchema() map[string]interface{}

func GetSearchRelevancyInputSchema

func GetSearchRelevancyInputSchema() map[string]interface{}

func GetSearchboxPreferencesInputSchema

func GetSearchboxPreferencesInputSchema() map[string]interface{}

func GetSolrInputSchema

func GetSolrInputSchema() map[string]interface{}

GetSolrInputSchema will return the schema for Solr

func GetStageDescripton

func GetStageDescripton(o PreBuiltStage) string

To define the description for stage

func GetStageInputs

func GetStageInputs(o PreBuiltStage) map[string]interface{}

To define the schema definitions for stage inputs

func GetStageTitle

func GetStageTitle(o PreBuiltStage) string

To define the title for stage

func GetZincInputSchema

func GetZincInputSchema() map[string]interface{}

GetZincInputSchema will return the schema for Zinc

func InjectEnvs

func InjectEnvs(passedEnvs *map[string]interface{})

Inject envs will inject all the cachedVars into the passed map and return them.

func IsPipelineLimitExceeded

func IsPipelineLimitExceeded(value int64) bool

IsPipelineLimitExceeded will check if the plan limit has been exceeded for the passed value and will accordingly return

func IsValidNeedsStage

func IsValidNeedsStage(stage string, stages []ESPipelineStage, currentIndex int) bool

IsValidNeedsStage checks if the passed needs stage is defined in the stages array

func MergeStageLogs

func MergeStageLogs(logsByStage map[string][]string) []string

MergeStageLogs will merge all the logs for each stage and return an array of logs.

func NewContext

func NewContext(ctx context.Context, pipelineLog *PipelineLog) context.Context

NewContext returns a new context with the given request body.

func PipelineIsValidateFromContext

func PipelineIsValidateFromContext(ctx context.Context) (*bool, error)

func PipelineIsValidateNewContext

func PipelineIsValidateNewContext(ctx context.Context, isValidate *bool) context.Context

func PipelineToMap

func PipelineToMap(pipeline ESPipelineDoc) (map[string]interface{}, error)

Convert an ESPipelineDoc to map[string]interface

func RemoveVar

func RemoveVar(location int)

RemoveVar will remove the variable from the cache

func SetPipelinesToCache

func SetPipelinesToCache(pipelines []ESPipelineDoc)

SetPipelinesToCache sets the pipelines into cache for faster access

func SetVars

func SetVars(varsToCache []PipelineVar)

SetVars will set the passed pipeline vars in the cache

func UpdatePipelineInCache

func UpdatePipelineInCache(pipelineID string, pipelineBody ESPipelineDoc) bool

Update the pipeline in the cache using the ID Since the file will be verified by parent, this method will do a direct cache update for the passed ID without any validations for nil etc.

func UpdateVar

func UpdateVar(location int, varDoc PipelineVar)

UpdateVar will update the variable in cache with the passed location

func ValidateMethod

func ValidateMethod(method string, pathIndex int) error

Validate methods to make sure it is one of the allowed ones

func ValidatePath

func ValidatePath(path string, pathIndex int) error

Validate path to make sure it follows the following: - should start with slash (/)

func ValidateStages

func ValidateStages(stages []ESPipelineStage, routes []ESPipelineRoutes) error

ValidateStages will validate the passed stages for the pipeline

func WgFromContext

func WgFromContext(ctx context.Context) (*[]*sync.WaitGroup, error)

FromContext retrieves waitgroup saved in the context.

func WgNewContext

func WgNewContext(ctx context.Context, wg *[]*sync.WaitGroup) context.Context

NewContext returns a context with the passed value stored against the context key.

Types

type AIAnswerInput

type AIAnswerInput struct {
	SystemPrompt      *string  `` /* 199-byte string literal not displayed */
	TopDocsForContext *int     `` /* 283-byte string literal not displayed */
	DocTemplate       *string  `` /* 301-byte string literal not displayed */
	QueryTemplate     *string  `` /* 402-byte string literal not displayed */
	MaxTokens         *int     `` /* 248-byte string literal not displayed */
	Temperature       *float64 `` /* 250-byte string literal not displayed */
	Model             *string  `` /* 213-byte string literal not displayed */
	ApiKey            *string  `json:"apiKey,omitempty" jsonschema:"title=API Key" jsonschema_description:"(mandatory) OpenAI API key to access the API"`
	QueryID           *string  `` /* 306-byte string literal not displayed */
}

type AddFilterInput

type AddFilterInput struct {
	Data map[string]interface{} `` /* 198-byte string literal not displayed */
}

Add filter input schema

type BackgroundStageToTime

type BackgroundStageToTime struct {
	// contains filtered or unexported fields
}

BackgroundStageToTime will store the time taken by each stage to process against the stage

func (*BackgroundStageToTime) Add

func (b *BackgroundStageToTime) Add(key string, value *int)

func (*BackgroundStageToTime) GetAll

func (b *BackgroundStageToTime) GetAll() *map[string]*int

type BoostOperation

type BoostOperation int
const (
	Add BoostOperation = iota
	Multiply
)

func (BoostOperation) JSONSchema

func (o BoostOperation) JSONSchema() *jsonschema.Schema

func (BoostOperation) MarshalJSON

func (o BoostOperation) MarshalJSON() ([]byte, error)

MarshalJSON is the implementation of the Marshaler interface for marshaling BoostOperation type.

func (BoostOperation) String

func (o BoostOperation) String() string

String is the implementation of Stringer interface that returns the string representation of BoostOperation type.

func (*BoostOperation) UnmarshalJSON

func (o *BoostOperation) UnmarshalJSON(bytes []byte) error

UnmarshalJSON is the implementation of the Unmarshaler interface for unmarshaling BoostOperation type.

type BoostStageInputStruct

type BoostStageInputStruct struct {
	DataField          *string                    `json:"dataField" jsonschema:"title=Data Field" jsonschema_description:"Field name to match value to find documents to rank."`
	Value              *interface{}               `json:"value" jsonschema:"title=Value" jsonschema_description:""`
	BoostType          BoostType                  `` /* 127-byte string literal not displayed */
	BoostOperation     BoostOperation             `json:"boostOp" jsonschema:"title=Boost Operation" jsonschema_description:"Boost operation, for e.g 'add' or 'multiply'."`
	BoostFactor        int                        `` /* 228-byte string literal not displayed */
	BoostMaxDocs       *int                       `json:"boostMaxDocs" jsonschema:"title=Boost Max Docs" jsonschema_description:"Maximum number of documents to boost."`
	QueryFormat        querytranslate.QueryFormat `` /* 160-byte string literal not displayed */
	BoostSizeThreshold *int                       `` /* 158-byte string literal not displayed */
}

type BoostStageResponse

type BoostStageResponse struct {
	QueryId    string                `json:"queryId"`
	Inputs     BoostStageInputStruct `json:"inputs"`
	Query      string                `json:"query"`
	Index      string                `json:"index"`
	ShouldSkip bool                  `json:"shouldSkip"`
}

type BoostType

type BoostType int
const (
	Score BoostType = iota
	Promote
)

func (BoostType) JSONSchema

func (o BoostType) JSONSchema() *jsonschema.Schema

func (BoostType) MarshalJSON

func (o BoostType) MarshalJSON() ([]byte, error)

MarshalJSON is the implementation of the Marshaler interface for marshaling BoostType type.

func (BoostType) String

func (o BoostType) String() string

String is the implementation of Stringer interface that returns the string representation of BoostType type.

func (*BoostType) UnmarshalJSON

func (o *BoostType) UnmarshalJSON(bytes []byte) error

UnmarshalJSON is the implementation of the Unmarshaler interface for unmarshaling BoostType type.

type CacheSyncScript

type CacheSyncScript struct {
	// contains filtered or unexported fields
}

func (CacheSyncScript) Index

func (s CacheSyncScript) Index() string

func (CacheSyncScript) PluginName

func (s CacheSyncScript) PluginName() string

func (CacheSyncScript) SetCache

func (s CacheSyncScript) SetCache(response *elastic.SearchResult) error

type CachedRequestContext

type CachedRequestContext struct {
	// contains filtered or unexported fields
}

To store request body to be cached

func (*CachedRequestContext) Get

func (c *CachedRequestContext) Get() []byte

To retrive the request body to be cached

func (*CachedRequestContext) Put

func (c *CachedRequestContext) Put(value []byte)

To update the request body to be cached

type ClassifyRoute

type ClassifyRoute struct {
	Category *category.Category `` /* 210-byte string literal not displayed */
	ACL      *acl.ACL           `` /* 349-byte string literal not displayed */
}

Classify route details

type Config

type Config struct {
	Content         *string `json:"content,omitempty"`
	Type            *string `json:"extension,omitempty"`
	ValidateContext *string `json:"validateContext,omitempty"`
}

Store details about the original config passed

type ConfigOut

type ConfigOut struct {
	ID                 *string            `json:"id,omitempty"`
	Version            *int               `json:"_version,omitempty"`
	VersionDescription *string            `json:"_version_description,omitempty"`
	IsLive             *bool              `json:"is_live,omitempty"`
	Enabled            *bool              `json:"enabled,omitempty"`
	Priority           *int64             `json:"priority,omitempty"`
	Description        *string            `json:"description,omitempty"`
	Routes             []ESPipelineRoutes `json:"routes,omitempty"`
	UpdatedAt          *int64             `json:"updated_at,omitempty"`
	CreatedAt          *int64             `json:"created_at,omitempty"`
	Content            *string            `json:"content,omitempty"`
	Key                *string            `json:"key,omitempty"`
	Type               *string            `json:"extension,omitempty"`
	Usage              interface{}        `json:"usage,omitempty"`
	ValidateContext    *string            `json:"validateContext,omitempty"`
}

Define structure to return config to return

type ConvertFunc

type ConvertFunc func(*querytranslate.Query, *[]querytranslate.Query) (string, string, *Error)

ConvertFunc will convert the passed value into a string to be passed in Solr

type CustomDataInput

type CustomDataInput struct {
	Data interface{} `` /* 173-byte string literal not displayed */
}

custom data input schema

type DelayedStageLogTracker

type DelayedStageLogTracker struct {
	IsReady  bool
	RemoveAt *int64
	// contains filtered or unexported fields
}

DelayedStageLogTracker will allow accessing stage logs for stages that have a background script for up-to 30 mins since it is populated.

func (*DelayedStageLogTracker) GetIsReady

func (d *DelayedStageLogTracker) GetIsReady() bool

func (*DelayedStageLogTracker) GetLogs

func (*DelayedStageLogTracker) GetTimeTaken

func (d *DelayedStageLogTracker) GetTimeTaken() *map[string]*int

func (*DelayedStageLogTracker) ShouldRemove

func (d *DelayedStageLogTracker) ShouldRemove() bool

type ESPipelineDoc

type ESPipelineDoc struct {
	ID              *string                `json:"id,omitempty"`
	OriginalConfig  *Config                `json:"originalConfig,omitempty"`
	Versions        *[]Version             `json:"version,omitempty"`
	Enabled         *bool                  `json:"enabled,omitempty"`
	Description     *string                `json:"description,omitempty"`
	Priority        *int64                 `json:"priority,omitempty"`
	Routes          *[]ESPipelineRoutes    `json:"routes,omitempty"`
	Envs            map[string]interface{} `json:"envs,omitempty"`
	Trigger         *rules.Trigger         `json:"trigger,omitempty"`
	UpdatedAt       *int64                 `json:"updatedAt,omitempty"`
	CreatedAt       *int64                 `json:"createdAt,omitempty"`
	Stages          *[]ESPipelineStage     `json:"stages,omitempty"`
	LiveVersion     *int                   `json:"live_version,omitempty"`
	ValidateContext *string                `json:"validateContext,omitempty"`
}

Declare the type that will be stored in ES

func GetLivePipeline

func GetLivePipeline(pipeline ESPipelineDoc) ESPipelineDoc

GetLivePipeline will get the live pipeline for the passed pipeline.

If the live versions are empty or not set the default pipelines will be returned.

func GetPipelineAndLocFromCache

func GetPipelineAndLocFromCache(pipelineID string) (*ESPipelineDoc, *int)

Check if the pipeline is present in the cache

func GetPipelinesFromCache

func GetPipelinesFromCache() []ESPipelineDoc

Get all pipelines from cache The array will be sorted based on decreasing priority

func MapToPipeline

func MapToPipeline(doc map[string]interface{}) (*ESPipelineDoc, error)

Convert a map[string]interface{} to ESPipelineDoc

func (*ESPipelineDoc) PipelineMatcher

func (p *ESPipelineDoc) PipelineMatcher(route ESPipelineRoutes) mux.MatcherFunc

PipelineMatcher returns a mux matcher function that executes the trigger expression for the pipeline.

The trigger will be extracted from the attached pipeline and accordingly executed.

type ESPipelineDocIn

type ESPipelineDocIn struct {
	ID          *string                `json:"id,omitempty" jsonschema:"title=Pipeline ID" jsonschema_description:"Auto-generated unique identifier for pipeline."`
	Enabled     *bool                  `` /* 272-byte string literal not displayed */
	Description *string                `` /* 251-byte string literal not displayed */
	Priority    *int64                 `` /* 327-byte string literal not displayed */
	Routes      *[]ESPipelineRoutes    `json:"routes,omitempty" jsonschema:"title=Routes,required" jsonschema_description:""`
	Envs        map[string]interface{} `` /* 288-byte string literal not displayed */
	Trigger     *rules.Trigger         `json:"trigger,omitempty" jsonschema:"title=Trigger Expression" jsonschema_description:""`

	Stages          *[]ESPipelineStageIn `json:"stages,omitempty" jsonschema:"title=Stages,required" jsonschema_description:""`
	GlobalVars      *[]PipelineVar       `` /* 158-byte string literal not displayed */
	ValidateContext *string              `json:"validateContext,omitempty"`
	// contains filtered or unexported fields
}

Declare a ESPipelineDoc

type ESPipelineRoutes

type ESPipelineRoutes struct {
	Path       *string        `` /* 226-byte string literal not displayed */
	Method     *string        `` /* 199-byte string literal not displayed */
	RecordLogs *bool          `` /* 177-byte string literal not displayed */
	Classify   *ClassifyRoute `` /* 320-byte string literal not displayed */
}

Handle Routes inside the ESPipelineDoc

type ESPipelineStage

type ESPipelineStage struct {
	Use             *PreBuiltStage `json:"use,omitempty"`
	ID              *string        `json:"id,omitempty"`
	Enabled         *bool          `json:"enabled,omitempty"`
	Async           *bool          `json:"async,omitempty"`
	Script          *string        `json:"script,omitempty"`
	ScriptRef       *string        `json:"scriptRef,omitempty"`
	ContinueOnError *bool          `json:"continueOnError,omitempty"`
	Inputs          *string        `json:"inputs,omitempty"`
	Needs           *[]string      `json:"needs,omitempty"`
	Description     *string        `json:"description,omitempty"`
	Trigger         *Trigger       `json:"trigger,omitempty"`
}

Handle storing the stage

type ESPipelineStageIn

type ESPipelineStageIn struct {
	Use             *PreBuiltStage          `` /* 135-byte string literal not displayed */
	ID              *string                 `` /* 199-byte string literal not displayed */
	Enabled         *bool                   `` /* 131-byte string literal not displayed */
	Async           *bool                   `` /* 412-byte string literal not displayed */
	Script          *string                 `` /* 213-byte string literal not displayed */
	ScriptRef       *string                 `` /* 331-byte string literal not displayed */
	ContinueOnError *bool                   `` /* 214-byte string literal not displayed */
	Inputs          *map[string]interface{} `` /* 175-byte string literal not displayed */
	Needs           *[]string               `` /* 313-byte string literal not displayed */
	Description     *string                 `json:"description,omitempty" jsonschema:"title=Description" jsonschema_description:"User-defined description for stage."`
	Trigger         *Trigger                `` /* 135-byte string literal not displayed */
}

Handle incoming stage data

type ElasticsearchQueryInput

type ElasticsearchQueryInput struct {
	Method                        *string            `` /* 170-byte string literal not displayed */
	Path                          *string            `json:"path,omitempty" jsonschema:"title=Path" jsonschema_description:"URL path, for e.g '/_search'."`
	URL                           *string            `` /* 304-byte string literal not displayed */
	Params                        *map[string]string `` /* 132-byte string literal not displayed */
	Headers                       *map[string]string `` /* 149-byte string literal not displayed */
	Body                          *string            `` /* 138-byte string literal not displayed */
	IndependentBody               *string            `` /* 173-byte string literal not displayed */
	ParseResponseToReactivesearch *bool              `` /* 275-byte string literal not displayed */
	SetResponseToKV               *string            `` /* 324-byte string literal not displayed */
}

type Error

type Error struct {
	Err  error
	Code int
}

func GetEmbeddingsForText

func GetEmbeddingsForText(text string, model string, apiKey string) ([]float64, *Error)

GetEmbeddingsForText will get the vector embeddings for the passed text value.

func TranslateEachToZinc

func TranslateEachToZinc(query *querytranslate.Query, allQueries *[]querytranslate.Query, requestQuery querytranslate.RSQuery) (map[string]interface{}, *Error)

TranslateEachToZinc will translate each query to its equivalent Zinc body.

func TranslateToRS

func TranslateToRS(solrResponse map[string]interface{}, queryRun map[string]string, rsQuery querytranslate.Query, shouldExtractFusionQueryID bool) (map[string]interface{}, map[string]interface{}, *Error)

TranslateToRS will translate the Solr response to its ReactiveSearch equivalent.

func TranslateToSolr

func TranslateToSolr(rsQuery querytranslate.Query, allQueries *[]querytranslate.Query) (map[string]string, *Error)

TranslateToSolr will translate the passed query to Solr and return a string that can be used to pass in the Solr endpoint

func TranslateToZinc

func TranslateToZinc(rsQuery *querytranslate.RSQuery, defaultIndex string) (string, *Error)

TranslateToZinc will translate the RS body to the equivalent zinc body that can be hit and the response can be retrieved.

The function will return a stringified nd-JSON body that can be used directly to hit Zinc.

func ValidateRSToSolrKey

func ValidateRSToSolrKey(rsBody *[]querytranslate.Query) *Error

ValidateRSToSolrKey will make sure that all the keys present in the reactivesearch request body are convertible to Solr equivalent.

It is important to note that this method should only be invoked if the backend is set to Solr.

type ExecutePipelineResponse

type ExecutePipelineResponse struct {
	Request      rules.ScriptRequest    `json:"request"`
	Response     rules.ScriptResponse   `json:"response"`
	Environments map[string]interface{} `json:"envs"`
	Logs         map[string][]string    `json:"console_logs"`
}

type GlobalScriptContext

type GlobalScriptContext struct {
	// contains filtered or unexported fields
}

func (*GlobalScriptContext) Get

func (c *GlobalScriptContext) Get() []byte

To retrive the global script context

func (*GlobalScriptContext) GetMap

func (c *GlobalScriptContext) GetMap() map[string]interface{}

To update the status for a stage by id

func (*GlobalScriptContext) GetUpdatedContext

func (c *GlobalScriptContext) GetUpdatedContext(value []byte, async bool, write bool) ([]byte, error)

GetUpdatedContext gets the updated context based on the passed value and comparing it to the older context

func (*GlobalScriptContext) Put

func (c *GlobalScriptContext) Put(value []byte, async bool) error

Put will update the global script context based on the passed value.

type HTTPRequestInput

type HTTPRequestInput struct {
	Method          *string            `` /* 170-byte string literal not displayed */
	URL             *string            `` /* 187-byte string literal not displayed */
	Params          *map[string]string `` /* 132-byte string literal not displayed */
	Headers         *map[string]string `` /* 149-byte string literal not displayed */
	Body            *string            `` /* 138-byte string literal not displayed */
	SetResponseToKV *string            `` /* 324-byte string literal not displayed */
}

type HideResultInput

type HideResultInput struct {
	Data []string `` /* 154-byte string literal not displayed */
}

Hide results input schema

type KNNStruct

type KNNStruct struct {
	Backend *querytranslate.Backend `json:"backend" jsonschema:"title=Search Backend" jsonschema_description:"Search backend, defaults to 'elasticsearch'."`
	// TODO: Add title and description
	Search *querytranslate.Query `json:"search"`
}

KNNStruct contains the input details expected in the knn stage

type MappingsMigration

type MappingsMigration struct {
	// contains filtered or unexported fields
}

func (MappingsMigration) ConditionCheck

func (m MappingsMigration) ConditionCheck() (bool, *util.Error)

TODO: Update the logic in the function

func (MappingsMigration) IsAsync

func (m MappingsMigration) IsAsync() bool

func (MappingsMigration) Script

func (m MappingsMigration) Script() *util.Error

type MongoDBInput

type MongoDBInput struct {
	Credentials       *string                   `` /* 137-byte string literal not displayed */
	HOST              *string                   `` /* 148-byte string literal not displayed */
	Protocol          *string                   `json:"protocol,omitempty" jsonschema:"title=Protocol" jsonschema_description:"Protocol. For example, 'mongodb+srv'."`
	DB                *string                   `json:"db,omitempty" jsonschema:"title=Database Name,required" jsonschema_description:"Database name, e.g. 'sample_airbnb'"`
	Collection        *string                   `` /* 134-byte string literal not displayed */
	ConnectionOptions string                    `` /* 149-byte string literal not displayed */
	Body              *[]map[string]interface{} `` /* 209-byte string literal not displayed */
}

type OpenAIData

type OpenAIData struct {
	Embedding *[]float64 `json:"embedding,omitempty"`
}

type OpenAIEmbeddingsIndexInput

type OpenAIEmbeddingsIndexInput struct {
	Model     *string   `` /* 222-byte string literal not displayed */
	ApiKey    *string   `json:"apiKey,omitempty" jsonschema:"title=API Key" jsonschema_description:"OpenAI API key to be able to access the API"`
	InputKeys *[]string `` /* 155-byte string literal not displayed */
	OutputKey *string   `` /* 133-byte string literal not displayed */
}

type OpenAIEmbeddingsInput

type OpenAIEmbeddingsInput struct {
	Text           *string `json:"text,omitempty" jsonschema:"title=Text" jsonschema_description:"Text to get the vector for. Eg: 'test string'"`
	Model          *string `` /* 222-byte string literal not displayed */
	ApiKey         *string `json:"apiKey,omitempty" jsonschema:"title=API Key" jsonschema_description:"OpenAI API key to be able to access the API"`
	UseWithRSQuery *bool   `` /* 259-byte string literal not displayed */
}

type OpenAIResponse

type OpenAIResponse struct {
	Data *[]OpenAIData `json:"data,omitempty"`
}

type PipelineExecutionContext

type PipelineExecutionContext struct {
	// contains filtered or unexported fields
}

type PipelineExecutionRequest

type PipelineExecutionRequest struct {
	Body    []byte
	Headers map[string]string
}

type PipelineInvoke

type PipelineInvoke struct {
	ID        *string                        `json:"pipeline_id,omitempty"`
	Version   *int                           `json:"version,omitempty"`
	Stages    map[string]PipelineInvokeStage `json:"stages,omitempty"`
	TimeStamp int64                          `json:"timestamp,omitempty"`
	Took      int                            `json:"took,omitempty"`
	Error     *bool                          `json:"error,omitempty"`
}

Store the pipeline invocation details when a pipeline invocation is successfull.

type PipelineInvokeMap

type PipelineInvokeMap struct {
	// contains filtered or unexported fields
}

PipelineInvokeMap stores the map of pipeline stage ID's to pipeline invoke stage and makes use of a mutex to lock and unlock while writing

func (*PipelineInvokeMap) AddStage

func (p *PipelineInvokeMap) AddStage(stageId string, isStageError *bool, stageTook *int, isStageExecuted *bool)

AddStage adds a stage to the invoke map

func (*PipelineInvokeMap) GetStagesMap

func (p *PipelineInvokeMap) GetStagesMap() *map[string]PipelineInvokeStage

type PipelineInvokeStage

type PipelineInvokeStage struct {
	Error    *bool `json:"error,omitempty"`
	Took     *int  `json:"took,omitempty"`
	Executed *bool `json:"executed,omitempty"`
}

Store the stage details for the pipeline invocation

type PipelineLog

type PipelineLog struct {
	Route        *string            `json:"route"`
	PipelineID   *string            `json:"pipeline_id"`
	Category     *category.Category `json:"category"`
	ACL          *acl.ACL           `json:"acl"`
	Took         *int               `json:"took"`
	Response     *Response          `json:"response"`
	Request      *Request           `json:"request"`
	Context      *string            `json:"context"`
	StageChanges *[]StageChange     `json:"stageChanges"`
	Timestamp    time.Time          `json:"timestamp"`
	DiffLogs     bool               `json:"diffLogs"`
}

Structure to store the pipeline logs

func FromContext

func FromContext(ctx context.Context) (*PipelineLog, error)

FromContext retrieves the pipeline log stored against the ctxKey from the context.

type PipelineVar

type PipelineVar struct {
	ID          *string             `json:"id" jsonschema:"title=Variable ID" jsonschema_description:"Unique Identifier for the Global variable."`
	Label       *string             `` /* 131-byte string literal not displayed */
	Key         *string             `` /* 152-byte string literal not displayed */
	Value       *string             `` /* 208-byte string literal not displayed */
	Description *string             `` /* 153-byte string literal not displayed */
	Validate    PipelineVarValidate `` /* 239-byte string literal not displayed */
	CreatedAt   *int64              `json:"created_at,omitempty" jsonschema:""`
	UpdatedAt   *int64              `json:"updated_at,omitempty"`
}

PipelineVar will contain the pipeline variables details in a proper structure

func GetVarAndLocation

func GetVarAndLocation(key string) (*PipelineVar, *int)

GetVarAndLocation will get the variable and the location for it from the cache

func GetVars

func GetVars() []PipelineVar

GetVars will get the vars and return them in terms of updatedAt where the latest will be the first

func (PipelineVar) ToMap

func (pipelineVar PipelineVar) ToMap() (map[string]interface{}, error)

ToMap will convert the interface to a map[string]interface{} using the properties present.

type PipelineVarValidate

type PipelineVarValidate struct {
	URL            *string                `json:"url" jsonschema:"title=URL" jsonschema_description:""`
	Method         *string                `json:"method" jsonschema:"title=Method" jsonschema_description:""`
	Body           interface{}            `json:"body" jsonschema:"title=Body" jsonschema_description:""`
	Headers        map[string]interface{} `json:"headers" jsonschema:"title=Headers" jsonschema_description:""`
	ExpectedStatus int                    `json:"expected_status" jsonschema:"title=Expected Status" jsonschema_description:""`
}

type Pipelines

type Pipelines struct {

	// Pipeline map to store map of paths to the pipelineId's
	PathToPipeline map[string][]*ESPipelineDoc
	// contains filtered or unexported fields
}

Pipelines plugin deals with managing pipelines.

func Instance

func Instance() *Pipelines

Instance returns the singleton instance of the plugin. Instance should be the only way (both within or outside the package) to fetch the instance of the plugin, in order to avoid stateless duplicates.

func (*Pipelines) AlternateRoutes

func (p *Pipelines) AlternateRoutes() []plugins.Route

Expose plugin specific routes

func (*Pipelines) ESMiddleware

func (p *Pipelines) ESMiddleware() []middleware.Middleware

func (*Pipelines) InitFunc

func (p *Pipelines) InitFunc() error

InitFunc initializes the dao, i.e. elasticsearch client, and should be executed only once in the lifetime of the plugin.

func (*Pipelines) Name

func (r *Pipelines) Name() string

Name returns the name of the plugin: pipelines

func (*Pipelines) RSMiddleware

func (p *Pipelines) RSMiddleware() []middleware.Middleware

func (*Pipelines) Routes

func (p *Pipelines) Routes() []plugins.Route

Routes returns an empty slices since the plugin solely acts as a middleware.

type PreBuiltStage

type PreBuiltStage int
const (
	Authorization PreBuiltStage = iota
	ElasticSearchQuery
	ReactiveSearchQuery
	UseCache
	RecordAnalytics
	PromoteResults
	HideResults
	CustomData
	ReplaceSearchTerm
	AddFilter
	RemoveWords
	ReplaceWords
	SearchRelevancy
	KnnResponse
	HttpRequest
	MongoDBQuery
	SolrQuery
	ZincQuery
	RecordClick
	RecordSaveSearch
	RecordFavorite
	RecordConversion
	SearchboxPreferences
	Boost
	OpenAIEmbeddings
	OpenAIEmbeddingsIndex
	AIAnswer
	ValidateStage
)

func StagesAllowNeeds

func StagesAllowNeeds() []PreBuiltStage

StagesAllowNeeds returns a list of prebuilt stages that does allow the needs property at the same stage.

func StagesRequireCategory

func StagesRequireCategory() []PreBuiltStage

StagesRequireCategory returns a list of prebuilt stages that require the route category to be set

func StagesRequireRS

func StagesRequireRS() []PreBuiltStage

StagesRequireRS returns the stages that require RS as category in routes

func (PreBuiltStage) JSONSchema

func (o PreBuiltStage) JSONSchema() *jsonschema.Schema

func (PreBuiltStage) MarshalJSON

func (o PreBuiltStage) MarshalJSON() ([]byte, error)

MarshalJSON is the implementation of the Marshaler interface for marshaling PreBuiltStage type.

func (PreBuiltStage) String

func (o PreBuiltStage) String() string

String is the implementation of Stringer interface that returns the string representation of PreBuiltStage type.

func (*PreBuiltStage) UnmarshalJSON

func (o *PreBuiltStage) UnmarshalJSON(bytes []byte) error

UnmarshalJSON is the implementation of the Unmarshaler interface for unmarshaling PreBuiltStage type.

type PromotedResultInput

type PromotedResultInput struct {
	Data []rules.PromotedResult `` /* 202-byte string literal not displayed */
}

Promote results input schema

type RSAPIHitSource

type RSAPIHitSource struct {
	ID     *string                 `json:"_id,omitempty"`
	Source *map[string]interface{} `json:"_source,omitempty"`
}

type RSAPIResponseNestedHit

type RSAPIResponseNestedHit struct {
	Hits *[]RSAPIHitSource `json:"hits,omitempty"`
}

type RSAPIResponseToExtractHit

type RSAPIResponseToExtractHit struct {
	Hits *RSAPIResponseNestedHit `json:"hits,omitempty"`
}

RSAPIResponseToExtractHit

type ReactiveSearchQueryContext

type ReactiveSearchQueryContext struct {
	// contains filtered or unexported fields
}

To store reactive search query

func (*ReactiveSearchQueryContext) Get

To retrive the global script context

func (*ReactiveSearchQueryContext) Put

To update the status for a stage by id

type ReactiveSearchQueryInput

type ReactiveSearchQueryInput struct {
	Backend querytranslate.Backend `` /* 128-byte string literal not displayed */
}

type RemoveWordsInput

type RemoveWordsInput struct {
	Data []string `` /* 149-byte string literal not displayed */
}

Remove words input schema

type ReplaceSearchInput

type ReplaceSearchInput struct {
	Data string `` /* 144-byte string literal not displayed */
}

replace search input schema

type ReplaceWordsInput

type ReplaceWordsInput struct {
	Data map[string]string `` /* 149-byte string literal not displayed */
}

Replace words input schema

type ReqModificationHandler

type ReqModificationHandler func(req *querytranslate.RSQuery, data *string) error

ReqModificationHandler is a type of function that modifies the request

type Request

type Request struct {
	Method  string              `json:"method"`
	Body    string              `json:"body"`
	Headers map[string][]string `json:"headers"`
	URI     string              `json:"uri"`
}

Request stores the request passed to the pipeline

type ResModificationHandler

type ResModificationHandler func(responseBody []byte, data *string) ([]byte, error)

ResModificationHandler is a type of function that modifies the response

type Response

type Response struct {
	Body    string              `json:"body"`
	Headers map[string][]string `json:"headers"`
	Code    int                 `json:"code"`
}

Response stores the response returned by the pipeline

type SearchRelevancyStruct

type SearchRelevancyStruct struct {
	Search     *querytranslate.Query `` /* 258-byte string literal not displayed */
	Suggestion *querytranslate.Query `` /* 266-byte string literal not displayed */
	Term       *querytranslate.Query `` /* 254-byte string literal not displayed */
	Range      *querytranslate.Query `` /* 256-byte string literal not displayed */
	Geo        *querytranslate.Query `` /* 252-byte string literal not displayed */
}

type SearchboxPreferencesStruct

type SearchboxPreferencesStruct struct {
	Id *string `` /* 147-byte string literal not displayed */
}

type SolrInput

type SolrInput struct {
	Protocol          *string            `` /* 130-byte string literal not displayed */
	Host              *string            `` /* 131-byte string literal not displayed */
	App               *string            `json:"app,omitempty" jsonschema:"title=App" jsonschema_description:"App to search the query in. Example: 'appbase'"`
	Profile           *string            `` /* 137-byte string literal not displayed */
	SuggestionProfile *string            `` /* 196-byte string literal not displayed */
	Collection        *string            `` /* 146-byte string literal not displayed */
	Credentials       *string            `` /* 152-byte string literal not displayed */
	Headers           *map[string]string `json:"headers,omitempty" jsonschema:"title=Headers" jsonschema_description:"Headers to be passed in the Solr query request."`
	URI               *string            `` /* 269-byte string literal not displayed */
	Query             *string            `` /* 215-byte string literal not displayed */
	QueryString       *map[string]string `` /* 224-byte string literal not displayed */
}

type StageChange

type StageChange struct {
	ID      string  `json:"id"`
	Error   *string `json:"error"`
	Context *string `json:"context"`
	Took    *int    `json:"took"`
}

StageChange stores the changes happened in the stage

func GetStageChange

func GetStageChange(stageID string, stageChanges *[]*StageChange) *StageChange

GetStageChange will get the stageChange for the passed ID.

It will first check if the stage is already present, if so it will return that stage. If it is not present, then a new one will be created, appended to the array and then returned.

type StageLogTracker

type StageLogTracker struct {
	// contains filtered or unexported fields
}

func (*StageLogTracker) Get

func (c *StageLogTracker) Get(stageId string) []string

To update the status for a stage by id

func (*StageLogTracker) Put

func (c *StageLogTracker) Put(stageId string, value *[]string)

To update the status for a stage by id

type StageStatus

type StageStatus struct {
	IsRunning   bool // in progress status for stage; true when stage is started
	IsCompleted bool // completion status for stage
	IsSkipped   bool // skipped status for stage
	Needs       []string
}

type StageStatusMap

type StageStatusMap struct {
	// contains filtered or unexported fields
}

func (*StageStatusMap) Get

func (c *StageStatusMap) Get(key string) StageStatus

To retrive the stage status for a stage by id

func (*StageStatusMap) PutCompleteStatus

func (c *StageStatusMap) PutCompleteStatus(key string, value bool)

To update the status for a stage by id

func (*StageStatusMap) PutRunningStatus

func (c *StageStatusMap) PutRunningStatus(key string, value bool)

To update the status for a stage by id

func (*StageStatusMap) PutSkippedStatus

func (c *StageStatusMap) PutSkippedStatus(key string, value bool)

PutSkippedStatus will update the skipped status of the stage

type Trigger

type Trigger struct {
	Expression string `` /* 213-byte string literal not displayed */
}

type ValidateIDToConsoleLogs

type ValidateIDToConsoleLogs struct {
	// contains filtered or unexported fields
}

ValidateIDToConsoleLogs will contain the console logs against the validateId.

This will only store the logs in case a validate request was made with at-least one background script.

func ValidateSessionOnce

func ValidateSessionOnce() *ValidateIDToConsoleLogs

func (*ValidateIDToConsoleLogs) AddLogs

func (v *ValidateIDToConsoleLogs) AddLogs(validateId string, logs *StageLogTracker, timeTaken *BackgroundStageToTime)

func (*ValidateIDToConsoleLogs) GetLogs

func (v *ValidateIDToConsoleLogs) GetLogs(validateId string) *DelayedStageLogTracker

func (*ValidateIDToConsoleLogs) Register

func (v *ValidateIDToConsoleLogs) Register(validateId string) *DelayedStageLogTracker

type ValidateResponse

type ValidateResponse struct {
	ConsoleLogs  *interface{}   `json:"console_logs,omitempty"`
	Request      *interface{}   `json:"request,omitempty"`
	Response     *interface{}   `json:"response,omitempty"`
	Envs         *interface{}   `json:"envs,omitempty"`
	Took         *int           `json:"took,omitempty"`
	StageChanges *[]interface{} `json:"stageChanges,omitempty"`
}

ValidateResponse will return the validate endpoints response

type Version

type Version struct {
	Content     *string `json:"content,omitempty"`
	Version     *int    `json:"version,omitempty"`
	Description *string `json:"description,omitempty"`
}

Version will be similar to Config and will contain content and type along with version info.

`content` will be a stringified JSON of ESPipelineDoc that should be directly unmarshallable into the ESPipelineDoc object.

func GetPipelineVersion

func GetPipelineVersion(pipeline ESPipelineDoc, version int) (*Version, *int)

GetPipelineVersion will get the pipeline version from the pipelines versions. If not present, it will return nil which would indicate not found.

type ZincInput

type ZincInput struct {
	Protocol        *string            `` /* 130-byte string literal not displayed */
	Host            *string            `` /* 129-byte string literal not displayed */
	URL             *string            `` /* 248-byte string literal not displayed */
	Headers         *map[string]string `json:"headers,omitempty" jsonschema:"title=Headers" jsonschema_description:"Headers to be passed in the Zinc request."`
	Credentials     *string            `` /* 150-byte string literal not displayed */
	IndependentBody *string            `` /* 173-byte string literal not displayed */
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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