meta

package
v4.4.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Package meta provides tool for reading metadata from services declaring "MetaProvider" support

Index

Constants

View Source
const (
	ServiceMetaProvider         = "MetaProvider"
	ServiceMetaProviderRequired = "MetaProviderRequired"
	ServiceMetaNsProvider       = "MetaNsProvider"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Loader

type Loader interface {
	io.Closer
	LoadMetas(ctx context.Context, nodes ...*tree.Node)
}

func NewStreamLoader

func NewStreamLoader(ctx context.Context, flags tree.Flags) Loader

type NsProvider

type NsProvider struct {
	sync.RWMutex // this handles a lock for the namespaces field
	Ctx          context.Context
	// contains filtered or unexported fields
}

NsProvider lists all namespaces info from services declared ServiceMetaNsProvider It watches events to maintain the list

func NewNsProvider

func NewNsProvider(ctx context.Context) *NsProvider

NewNsProvider creates a new namespace provider

func (*NsProvider) Clear

func (p *NsProvider) Clear()

Clear unload cached data to force reload at next call

func (*NsProvider) CloseStreamers

func (p *NsProvider) CloseStreamers() error

CloseStreamers closes all prepared streamer clients

func (*NsProvider) ExcludeIndexes

func (p *NsProvider) ExcludeIndexes() map[string]struct{}

ExcludeIndexes lists namespaces that should not be indexed by search engines

func (*NsProvider) IncludedIndexes

func (p *NsProvider) IncludedIndexes() map[string]struct{}

IncludedIndexes lists namespaces that should be indexed by search engines

func (*NsProvider) InitStreamers

func (p *NsProvider) InitStreamers(ctx context.Context) error

InitStreamers prepares a set of NodeProviderStreamerClients ready to be requested

func (*NsProvider) Load

func (p *NsProvider) Load()

Load finds all services declared as ServiceMetaNsProvider and call them to list the namespaces they declare

func (*NsProvider) Namespaces

func (p *NsProvider) Namespaces() map[string]*idm.UserMetaNamespace

Namespaces lists all known usermeta namespaces

func (*NsProvider) ReadNode

func (p *NsProvider) ReadNode(node *tree.Node) (*tree.Node, error)

ReadNode goes through all prepared streamers to collect metadata

func (*NsProvider) Watch

func (p *NsProvider) Watch(ctx context.Context)

Watch watches idm ChangeEvents to force reload when metadata namespaces are modified

Jump to

Keyboard shortcuts

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