Documentation

Index

Constants

View Source
const (
	// DEV represents development environment
	DEV = "develop"
	// PRD represents production environment
	PRD = "production"
	// DOC represents docker container
	DOC = "docker"
)

Variables

This section is empty.

Functions

func GetEnv

func GetEnv() *string

    GetEnv returns the environment variable.

    func Load

    func Load()

      Load reads the settings written to the yml file

      func SetConfig

      func SetConfig(conf *Config)

        SetConfig sets configuration data.

        Types

        type Config

        type Config struct {
        	Database struct {
        		Dialect   string `default:"sqlite3"`
        		Host      string `default:"book.db"`
        		Port      string
        		Dbname    string
        		Username  string
        		Password  string
        		Migration bool `default:"false"`
        	}
        	Redis struct {
        		Enabled            bool `default:"false"`
        		ConnectionPoolSize int  `yaml:"connection_pool_size" default:"10"`
        		Host               string
        		Port               string
        	}
        	Extension struct {
        		MasterGenerator bool `yaml:"master_generator" default:"false"`
        		CorsEnabled     bool `yaml:"cors_enabled" default:"false"`
        		SecurityEnabled bool `yaml:"security_enabled" default:"false"`
        	}
        	Log struct {
        		RequestLogFormat string `yaml:"request_log_format" default:"${remote_ip} ${account_name} ${uri} ${method} ${status}"`
        	}
        	Security struct {
        		ExculdePath []string `yaml:"exclude_path"`
        		UserPath    []string `yaml:"user_path"`
        		AdminPath   []string `yaml:"admin_path"`
        	}
        }

          Config represents the composition of yml settings.

          func GetConfig

          func GetConfig() *Config

            GetConfig returns the configuration data.

            Source Files