This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/"> | |
<ShortName>Pistarlabs.com</ShortName> | |
<Description>Pistarlabs Search</Description> | |
<InputEncoding>UTF-8</InputEncoding> | |
<Url type="text/html" method="GET" template="http://pistarlabs.com/blog/?s={searchTerms}"/> | |
<Url type="application/opensearchdescription+xml" rel="self" template="http://www.pistarlabs.com/opensearch.xml"/> | |
<moz:SearchForm>http://www.pistarlabs.com/blog</moz:SearchForm> | |
</OpenSearchDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="image_src" href="http://www.pistarlabs.com/assets/img/default.jpg" /> | |
<meta property="og:title" content="Pistarlabs.com, Web Application Developer in Jakarta Indonesia"/> | |
<meta property="og:image" content="http://www.pistarlabs.com/assets/img/default.jpg"/> | |
<meta property="og:site_name" content="Pistarlabs"/> | |
<meta property="og:description" content="Pistarlabs is web application developer specialist and consultant based in Jakarta, Indonesia."/> | |
<meta property="og:type" content="website" /> | |
<meta property="og:street-address" content="Cikoko Barat I no 24"/> | |
<meta property="og:locality" content="Jakarta"/> | |
<meta property="og:region" content="DKI Jakarta"/> | |
<meta property="og:postal-code" content="12770"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"development": { | |
"database": { | |
"host":"localhost", | |
"username":"root", | |
"password":"12345", | |
"port":12345, | |
"name":"dev" | |
} | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cfg, err := Load("/path/to/config.json") | |
if err != nil { | |
panic(err) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get development environment configuration | |
cfg, err = cfg.Get("development") | |
if err != nil { | |
panic(err) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get database host or return empty string if not exists | |
host := cfg.UString("database.host") | |
// Get database host or return default passed value if not exists | |
host := cfg.UString("database.host", "default") | |
// Get database host and error | |
host, err := cfg.String("database.host") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/pistarlabs/configs" | |
) | |
func main() { | |
// Initialize config |