// Public Domain (-) 2018-present, The Peerbase Authors. // See the Peerbase UNLICENSE file for details. package config import ( "bytes" "github.com/pelletier/go-toml" ) // Node blah type Node struct { LogLevel string `toml:"log.level"` Peers []Peer `toml:"peers"` Description string `toml:"description", multiline:"true"` } type Peer struct { NodeID uint64 Keys Keys } type Keys struct { SigningKey *Key `yaml:"signing.key"` TransportCert *Key `yaml:"transport.cert"` } // Key represents a cryptographic key of some kind. type Key struct { Type string Public string `multiline:"true"` Private string `yaml:",omitempty" multiline:"true"` } func (n *Node) docLogLevel() string { return `The level to log at. Can be one of: debug info error ` } func (n *Node) docPeers() string { return `hewwo` } // ExampleYAML encodes the given value into YAML and uses any commented fields // in the source of. func ExampleYAML(v interface{}) ([]byte, error) { // out, err := toml.Marshal(v) buf := &bytes.Buffer{} // enc := toml.NewEncoder(buf).ArraysWithOneElementPerLine(true).QuoteMapKeys(true) enc := toml.NewEncoder(buf).ArraysWithOneElementPerLine(true) err := enc.Encode(v) return buf.Bytes(), err // return nil, nil }