package types
import "github.com/gohugoio/hugo/common/types"
Package types contains types shared between packages in Hugo.
Package types contains types shared between packages in Hugo.
Index ¶
- type EvictingStringQueue
- func NewEvictingStringQueue(size int) *EvictingStringQueue
- func (q *EvictingStringQueue) Add(v string)
- func (q *EvictingStringQueue) Peek() string
- func (q *EvictingStringQueue) PeekAll() []string
- func (q *EvictingStringQueue) PeekAllSet() map[string]bool
- type KeyValueStr
- type KeyValues
Types ¶
type EvictingStringQueue ¶
type EvictingStringQueue struct {
// contains filtered or unexported fields
}
EvictingStringQueue is a queue which automatically evicts elements from the head of the queue when attempting to add new elements onto the queue and it is full. This queue orders elements LIFO (last-in-first-out). It throws away duplicates. Note: This queue currently does not contain any remove (poll etc.) methods.
func NewEvictingStringQueue ¶
func NewEvictingStringQueue(size int) *EvictingStringQueue
NewEvictingStringQueue creates a new queue with the given size.
func (*EvictingStringQueue) Add ¶
func (q *EvictingStringQueue) Add(v string)
Add adds a new string to the tail of the queue if it's not already there.
func (*EvictingStringQueue) Peek ¶
func (q *EvictingStringQueue) Peek() string
Peek looks at the last element added to the queue.
func (*EvictingStringQueue) PeekAll ¶
func (q *EvictingStringQueue) PeekAll() []string
PeekAll looks at all the elements in the queue, with the newest first.
func (*EvictingStringQueue) PeekAllSet ¶
func (q *EvictingStringQueue) PeekAllSet() map[string]bool
PeekAllSet returns PeekAll as a set.
type KeyValueStr ¶
KeyValueStr is a string tuple.
type KeyValues ¶
type KeyValues struct { Key interface{} Values []interface{} }
KeyValues holds an key and a slice of values.
func NewKeyValuesStrings ¶
func (KeyValues) KeyString ¶
KeyString returns the key as a string, an empty string if conversion fails.
func (KeyValues) String ¶
Source Files ¶
- Version
- v0.42.2
- Published
- Jun 28, 2018
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 3 hours ago –
Tools for package owners.