Documentation ¶
Index ¶
- Constants
- Variables
- type Dimension
- type History
- type HistoryOption
- type Option
- type Repo
- func (r *Repo) DimensionUpdateRoutine(ctx context.Context) error
- func (r *Repo) Directory() map[string]*Dimension
- func (r *Repo) GetContent(req *requests.Content) (*content.SiteContent, error)
- func (r *Repo) GetNodes(nodes *requests.Nodes) map[string]*content.Node
- func (r *Repo) GetRepo() map[string]*content.RepoNode
- func (r *Repo) GetURIs(dimension string, ids []string) map[string]string
- func (r *Repo) JSONBufferBytes() []byte
- func (r *Repo) Loaded() bool
- func (r *Repo) OnLoaded(fn func())
- func (r *Repo) PollRoutine(ctx context.Context) error
- func (r *Repo) SetDirectory(v map[string]*Dimension)
- func (r *Repo) SetJSONBuffer(v *bytes.Buffer)
- func (r *Repo) Start(ctx context.Context) error
- func (r *Repo) Update() (updateResponse *responses.Update)
- func (r *Repo) UpdateRoutine(ctx context.Context) error
- func (r *Repo) WriteRepoBytes(w io.Writer)
- type RepoDimension
Constants ¶
View Source
const ( HistoryRepoJSONPrefix = "contentserver-repo-" HistoryRepoJSONSuffix = ".json" )
Variables ¶
View Source
var (
ErrUpdateRejected = errors.New("update rejected: queue full")
)
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 History ¶
type History struct {
// contains filtered or unexported fields
}
func NewHistory ¶
func NewHistory(l *zap.Logger, opts ...HistoryOption) *History
func (*History) GetCurrentFilename ¶
type HistoryOption ¶
type HistoryOption func(*History)
func HistoryWithHistoryDir ¶
func HistoryWithHistoryDir(v string) HistoryOption
func HistoryWithHistoryLimit ¶
func HistoryWithHistoryLimit(v int) HistoryOption
type Option ¶
type Option func(*Repo)
Repo content repository
func WithHTTPClient ¶
func WithPollInterval ¶
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
Repo content repository
func (*Repo) DimensionUpdateRoutine ¶
func (*Repo) GetContent ¶
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) JSONBufferBytes ¶
func (*Repo) SetDirectory ¶
func (*Repo) SetJSONBuffer ¶
func (*Repo) WriteRepoBytes ¶
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>}
type RepoDimension ¶
Click to show internal directories.
Click to hide internal directories.