server

package
v2.0.0-dev.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 64 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EtcOsRelease    string = "/etc/os-release"
	UsrLibOsRelease string = "/usr/lib/os-release"
)
View Source
const (
	ContentType     = "Content-Type"
	ContentTypeJSON = "application/json"
)

Variables

View Source
var (
	NativeSourcePlugin   = []string{"random", "zmq", "sql", "video", "kafka"}
	NativeSinkPlugin     = []string{"image", "influx", "influx2", "tdengine", "zmq", "kafka", "sql"}
	NativeFunctionPlugin = []string{"accumulateWordCount", "countPlusOne", "echo", "geohash", "image", "labelImage", "tfLite"}
)

Functions

func InitConfManagers

func InitConfManagers()

func Read

func Read() (osrelease map[string]string, err error)

Read and return os-release, trying EtcOsRelease, followed by UsrLibOsRelease. err will contain an error message if neither file exists or failed to parse

func ReadFile

func ReadFile(filename string) (osrelease map[string]string, err error)

Similar to Read(), but takes the name of a file to load instead

func ReadString

func ReadString(content string) (osrelease map[string]string, err error)

ReadString is similar to Read(), but takes a string to load instead

func StartUp

func StartUp(Version string)

Types

type ConfManager

type ConfManager interface {
	Import(map[string]string) map[string]string
	PartialImport(map[string]string) map[string]string
	Export() map[string]string
	Status() map[string]string
	Reset()
}

type Configuration

type Configuration struct {
	Streams          map[string]string `json:"streams"`
	Tables           map[string]string `json:"tables"`
	Rules            map[string]string `json:"rules"`
	NativePlugins    map[string]string `json:"nativePlugins"`
	PortablePlugins  map[string]string `json:"portablePlugins"`
	SourceConfig     map[string]string `json:"sourceConfig"`
	SinkConfig       map[string]string `json:"sinkConfig"`
	ConnectionConfig map[string]string `json:"connectionConfig"`
	Service          map[string]string `json:"Service"`
	Schema           map[string]string `json:"Schema"`
	Uploads          map[string]string `json:"uploads"`
	Scripts          map[string]string `json:"scripts"`
}

type ImportConfigurationStatus

type ImportConfigurationStatus struct {
	ErrorMsg       string
	ConfigResponse Configuration
}

type InstallScriptGetter

type InstallScriptGetter interface {
	InstallScript(s string) (string, string)
}

type Metrics

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

func NewMetrics

func NewMetrics() *Metrics

func (*Metrics) GetCpuUsage

func (m *Metrics) GetCpuUsage() string

func (*Metrics) GetMemoryUsage

func (m *Metrics) GetMemoryUsage() string

type RuleMigrationProcessor

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

func (*RuleMigrationProcessor) ConfigurationPartialExport

func (p *RuleMigrationProcessor) ConfigurationPartialExport(rules []string) ([]byte, error)

type RuleRegistry

type RuleRegistry struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*RuleRegistry) Delete

func (rr *RuleRegistry) Delete(key string) (*rule.RuleState, bool)

Delete Atomic get and delete. Only run when deleting a rule in runtime.

func (*RuleRegistry) Load

func (rr *RuleRegistry) Load(key string) (value *rule.RuleState, ok bool)

Load the entry of a rule by id. It is used to get the current rule state or send command to a running rule

func (*RuleRegistry) Store

func (rr *RuleRegistry) Store(key string, value *rule.RuleState)

Store create the in memory entry for a rule. Run in: 1. Restore the rules from KV at startup 2. Restore the rules when importing 3. Create a rule

type RuleStatusMetricsValue

type RuleStatusMetricsValue int
const (
	RuleStoppedByError RuleStatusMetricsValue = -1
	RuleStopped        RuleStatusMetricsValue = 0
	RuleRunning        RuleStatusMetricsValue = 1
)

type UpdateRuleStateType

type UpdateRuleStateType int
const (
	UpdateRuleState UpdateRuleStateType = iota
	UpdateRuleOffset
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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