Skip to content

Go Properties is a property file loader for golang projects without any additional dependency except golang core components

License

Notifications You must be signed in to change notification settings

svenschaper/goproperties

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Go Properties

Summary


Go Properties is a property file loader for golang projects without any additional dependency except golang core components. At the moment the property loader is able to open configuration files and read key value pairs. More complex structures like arrays or nested objects are not supported yet but will be extended soon. The property loader provides a method to check a named property inside a file. The property file itlsef will be initialized as a singelton.

Set Up

Download the project

go get https://github.com/svenschaper/goproperties

Import the package into your go File

import "github.com/svenschaper/goproperties"

How to use?

Add the following to your go files

var prop *properties.Propertie

func init() {
	properties.SetPropertiePath("path/to/your/config.yml")
    p, err := properties.LoadProperty()
    if err != nil {
        fmt.Errorf(err.Error())
    }
	prop = p
}

func yourFunction(){
    value := prop.GetProperty("yourkey")
}


Need custom development?

Cloud Computing

  • Infrastructure automation based on ansible
  • Custom solutions based on AWS
  • Custom solutions based on Google Cloud
  • Custom solutions based on Azure Cloud

Integration

  • API Management and Design
  • Lightning fast Microservices based on Golang

License

MIT licensed. In short -> Have fun with it!

About

Go Properties is a property file loader for golang projects without any additional dependency except golang core components

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages