orchestrator

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2017 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ITEMCACHE_SHARD_COUNT = 32
View Source
var VIEWMODELCACHE_SHARD_COUNT = 32
View Source
var VIEWMODELLISTCACHE_SHARD_COUNT = 32

Functions

func GetBaseURL added in v0.10.0

func GetBaseURL(route route.Route) string

func GetTypedItemURL added in v0.10.0

func GetTypedItemURL(route route.Route, urlType string) string

Types

type AliasIndexOrchestrator added in v0.10.0

type AliasIndexOrchestrator struct {
	*Orchestrator
}

AliasIndexOrchestrator provides alias index entries.

func (*AliasIndexOrchestrator) GetIndexEntries added in v0.10.0

func (orchestrator *AliasIndexOrchestrator) GetIndexEntries(hostname, prefix string) []viewmodel.Alias

GetIndexEntries returns a list of all alias index entry models.

type CacheUpdateCallback added in v0.10.0

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

CacheUpdateCallback is a wrapper model for cache update callback functions.

func (*CacheUpdateCallback) Execute added in v0.10.0

func (updateCallback *CacheUpdateCallback) Execute(route route.Route) (err error)

Execute safely executes the callback and return any error that occured during execution.

func (*CacheUpdateCallback) Name added in v0.10.0

func (updateCallback *CacheUpdateCallback) Name() string

Name returns the name of the callback.

func (*CacheUpdateCallback) String added in v0.10.0

func (updateCallback *CacheUpdateCallback) String() string

String returns a string representation of the current CacheUpdateCallback.

func (*CacheUpdateCallback) UpdateType added in v0.10.0

func (updateCallback *CacheUpdateCallback) UpdateType() UpdateType

UpdateType returns the type of the callback.

type ConcurrentItemMapShared added in v0.10.0

type ConcurrentItemMapShared struct {
	sync.RWMutex // Read Write mutex, guards access to internal map.
	// contains filtered or unexported fields
}

type ConcurrentViewModelListMapShared added in v0.10.0

type ConcurrentViewModelListMapShared struct {
	sync.RWMutex // Read Write mutex, guards access to internal map.
	// contains filtered or unexported fields
}

type ConcurrentViewModelMapShared added in v0.10.0

type ConcurrentViewModelMapShared struct {
	sync.RWMutex // Read Write mutex, guards access to internal map.
	// contains filtered or unexported fields
}

type ConversionModelOrchestrator

type ConversionModelOrchestrator struct {
	*Orchestrator
	// contains filtered or unexported fields
}

func (*ConversionModelOrchestrator) GetConversionModel

func (orchestrator *ConversionModelOrchestrator) GetConversionModel(baseURL string, route route.Route) (model viewmodel.ConversionModel, found bool)

type Factory

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

func NewFactory

func NewFactory(logger logger.Logger, config config.Config, repository dataaccess.Repository, parser parser.Parser, converter converter.Converter, webPathProvider webpaths.WebPathProvider) *Factory

func (*Factory) NewAliasIndexOrchestrator added in v0.10.0

func (factory *Factory) NewAliasIndexOrchestrator() *AliasIndexOrchestrator

NewAliasIndexOrchestrator creates a new alias-index orchestrator.

func (*Factory) NewConversionModelOrchestrator

func (factory *Factory) NewConversionModelOrchestrator() *ConversionModelOrchestrator

func (*Factory) NewFeedOrchestrator

func (factory *Factory) NewFeedOrchestrator() *FeedOrchestrator

func (*Factory) NewFileOrchestrator

func (factory *Factory) NewFileOrchestrator() *FileOrchestrator

func (*Factory) NewNavigationOrchestrator

func (factory *Factory) NewNavigationOrchestrator() *NavigationOrchestrator

func (*Factory) NewOpenSearchDescriptionOrchestrator

func (factory *Factory) NewOpenSearchDescriptionOrchestrator() *OpenSearchDescriptionOrchestrator

func (*Factory) NewSearchOrchestrator

func (factory *Factory) NewSearchOrchestrator() *SearchOrchestrator

func (*Factory) NewSitemapOrchestrator

func (factory *Factory) NewSitemapOrchestrator() *SitemapOrchestrator

func (*Factory) NewTagsOrchestrator

func (factory *Factory) NewTagsOrchestrator() *TagsOrchestrator

func (*Factory) NewTitlesOrchestrator

func (factory *Factory) NewTitlesOrchestrator() *TitlesOrchestrator

func (*Factory) NewTypeAheadOrchestrator

func (factory *Factory) NewTypeAheadOrchestrator() *TypeAheadOrchestrator

func (*Factory) NewUpdateOrchestrator

func (factory *Factory) NewUpdateOrchestrator() *UpdateOrchestrator

func (*Factory) NewViewModelOrchestrator

func (factory *Factory) NewViewModelOrchestrator() *ViewModelOrchestrator

func (*Factory) NewXMLSitemapOrchestrator added in v0.10.0

func (factory *Factory) NewXMLSitemapOrchestrator() *XmlSitemapOrchestrator

type FeedOrchestrator

type FeedOrchestrator struct {
	*Orchestrator
}

A FeedOrchestrator provides feed models.

func (*FeedOrchestrator) GetFeed added in v0.10.0

func (orchestrator *FeedOrchestrator) GetFeed(baseURL string, itemsPerPage, page int) (viewmodel.Feed, error)

GetFeed returns a feed model for the given base URL, items per page and page.

type FileOrchestrator

type FileOrchestrator struct {
	*Orchestrator
}

func (*FileOrchestrator) GetFile

func (orchestrator *FileOrchestrator) GetFile(fileRoute route.Route) (fileModel viewmodel.File, found bool)

func (*FileOrchestrator) GetFileContentProvider

func (orchestrator *FileOrchestrator) GetFileContentProvider(fileRoute route.Route) content.ContentProviderInterface

func (*FileOrchestrator) GetFiles

func (orchestrator *FileOrchestrator) GetFiles(itemRoute route.Route) []viewmodel.File

func (*FileOrchestrator) GetImages

func (orchestrator *FileOrchestrator) GetImages(itemRoute route.Route) []viewmodel.Image

type ItemCache added in v0.10.0

type ItemCache []*ConcurrentItemMapShared

A "thread" safe map of type string:*model.Item. To avoid lock bottlenecks this map is dived to several (ITEMCACHE_SHARD_COUNT) map shards.

func (ItemCache) Count added in v0.10.0

func (m ItemCache) Count() int

Returns the number of elements within the map.

func (ItemCache) Get added in v0.10.0

func (m ItemCache) Get(key string) (*model.Item, bool)

Retrieves an element from map under given key.

func (ItemCache) GetShard added in v0.10.0

func (m ItemCache) GetShard(key string) *ConcurrentItemMapShared

Returns shard under given key

func (*ItemCache) Has added in v0.10.0

func (m *ItemCache) Has(key string) bool

Looks up an item under specified key

func (*ItemCache) IsEmpty added in v0.10.0

func (m *ItemCache) IsEmpty() bool

Checks if map is empty.

func (ItemCache) Iter added in v0.10.0

func (m ItemCache) Iter() <-chan ItemCacheTuple

Returns an iterator which could be used in a for range loop.

func (ItemCache) IterBuffered added in v0.10.0

func (m ItemCache) IterBuffered() <-chan ItemCacheTuple

Returns a buffered iterator which could be used in a for range loop.

func (*ItemCache) Remove added in v0.10.0

func (m *ItemCache) Remove(key string)

Removes an element from the map.

func (*ItemCache) Set added in v0.10.0

func (m *ItemCache) Set(key string, value *model.Item)

Sets the given value under the specified key.

type ItemCacheTuple added in v0.10.0

type ItemCacheTuple struct {
	Key string
	Val *model.Item
}

Used by the Iter & IterBuffered functions to wrap two variables together over a channel,

type NavigationOrchestrator struct {
	*Orchestrator
	// contains filtered or unexported fields
}
func (orchestrator *NavigationOrchestrator) GetBreadcrumbNavigation(route route.Route) viewmodel.BreadcrumbNavigation
func (orchestrator *NavigationOrchestrator) GetItemNavigation(route route.Route) viewmodel.ItemNavigation
func (orchestrator *NavigationOrchestrator) GetToplevelNavigation() viewmodel.ToplevelNavigation

type OpenSearchDescriptionOrchestrator

type OpenSearchDescriptionOrchestrator struct {
	*Orchestrator
}

func (*OpenSearchDescriptionOrchestrator) GetDescriptionModel

func (orchestrator *OpenSearchDescriptionOrchestrator) GetDescriptionModel(hostname string) viewmodel.OpenSearchDescription

type Orchestrator

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

func (*Orchestrator) GetPageTitle added in v0.10.0

func (orchestrator *Orchestrator) GetPageTitle(headline string) string

Get the full-page title for a given headline.

func (*Orchestrator) ItemExists

func (orchestrator *Orchestrator) ItemExists(route route.Route) bool

func (*Orchestrator) Subscribe added in v0.10.0

func (orchestrator *Orchestrator) Subscribe(update chan Update)

func (*Orchestrator) UpdateCache added in v0.10.0

func (orchestrator *Orchestrator) UpdateCache(dataaccessLayerUpdate dataaccess.Update)

Update all caches

type SearchOrchestrator

type SearchOrchestrator struct {
	*Orchestrator
}

func (*SearchOrchestrator) GetSearchResults

func (orchestrator *SearchOrchestrator) GetSearchResults(keywords string, page int) viewmodel.SearchResults

type SitemapOrchestrator

type SitemapOrchestrator struct {
	*Orchestrator
	// contains filtered or unexported fields
}

func (*SitemapOrchestrator) GetSitemap

func (orchestrator *SitemapOrchestrator) GetSitemap() viewmodel.SitemapEntry

type TagsOrchestrator

type TagsOrchestrator struct {
	*Orchestrator
	// contains filtered or unexported fields
}

func (*TagsOrchestrator) GetTagCloud

func (orchestrator *TagsOrchestrator) GetTagCloud() viewmodel.TagCloud

GetTagCloud returns the latest tag cloud viewmodel.

func (*TagsOrchestrator) GetTags

func (orchestrator *TagsOrchestrator) GetTags() []viewmodel.Tag

GetTags returns a list of all known tag models.

type TitlesOrchestrator

type TitlesOrchestrator struct {
	*Orchestrator
}

func (*TitlesOrchestrator) GetTitles

func (orchestrator *TitlesOrchestrator) GetTitles() []viewmodel.Title

type TypeAheadOrchestrator

type TypeAheadOrchestrator struct {
	*Orchestrator
}

func (*TypeAheadOrchestrator) GetSuggestions

func (orchestrator *TypeAheadOrchestrator) GetSuggestions(keywords string) []viewmodel.TypeAhead

type Update added in v0.10.0

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

func NewUpdate added in v0.10.0

func NewUpdate(updateType UpdateType, route route.Route) Update

func (*Update) Route added in v0.10.0

func (update *Update) Route() route.Route

func (*Update) String added in v0.10.0

func (update *Update) String() string

func (*Update) Type added in v0.10.0

func (update *Update) Type() UpdateType

type UpdateOrchestrator

type UpdateOrchestrator struct {
	*Orchestrator
	// contains filtered or unexported fields
}

func (*UpdateOrchestrator) GetUpdatedModel

func (orchestrator *UpdateOrchestrator) GetUpdatedModel(itemRoute route.Route) (viewModel viewmodel.Model, found bool)

func (*UpdateOrchestrator) StartWatching

func (orchestrator *UpdateOrchestrator) StartWatching(route route.Route)

func (*UpdateOrchestrator) StopWatching

func (orchestrator *UpdateOrchestrator) StopWatching(route route.Route)

type UpdateType added in v0.10.0

type UpdateType int
const (
	UpdateTypeUnchanged UpdateType = iota
	UpdateTypeNew
	UpdateTypeModified
	UpdateTypeDeleted
)

func (UpdateType) String added in v0.10.0

func (updateType UpdateType) String() string

type ViewModelCache added in v0.10.0

type ViewModelCache []*ConcurrentViewModelMapShared

A "thread" safe map of type string:viewmodel.Model. To avoid lock bottlenecks this map is dived to several (VIEWMODELCACHE_SHARD_COUNT) map shards.

func (ViewModelCache) Count added in v0.10.0

func (m ViewModelCache) Count() int

Returns the number of elements within the map.

func (ViewModelCache) Get added in v0.10.0

func (m ViewModelCache) Get(key string) (viewmodel.Model, bool)

Retrieves an element from map under given key.

func (ViewModelCache) GetShard added in v0.10.0

Returns shard under given key

func (*ViewModelCache) Has added in v0.10.0

func (m *ViewModelCache) Has(key string) bool

Looks up an item under specified key

func (*ViewModelCache) IsEmpty added in v0.10.0

func (m *ViewModelCache) IsEmpty() bool

Checks if map is empty.

func (ViewModelCache) Iter added in v0.10.0

func (m ViewModelCache) Iter() <-chan ViewModelCacheTuple

Returns an iterator which could be used in a for range loop.

func (ViewModelCache) IterBuffered added in v0.10.0

func (m ViewModelCache) IterBuffered() <-chan ViewModelCacheTuple

Returns a buffered iterator which could be used in a for range loop.

func (*ViewModelCache) Remove added in v0.10.0

func (m *ViewModelCache) Remove(key string)

Removes an element from the map.

func (*ViewModelCache) Set added in v0.10.0

func (m *ViewModelCache) Set(key string, value viewmodel.Model)

Sets the given value under the specified key.

type ViewModelCacheTuple added in v0.10.0

type ViewModelCacheTuple struct {
	Key string
	Val viewmodel.Model
}

Used by the Iter & IterBuffered functions to wrap two variables together over a channel,

type ViewModelListCache added in v0.10.0

type ViewModelListCache []*ConcurrentViewModelListMapShared

A "thread" safe map of type string:[]viewmodel.Model. To avoid lock bottlenecks this map is dived to several (VIEWMODELLISTCACHE_SHARD_COUNT) map shards.

func (ViewModelListCache) Count added in v0.10.0

func (m ViewModelListCache) Count() int

Returns the number of elements within the map.

func (ViewModelListCache) Get added in v0.10.0

func (m ViewModelListCache) Get(key string) ([]viewmodel.Model, bool)

Retrieves an element from map under given key.

func (ViewModelListCache) GetShard added in v0.10.0

Returns shard under given key

func (*ViewModelListCache) Has added in v0.10.0

func (m *ViewModelListCache) Has(key string) bool

Looks up an item under specified key

func (*ViewModelListCache) IsEmpty added in v0.10.0

func (m *ViewModelListCache) IsEmpty() bool

Checks if map is empty.

func (ViewModelListCache) Iter added in v0.10.0

Returns an iterator which could be used in a for range loop.

func (ViewModelListCache) IterBuffered added in v0.10.0

func (m ViewModelListCache) IterBuffered() <-chan ViewModelListCacheTuple

Returns a buffered iterator which could be used in a for range loop.

func (*ViewModelListCache) Remove added in v0.10.0

func (m *ViewModelListCache) Remove(key string)

Removes an element from the map.

func (*ViewModelListCache) Set added in v0.10.0

func (m *ViewModelListCache) Set(key string, value []viewmodel.Model)

Sets the given value under the specified key.

type ViewModelListCacheTuple added in v0.10.0

type ViewModelListCacheTuple struct {
	Key string
	Val []viewmodel.Model
}

Used by the Iter & IterBuffered functions to wrap two variables together over a channel,

type ViewModelOrchestrator

type ViewModelOrchestrator struct {
	*Orchestrator
	// contains filtered or unexported fields
}

func (*ViewModelOrchestrator) GetFullViewModel

func (orchestrator *ViewModelOrchestrator) GetFullViewModel(itemRoute route.Route) (viewmodel.Model, bool)

GetFullViewModel returns a fully-initialized viewmodel for the given route.

func (*ViewModelOrchestrator) GetLatest

func (orchestrator *ViewModelOrchestrator) GetLatest(itemRoute route.Route, pageSize, page int) (latest []viewmodel.Model, found bool)

GetLatest returns the latest items (sorted by creation date) for the given route.

func (*ViewModelOrchestrator) GetViewModel

func (orchestrator *ViewModelOrchestrator) GetViewModel(itemRoute route.Route) (viewModel viewmodel.Model, found bool)

func (*ViewModelOrchestrator) GetViewModelByAlias added in v0.10.0

func (orchestrator *ViewModelOrchestrator) GetViewModelByAlias(alias string) (viewModel viewmodel.Model, found bool)

GetViewModelByAlias returns the viewmodel by its alias.

type XmlSitemapOrchestrator

type XmlSitemapOrchestrator struct {
	*Orchestrator
}

func (*XmlSitemapOrchestrator) GetSitemapEntires

func (orchestrator *XmlSitemapOrchestrator) GetSitemapEntires(hostname string) []viewmodel.XmlSitemapEntry

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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