configstore

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package configstore handles the configuration of WACE. The configuration file is parsed, checked for errors and loaded into memory

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigFileData

type ConfigFileData struct {
	Logpath         string
	Loglevel        string
	Modelplugins    []configFileModelPlugin
	Decisionplugins []configFileDecisionPlugin
	NatsURL         string
}

type ConfigStore

type ConfigStore struct {
	ModelPlugins    map[string]modelPluginConfig
	DecisionPlugins map[string]decisionPluginConfig
	LogPath         string
	LogLevel        lg.LogLevel
	NatsURL         string
	ApplicationId   string
}

ConfigStore stores all wacecore configuration from the config file.

func Get

func Get() *ConfigStore

Get returns or creates the unique instance of configstore

func (*ConfigStore) IsAsync

func (c *ConfigStore) IsAsync(modelID string) bool

IsAsync returns true if the model plugin is async

func (*ConfigStore) SetConfig

func (cs *ConfigStore) SetConfig(inConf ConfigFileData) error

SetConfig sets the configuration of WACE from the configuration file

type ModelPluginType

type ModelPluginType int

ModelPluginType is an enum listing the parts of a request or response that a model plugin can handle.

const (
	RequestHeaders ModelPluginType = iota
	RequestBody
	AllRequest
	ResponseHeaders
	ResponseBody
	AllResponse
	Everything
)

func StringToPluginType

func StringToPluginType(textType string) (ModelPluginType, error)

StringToPluginType converts a string to the corresponding model plugin type

func (ModelPluginType) String

func (t ModelPluginType) String() string

String returns the string representation of a model plugin type

Jump to

Keyboard shortcuts

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