repo

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: LGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dimension

type Dimension struct {
	Directory    map[string]*content.RepoNode
	URIDirectory map[string]*content.RepoNode
	Node         *content.RepoNode
}

Dimension dimension in a repo

type Repo

type Repo struct {
	Directory map[string]*Dimension
	// contains filtered or unexported fields
}

Repo content repositiory

func NewRepo

func NewRepo(server string, varDir string, repositoryTimeout time.Duration, pollForUpdates bool) *Repo

NewRepo constructor

func (*Repo) GetContent

func (repo *Repo) GetContent(r *requests.Content) (c *content.SiteContent, err error)

GetContent resolves content and fetches nodes in one call. It combines those two tasks for performance reasons.

In the first step it uses r.URI to look up content in all given r.Env.Dimensions of repo.Directory.

In the second step it collects the requested nodes.

those two steps are independent.

func (*Repo) GetNodes

func (repo *Repo) GetNodes(r *requests.Nodes) map[string]*content.Node

GetNodes get nodes

func (*Repo) GetRepo

func (repo *Repo) GetRepo() map[string]*content.RepoNode

GetRepo get the whole repo in all dimensions

func (*Repo) GetURIs

func (repo *Repo) GetURIs(dimension string, ids []string) map[string]string

GetURIs get many uris at once

func (*Repo) Recovered

func (repo *Repo) Recovered() bool

func (*Repo) Update

func (repo *Repo) Update() (updateResponse *responses.Update)

Update - reload contents of repository with json from repo.server

func (*Repo) WriteRepoBytes

func (repo *Repo) WriteRepoBytes(w io.Writer)

WriteRepoBytes get the whole repo in all dimensions reads the JSON history file from the Filesystem and copies it directly in to the supplied buffer the result is wrapped as service response, e.g: {"reply": <contentData>}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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