config

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

README

Config

ConsulKV

package main

import (
    "github.com/axolotlteam/thunder/config"
)

func main() {
    v , err := config.ConsulKV("consulhost" , "key" , "ftype{json/yaml}")
    if err != nil {
        log.Fatal(err)
    }

    v.GetString("xxx.xxx")


    x := config.Database{}

    // maping to struct
    err := viper.Unmarshal(&x)

}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConsulKV

func ConsulKV(host, key string, ftype string) (*viper.Viper, error)

ConsulKV -

Types

type Database

type Database struct {
	Host       string `json:"host" yaml:"host"`
	User       string `json:"user" yaml:"user"`
	Password   string `json:"password" yaml:"password"`
	Database   string `json:"database" yaml:"database"`
	Collection string `json:"collection" yaml:"collection"`
	SSL        bool   `json:"ssl" yaml:"ssl"`
}

Database -

type Logger

type Logger struct {
	Level   string `json:"level" yaml:"level"`
	Webhook string `json:"webhook" yaml:"webhook"`
}

Logger -

Jump to

Keyboard shortcuts

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