Documentation ¶
Index ¶
Constants ¶
View Source
const (
KegTimestampLayout = "2006-01-02 15:04:05Z"
)
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Dex ¶
type Dex struct { // Nodes is a slice containing all of the [Node] entries in the KEG. Nodes []Node }
Dex is an index of nodes
func DexFromNodesTsv ¶
DexFromNodesTsv converts a TSV represented in a string into a Dex struct, using the format "(id)\t(created)\t(title)".
dex, err := libkeg.DexFromNodesTsv("1\t2022-12-11 22:32:00Z\tHello, world!")
type KegInfo ¶
type KegInfo struct { Title string `yaml:"title" json:"title"` Kegv *string `yaml:"kegv" json:"kegv"` Creator *string `yaml:"creator" json:"creator"` State *string `yaml:"state" json:"state"` Updated KegTimestamp `yaml:"updated" json:"updated"` Summary *string `yaml:"summary" json:"summary"` Urls []string `yaml:"urls" json:"urls"` Indexes []KegIndex `yaml:"indexes" json:"indexes"` }
func KegInfoFromYaml ¶
type KegTimestamp ¶
func (*KegTimestamp) MarshalYAML ¶
func (kt *KegTimestamp) MarshalYAML() (interface{}, error)
func (*KegTimestamp) UnmarshalYAML ¶
func (kt *KegTimestamp) UnmarshalYAML(value *yaml.Node) error
type Node ¶
type Node struct { // Id is the incrementing ID of the KEG node. Id int `yaml:"id" json:"id"` // Created is the time the KEG node was created. Created KegTimestamp `yaml:"created" json:"created"` // Title is the string title of the KEG node. Title string `yaml:"title" json:"title"` }
Node represents a KEG node of any type.
func NodeFromTsvSlice ¶
NodeFromTsvSlice converts a slice formatted as [id, created, title] info a Node, returning an error if the record is invalid.
node, err := libkeg.NodeFromTsvSlice([]string{"1", "2022-12-11 22:33:00Z", "Hello, world!"})
Click to show internal directories.
Click to hide internal directories.