config

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: Apache-2.0 Imports: 3 Imported by: 8

README

Config

Provide a configuration manager for application.

Example

package main

import "gitee.com/go-libs/config"

type Config struct {
    Name string `yaml:"name"`
}

func main() {
  v := &Config{}
  err := config.Seek("app.yaml").ScanYaml(v)
  if err != nil {
      println("load config error:", err.Error())
      return
  }

  println("load succeed")
}

Documentation

Overview

Package config provides a configuration manager.

Index

Constants

This section is empty.

Variables

View Source
var (
	Location location.Location
)

Functions

This section is empty.

Types

type Resource

type Resource = resource.Resource

func Seek

func Seek(names ...string) Resource

Seek config resource with given names. Break if any resource found.

config.Seek("app.yaml", "app.yml")

Directories

Path Synopsis
examples
seek command
src

Jump to

Keyboard shortcuts

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