edict

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

README

edict

Example

import (
  "github.com/ChaosHQ/common-lib/edict"
  "fmt"
)

err := edict.Load("config.json")
if err != nil {
  panic(err)
}

// use like this
fmt.Println(fmt.Sprintf("Name: %s", edict.Config.Name))
fmt.Println(fmt.Sprintf("Listen URL: %s", edict.Config.ListenURL))

Documentation

Overview

Package edict ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(filePath string) error

Load ...

Types

type Configuration

type Configuration struct {
	Name        string         `yaml:"Name" json:"Name"`
	APIVersion  string         `yaml:"APIVersion" json:"APIVersion"`
	Environment string         `yaml:"Environment" json:"Environment"`
	ListenURL   string         `yaml:"ListenURL" json:"ListenURL"`
	URLPrefix   string         `yaml:"URLPrefix" json:"URLPrefix"`
	Version     Version        `yaml:"Version" json:"Version"`
	Log         log.Config     `yaml:"Log" json:"Log"`
	MongoDB     mongodb.Config `yaml:"MongoDB" json:"MongoDB"`
}

Configuration ...

var (
	// Config ...
	Config *Configuration
)

type Version

type Version struct {
	ServiceName     string `yaml:"ServiceName" json:"ServiceName"`
	ServiceProvider string `yaml:"ServiceProvider" json:"ServiceProvider"`
	Major           string `yaml:"Major" json:"Major"`
	Minor           string `yaml:"Minor" json:"Minor"`
	Patch           string `yaml:"Patch" json:"Patch"`
}

Version ...

Jump to

Keyboard shortcuts

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