parser

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	NATSMessagingType string = "nats"
	NATSDefaultURL    string = "nats://siddhi-nats:4222"
	ParserParameter   string = "-Dsiddhi-parser "
	ParserName        string = "parser"
	ParserHTTP        string = "http://"
	ParserExtension   string = "-parser"
	ParserHealth      string = ".svc.cluster.local:9090/health"
	ParserContext     string = ".svc.cluster.local:9090/siddhi-parser/parse"
	ParserPort        int32  = 9090
	ParserReplicas    int32  = 1
	ParserMinWait     int    = 3
	ParserMaxWait     int    = 10
	ParserMaxRetry    int    = 6
)

Constants for the parser

Variables

This section is empty.

Functions

func ContainsInt

func ContainsInt(slice []int, value int) (contain bool)

ContainsInt function to check given int is in the given slice or not

Types

type AppConfig

type AppConfig struct {
	SiddhiApp          string             `json:"siddhiApp"`
	DeploymentConfigs  []DeploymentConfig `json:"sourceDeploymentConfigs"`
	PersistenceEnabled bool               `json:"persistenceEnabled"`
	Replicas           int32              `json:"replicas"`
}

AppConfig holds response of the parser

type DeploymentConfig

type DeploymentConfig struct {
	ServiceProtocol string `json:"serviceProtocol"`
	Secured         bool   `json:"secured"`
	Port            int    `json:"port"`
	IsPulling       bool   `json:"isPulling"`
}

DeploymentConfig hold deployment configs of a particular siddhi app

type Parser

type Parser struct {
	Name            string
	Namespace       string
	Apps            []string
	Env             map[string]string
	MessagingSystem siddhiv1alpha2.MessagingSystem
	Request         Request
	Logger          logr.Logger
	KubeClient      artifact.KubeClient
	Image           deploymanager.Image
	SiddhiProcess   *siddhiv1alpha2.SiddhiProcess
}

Parser parse the application using parser deployment

func (*Parser) Parse

func (p *Parser) Parse() (applications []deploymanager.Application, err error)

Parse call MSF4J service and parse a given siddhiApp. Here parser call an endpoint according to the deployment type - default, failover, and distributed After that REST call, the siddhi parser returns relevant details of the deployment. This function get those details and encapsulate all the details into a common structure(SiddhiApp) regarless of the deployment type. Siddhi operator used this general SiddhiApp object to the further process.

type Request

type Request struct {
	Apps            []string                        `json:"siddhiApps"`
	PropertyMap     map[string]string               `json:"propertyMap"`
	MessagingSystem *siddhiv1alpha2.MessagingSystem `json:"messagingSystem,omitempty"`
}

Request is request struct of the siddhi-parser

Jump to

Keyboard shortcuts

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