config

package
v0.0.0-...-d0bb578 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2019 License: MIT Imports: 5 Imported by: 1

Documentation

Overview

Package version contains global variables for nolint: gochecknoglobals, gochecknoinits

Index

Constants

View Source
const (
	FileName = ".mamba"

	// ServiceName defines short service name
	ServiceName = "Common boilerplate generator"
	// DefaultPostgresPort defines default port for PostgreSQL
	DefaultPostgresPort = 5432
	// DefaultMySQLPort defines default port for MySQL
	DefaultMySQLPort = 3306
	// Base declared base templates
	Base = "base"
	// GKE declared GKE accounts/cluster/deployment
	GKE = "gke"
	// API declared type API
	API = "api"
	// APIGateway declared type API gateway: REST
	APIGateway = "rest"
	// APIgRPC declared type API: gRPC
	APIgRPC = "grpc"
	// Contract declared contract API example
	Contract = "contract"
	// Storage declared type Storage
	Storage = "storage"
	// StoragePostgres declared storage driver type: postgres
	StoragePostgres = "postgres"
	// StorageMySQL declared storage driver type: mysql
	StorageMySQL = "mysql"
	// RELEASE returns the release version
	RELEASE = "UNKNOWN"
	// DATE returns the release date
	DATE = "UNKNOWN"
)

Variables

View Source
var Configuration = &Config{}
View Source
var (
	Viper = viper.New()
)

Functions

func Annotate

func Annotate(v *viper.Viper) map[string]string

func Read

func Read()

func Update

func Update()

Types

type Config

type Config struct {
	Project struct {
		Name        string `mapstructure:"project.name"`
		Description string `mapstructure:"project.description"`
		Github      string `mapstructure:"project.github"`
		Project     string `mapstructure:"project.project"`
		Bin         string `mapstructure:"project.bin"`
		GitInit     bool   `mapstructure:"project.gitinit"`
		Contract    bool   `mapstructure:"project.contract"`
	}
	GKE struct {
		Enabled bool   `mapstructure:"gke.enabled"`
		Project string `mapstructure:"gke.project"`
		Zone    string `mapstructure:"gke.zone"`
		Cluster string `mapstructure:"gke.cluster"`
	}
	Storage struct {
		Enabled  bool `mapstructure:"storage.enabled"`
		Postgres bool `mapstructure:"storage.posgres"`
		MySQL    bool `mapstructure:"storage.mysql"`
		Config   struct {
			Driver      string `mapstructure:"storage.comfig.driver"`
			Host        string `mapstructure:"storage.comfig.driver"`
			Port        int    `mapstructure:"storage.comfig.driver"`
			Name        string `mapstructure:"storage.comfig.driver"`
			Username    string `mapstructure:"storage.comfig.driver"`
			Password    string `mapstructure:"storage.comfig.driver"`
			Connections struct {
				Max  int `mapstructure:"storage.comfig.connections.max"`
				Idle int `mapstructure:"storage.comfig.connections.idle"`
			}
		}
	}
	API struct {
		Enabled bool `mapstructure:"api.enabled"`
		GRPC    bool `mapstructure:"api.grpc"`
		Gateway bool `mapstructure:"api.gateway"`
		Config  struct {
			Port    int `mapstructure:"api.config.port"`
			Gateway struct {
				Port int `mapstructure:"api.config.port"`
			}
		}
	}
	Directories struct {
		Templates string `mapstructure:"directories.templates"`
		Service   string `mapstructure:"directories.service"`
	}
	Docker struct {
		Endpoint  string `mapstructure:"docker.endpoint"`
		Dockerhub string `mapstructure:"docker.dockerhub"`
		Container struct {
			Image      string   `mapstructure:"docker.container.image"`
			Container  string   `mapstructure:"docker.container"`
			Args       []string `mapstructure:"docker.container.dependencies"`
			Env        []string `mapstructure:"docker.container.env"`
			Entrypoint []string `mapstructure:"docker.container.entrypoint"`
			Modules    bool     `mapstructure:"docker.container.modules"`
		}
	}
}

Config contains service configuration

func GetConfig

func GetConfig() *Config

Jump to

Keyboard shortcuts

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