models

package
v0.0.0-...-37b99e7 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package models contains models that are not stored in a data store such as resource configuration and environment details

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	Host     string `yaml:"host" json:"host" mapstructure:"host"`
	Username string `yaml:"username" json:"username" mapstructure:"username"`
	Password string `yaml:"password" json:"password" mapstructure:"password"`
	Type     string `yaml:"type" json:"type" mapstructure:"type"`
}

Cache struct to hold Redis configuration

type Config

type Config struct {
	Kafka       map[string]interface{} `yaml:"kafka" json:"kafka" mapstructure:"kafka"`
	Database    Database               `yaml:"database" json:"database" mapstructure:"database"`
	Cache       Cache                  `yaml:"cache" json:"cache" mapstructure:"cache"`
	Server      Server                 `yaml:"server" json:"server" mapstructure:"server"`
	Sentry      SentryConfig           `yaml:"sentry" json:"sentry" mapstructure:"sentry"`
	Environment string                 `yaml:"enviornment" json:"environment" mapstructure:"environment"`
	SessionKey  string                 `yaml:"session_key" json:"session_key" mapstructure:"session_key"`
	DocDB       DocumentDatabase       `yaml:"docdb" json:"docdb" mapstructure:"docdb"`
	NewRelic    NewRelicConfig         `yaml:"new_relic" json:"new_relic" mapstructure:"new_relic"`
	Audit       bool                   `yaml:"audit" json:"audit" mapstructure:"audit"`
}

Config main configuration struct for the service

func GetConfig

func GetConfig(in string) (*Config, error)

GetConfig retrieves the Viper configuration for the service

func NewConfig

func NewConfig() *Config

NewConfig returns an empty configuration

func (*Config) GetKafkaConfig

func (c *Config) GetKafkaConfig() *kafka.ConfigMap

GetKafkaConfig retrieves a Kafka.ConfigMap compatible struct from our configuration. Viper supports nested configuration. However, we need a flatten struct for Kafka

type Database

type Database struct {
	Username   string `yaml:"username" json:"username" mapstructure:"username"`
	Password   string `yaml:"password" json:"password" mapstructure:"password"`
	Host       string `yaml:"host" json:"host" mapstructure:"host"`
	Name       string `yaml:"name" json:"name" mapstructure:"name"`
	Parameters string `yaml:"parameters" json:"parameters" mapstructure:"parameters"`
}

Database Cache struct to hold Postgres configuration

type DocumentDatabase

type DocumentDatabase struct {
	Username string `yaml:"username" json:"username" mapstructure:"username"`
	Password string `yaml:"password" json:"password" mapstructure:"password"`
	Host     string `yaml:"host" json:"host" mapstructure:"host"`
	Name     string `yaml:"name" json:"name" mapstructure:"name"`
	Timeout  string `yaml:"timeout" json:"timeout" mapstructure:"timeout"`
	DNSSeed  bool   `yaml:"dns_seed" json:"dns_seed" mapstructure:"dns_seed"`
}

DocumentDatabase Cache struct to hold MongoDB configuration

type NewRelicConfig

type NewRelicConfig struct {
	AppName          string `yaml:"app_name" json:"app_name" mapstructure:"app_name"`
	License          string `yaml:"license" json:"license" mapstructure:"license"`
	Enabled          bool   `yaml:"enabled" json:"enabled" mapstructure:"enabled"`
	AppLogForwarding bool   `yaml:"app_log_forwarding" json:"app_log_forwarding" mapstructure:"app_log_forwarding"`
}

NewRelicConfig configuration for New Relic

type SentryConfig

type SentryConfig struct {
	DSN     string `yaml:"dsn" json:"dsn" mapstructure:"dsn"`
	Enabled bool   `yaml:"enabled" json:"enabled" mapstructure:"enabled"`
}

SentryConfig configuration for Sentry

type Server

type Server struct {
	Timeout string `yaml:"timeout" json:"timeout" mapstructure:"timeout"`
	Port    int    `yaml:"port" json:"port" mapstructure:"port"`
}

Server struct to hold web server configuration

Jump to

Keyboard shortcuts

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