Documentation ¶
Index ¶
- Variables
- func GetBaseURL(route route.Route) string
- func GetTypedItemURL(route route.Route, urlType string) string
- type AliasIndexOrchestrator
- type CacheUpdateCallback
- type ConcurrentItemMapShared
- type ConcurrentViewModelListMapShared
- type ConcurrentViewModelMapShared
- type ConversionModelOrchestrator
- type Factory
- func (factory *Factory) NewAliasIndexOrchestrator() *AliasIndexOrchestrator
- func (factory *Factory) NewConversionModelOrchestrator() *ConversionModelOrchestrator
- func (factory *Factory) NewFeedOrchestrator() *FeedOrchestrator
- func (factory *Factory) NewFileOrchestrator() *FileOrchestrator
- func (factory *Factory) NewNavigationOrchestrator() *NavigationOrchestrator
- func (factory *Factory) NewOpenSearchDescriptionOrchestrator() *OpenSearchDescriptionOrchestrator
- func (factory *Factory) NewSearchOrchestrator() *SearchOrchestrator
- func (factory *Factory) NewSitemapOrchestrator() *SitemapOrchestrator
- func (factory *Factory) NewTagsOrchestrator() *TagsOrchestrator
- func (factory *Factory) NewTitlesOrchestrator() *TitlesOrchestrator
- func (factory *Factory) NewTypeAheadOrchestrator() *TypeAheadOrchestrator
- func (factory *Factory) NewUpdateOrchestrator() *UpdateOrchestrator
- func (factory *Factory) NewViewModelOrchestrator() *ViewModelOrchestrator
- func (factory *Factory) NewXMLSitemapOrchestrator() *XmlSitemapOrchestrator
- type FeedOrchestrator
- type FileOrchestrator
- func (orchestrator *FileOrchestrator) GetFile(fileRoute route.Route) (fileModel viewmodel.File, found bool)
- func (orchestrator *FileOrchestrator) GetFileContentProvider(fileRoute route.Route) content.ContentProviderInterface
- func (orchestrator *FileOrchestrator) GetFiles(itemRoute route.Route) []viewmodel.File
- func (orchestrator *FileOrchestrator) GetImages(itemRoute route.Route) []viewmodel.Image
- type ItemCache
- func (m ItemCache) Count() int
- func (m ItemCache) Get(key string) (*model.Item, bool)
- func (m ItemCache) GetShard(key string) *ConcurrentItemMapShared
- func (m *ItemCache) Has(key string) bool
- func (m *ItemCache) IsEmpty() bool
- func (m ItemCache) Iter() <-chan ItemCacheTuple
- func (m ItemCache) IterBuffered() <-chan ItemCacheTuple
- func (m *ItemCache) Remove(key string)
- func (m *ItemCache) Set(key string, value *model.Item)
- type ItemCacheTuple
- type NavigationOrchestrator
- 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 Orchestrator
- type SearchOrchestrator
- type SitemapOrchestrator
- type TagsOrchestrator
- type TitlesOrchestrator
- type TypeAheadOrchestrator
- type Update
- type UpdateOrchestrator
- type UpdateType
- type ViewModelCache
- func (m ViewModelCache) Count() int
- func (m ViewModelCache) Get(key string) (viewmodel.Model, bool)
- func (m ViewModelCache) GetShard(key string) *ConcurrentViewModelMapShared
- func (m *ViewModelCache) Has(key string) bool
- func (m *ViewModelCache) IsEmpty() bool
- func (m ViewModelCache) Iter() <-chan ViewModelCacheTuple
- func (m ViewModelCache) IterBuffered() <-chan ViewModelCacheTuple
- func (m *ViewModelCache) Remove(key string)
- func (m *ViewModelCache) Set(key string, value viewmodel.Model)
- type ViewModelCacheTuple
- type ViewModelListCache
- func (m ViewModelListCache) Count() int
- func (m ViewModelListCache) Get(key string) ([]viewmodel.Model, bool)
- func (m ViewModelListCache) GetShard(key string) *ConcurrentViewModelListMapShared
- func (m *ViewModelListCache) Has(key string) bool
- func (m *ViewModelListCache) IsEmpty() bool
- func (m ViewModelListCache) Iter() <-chan ViewModelListCacheTuple
- func (m ViewModelListCache) IterBuffered() <-chan ViewModelListCacheTuple
- func (m *ViewModelListCache) Remove(key string)
- func (m *ViewModelListCache) Set(key string, value []viewmodel.Model)
- type ViewModelListCacheTuple
- type ViewModelOrchestrator
- func (orchestrator *ViewModelOrchestrator) GetFullViewModel(itemRoute route.Route) (viewmodel.Model, bool)
- func (orchestrator *ViewModelOrchestrator) GetLatest(itemRoute route.Route, pageSize, page int) (latest []viewmodel.Model, found bool)
- func (orchestrator *ViewModelOrchestrator) GetViewModel(itemRoute route.Route) (viewModel viewmodel.Model, found bool)
- func (orchestrator *ViewModelOrchestrator) GetViewModelByAlias(alias string) (viewModel viewmodel.Model, found bool)
- type XmlSitemapOrchestrator
Constants ¶
This section is empty.
Variables ¶
var ITEMCACHE_SHARD_COUNT = 32
var VIEWMODELCACHE_SHARD_COUNT = 32
var VIEWMODELLISTCACHE_SHARD_COUNT = 32
Functions ¶
func GetBaseURL ¶ added in v0.10.0
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 { // contains filtered or unexported fields }
type ConcurrentViewModelListMapShared ¶ added in v0.10.0
type ConcurrentViewModelListMapShared struct { // contains filtered or unexported fields }
type ConcurrentViewModelMapShared ¶ added in v0.10.0
type ConcurrentViewModelMapShared struct { // 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.
type FileOrchestrator ¶
type FileOrchestrator struct {
*Orchestrator
}
func (*FileOrchestrator) GetFileContentProvider ¶
func (orchestrator *FileOrchestrator) GetFileContentProvider(fileRoute route.Route) content.ContentProviderInterface
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) GetShard ¶ added in v0.10.0
func (m ItemCache) GetShard(key string) *ConcurrentItemMapShared
Returns shard under given key
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.
type ItemCacheTuple ¶ added in v0.10.0
Used by the Iter & IterBuffered functions to wrap two variables together over a channel,
type NavigationOrchestrator ¶
type NavigationOrchestrator struct { // contains filtered or unexported fields }
func (*NavigationOrchestrator) GetBreadcrumbNavigation ¶
func (orchestrator *NavigationOrchestrator) GetBreadcrumbNavigation(route route.Route) viewmodel.BreadcrumbNavigation
func (*NavigationOrchestrator) GetItemNavigation ¶
func (orchestrator *NavigationOrchestrator) GetItemNavigation(route route.Route) viewmodel.ItemNavigation
func (*NavigationOrchestrator) GetToplevelNavigation ¶
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 (*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 (*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
func (m ViewModelCache) GetShard(key string) *ConcurrentViewModelMapShared
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.
type ViewModelCacheTuple ¶ added in v0.10.0
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
func (m ViewModelListCache) GetShard(key string) *ConcurrentViewModelListMapShared
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
func (m ViewModelListCache) Iter() <-chan ViewModelListCacheTuple
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.
type ViewModelListCacheTuple ¶ added in v0.10.0
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 (*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