docs

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package docs provides storage and retrieval for a series of data points based around a tree structure of page content.

The content loaded within this tree has no bearing on the source location, these 2 concepts should be kept separate (there may be loading of data from separate sources and combined into a single cohesive interface).

Index

Constants

This section is empty.

Variables

View Source
var (
	// S is a singleton instance of the current docs storage.
	S = &Store{}
)

Functions

This section is empty.

Types

type Dir

type Dir struct {
	Children []*Dir `json:"children"`
	Icon     string `json:"icon"`
	IconAlt  string `json:"icon-alt"`
	Model    bool   `json:"model"`
	Path     string `json:"path"`
	Text     string `json:"text"`
}

Dir gives a holder of further nodes.

type Store

type Store struct {
	// Dirs tracks the structure of pages under their paths.
	Dirs []*Dir `json:"pages"`

	// Pages captures the content for a full path page.
	Pages map[string]*autodocs.Page `json:"-"`
	// contains filtered or unexported fields
}

Store captures the doc file references and content.

func (*Store) UpdateFromPath

func (s *Store) UpdateFromPath(p string)

UpdateFromPath will accept a base path location and walk the directory structure to find appropriate files to be pulled in to memory for serving.

Jump to

Keyboard shortcuts

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