meta

package
v2.3.6+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const (
	ServiceMetaProvider   = "MetaProvider"
	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) Loader

type MetaProviderCloser

type MetaProviderCloser func() error

type NamespacesProvider added in v1.5.0

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

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

func NewNamespacesProvider added in v1.5.0

func NewNamespacesProvider() *NamespacesProvider

NewNamespacesProvider creates a new namespace provider

func (*NamespacesProvider) Clear added in v1.5.0

func (p *NamespacesProvider) Clear()

Clear unload cached data to force reload at next call

func (*NamespacesProvider) CloseStreamers added in v1.5.0

func (p *NamespacesProvider) CloseStreamers() error

CloseStreamers closes all prepared streamer clients

func (*NamespacesProvider) ExcludeIndexes added in v1.5.0

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

ExcludeIndexes lists namespaces that should not be indexed by search engines

func (*NamespacesProvider) IncludedIndexes

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

IncludedIndexes lists namespaces that should be indexed by search engines

func (*NamespacesProvider) InitStreamers added in v1.5.0

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

InitStreamers prepares a set of NodeProviderStreamerClients ready to be requested

func (*NamespacesProvider) Load added in v1.5.0

func (p *NamespacesProvider) Load()

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

func (*NamespacesProvider) Namespaces added in v1.5.0

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

Namespaces lists all known usermeta namespaces

func (*NamespacesProvider) ReadNode added in v1.5.0

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

ReadNode goes through all prepared streamers to collect metadata

func (*NamespacesProvider) Watch added in v1.5.0

func (p *NamespacesProvider) Watch()

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

type StreamLoader

type StreamLoader struct {
	// contains filtered or unexported fields
}

func (*StreamLoader) Close

func (l *StreamLoader) Close() error

func (*StreamLoader) LoadMetas

func (l *StreamLoader) LoadMetas(ctx context.Context, nodes ...*tree.Node)

Jump to

Keyboard shortcuts

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