Skip to content

fanap-infra/conf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HOCON Docs.

stream.conf

rtsp {
    timeout {
        rtp = 5s
        txt = "Hossein"
    }
}

example.go

package main

import (
	"fmt"
	"github.com/fanap-infra/conf"
)

func main() {
	if fileName, err := conf.Open(os.Getenv("EXAMPLE_CONF"), "stream.dev.conf", "stream.conf"); err != nil {
		fmt.Printf("Error: %v\n", err)
	} else {
		fmt.Printf("Load config from %s", fileName)
	}

	fmt.Println(conf.GetString("rtsp.timeout.txt"))
	fmt.Println(conf.GetTimeDuration("rtsp.timeout.rtp"))
}