Documentation ¶
Index ¶
- Constants
- func SetDefaults()
- type Config
- func (c *Config) GetEnvConfig(envName string) (env Environment)
- func (c *Config) GetEnvGroupTopics(envName, groupID string) (topics []Topic)
- func (c *Config) GetEnvGroups(envName string) (groups []Group)
- func (c *Config) GetEnvTopics(envName string) (topics []Topic)
- func (c *Config) GetEnvsList() (list []string)
- func (c *Config) GetFirstRun() bool
- func (c *Config) GetPort() string
- func (c *Config) GetURL() string
- func (c *Config) SetDefaults()
- func (c *Config) SetFirstRun(v bool)
- func (c *Config) SetLockFile(_ lockfile.Lockfile)
- type EnvSchemas
- type EnvVars
- type Environment
- func (e *Environment) AllTopicsExist(keys []string) (exist bool)
- func (e *Environment) FindTopic(key string) (v Topic, err error)
- func (e *Environment) FindTopicValues(keys []string) (values []string, err error)
- func (e *Environment) FindTopics(keys []string) (topics []Topic, err error)
- func (e *Environment) GetTopic(value string) (v Topic, err error)
- type Group
- type Header
- type Topic
- type TopicSchema
Constants ¶
const ( // AppDirName application's directory name. AppDirName = "felice-n-franz" // AppName application name. AppName = "Felice & Franz" // DefaultServerAPIVersion idem. DefaultServerAPIVersion = "/api/v1" // DefaultCA Kafka Certificate's filename. DefaultCA = "kafkacert.pem" // DefaultPort application's default port. DefaultPort = 9191 )
const (
// CurrentConfigFileVersion current or default config file version.
CurrentConfigFileVersion = 1
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Version int `json:"version"` FirstRun bool `json:"firstRun"` Port int `json:"port"` Envs []Environment `json:"envs"` }
Config implements the rtc.Config interface.
func Validate ¶ added in v0.59.3
func Validate() *Config
Validate validates application's configuration.
func (*Config) GetEnvConfig ¶
func (c *Config) GetEnvConfig(envName string) (env Environment)
GetEnvConfig returns the configuration for the given environment.
func (*Config) GetEnvGroupTopics ¶
GetEnvGroupTopics returns the list of topics in a given group, for a given environment.
func (*Config) GetEnvGroups ¶
GetEnvGroups returns the list of groups in the given environment.
func (*Config) GetEnvTopics ¶
GetEnvTopics returns the list of topics for the given environment.
func (*Config) GetEnvsList ¶
GetEnvsList returns the list of availablr environments.
func (*Config) GetFirstRun ¶ added in v0.59.3
func (*Config) SetDefaults ¶ added in v0.59.3
func (c *Config) SetDefaults()
func (*Config) SetFirstRun ¶ added in v0.59.3
func (*Config) SetLockFile ¶ added in v0.60.0
type Environment ¶
type Environment struct { Name string `json:"name"` Active bool `json:"active"` AssignConsumer bool `json:"assignConsumer"` Configuration kafka.ConfigMap `json:"configuration"` Vars EnvVars `json:"vars"` HeaderPrefix string `json:"headerPrefix"` TopicsFrom string `json:"inheritFrom"` Schemas EnvSchemas `json:"schemas"` Topics []Topic `json:"topics"` Groups []Group `json:"groups"` }
Environment defines a topics environment. FIXME: DEPRECATE AssignConsumer
func (*Environment) AllTopicsExist ¶
func (e *Environment) AllTopicsExist(keys []string) (exist bool)
AllTopicsExist check if all topics exist for the given keys.
func (*Environment) FindTopic ¶
func (e *Environment) FindTopic(key string) (v Topic, err error)
FindTopic looks for topic by key.
func (*Environment) FindTopicValues ¶
func (e *Environment) FindTopicValues(keys []string) (values []string, err error)
FindTopicValues looks for all topics in the given keys list.
func (*Environment) FindTopics ¶
func (e *Environment) FindTopics(keys []string) (topics []Topic, err error)
FindTopics looks for all topics in the given keys list.
type Group ¶
type Group struct { Name string `json:"name"` Description string `json:"description"` Category string `json:"category"` ID string `json:"id"` Keys []string `json:"keys"` }
Group defines a group of topics.
type Topic ¶
type Topic struct { Name string `json:"name"` Description string `json:"description"` Key string `json:"key"` Value string `json:"value"` GroupID string `json:"groupId"` Headers []Header `json:"headers"` Schema TopicSchema `json:"schema"` }
Topic defines a topic structure.
type TopicSchema ¶
type TopicSchema map[string]interface{}
TopicSchema defines the applicable JSON schema.