Categorygithub.com/keloran/go-config
modulepackage
1.3.0
Repository: https://github.com/keloran/go-config.git
Documentation: pkg.go.dev

# README

Config Builder

This is the config builder for most of my projects rather than keep writing the same code over and over again

Build only Local and Vault

cfg, err := config.Build(config.Local, config.Vault)

This can be used with local config services

type Config struct {
  config.Config
  LocalStuffs
}

type LocalStuffs struct {
  Stuff string
}

func main() {
  cfg, err := config.Build(config.Local, config.Vault)
  if err != nil {
    panic(err)
  }

  c := Config{}
  c.Config = cfg
  c.LocalStuffs = &LocalStuffs{
    Stuff: "here"
  }
}

This is how to create a project configuration

above is the old way, the new way is

import (
 ConfigBuilder "github.com/keloran/go-config"
)

type ProjectConfig struct {}

func (pc ProjectConfig) Build(cfg *ConfigBuilder) error {
  if cfg.ProjectProperties == nil {
    c.ProjectProperties = make(map[string]interface{})
  }

  c.ProjectProperties["TestProperty"] = true
  return nil
}

func main() {
  cfg, err := ConfigBuilder.Build(WithProjectConfigurator(ProjectConfig{}))
  if err != nil {
    panic(err)
  }

  fmt.Printf(cfg.ProjectProperies["TestProperty"])
}

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Package mock_mongo is a generated GoMock package.
No description provided by the author
No description provided by the author

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author

# Interfaces

No description provided by the author

# Type aliases

No description provided by the author