hugo: Index | Files

package types

import ""

Package types contains types shared between packages in Hugo.

Package types contains types shared between packages in Hugo.


Package Files

convert.go evictingqueue.go types.go

func IsNil Uses

func IsNil(v interface{}) bool

IsNil reports whether v is nil.

func ToString Uses

func ToString(v interface{}) string

ToString converts v to a string.

func ToStringE Uses

func ToStringE(v interface{}) (string, error)

ToStringE converts v to a string.

func ToStringSlicePreserveString Uses

func ToStringSlicePreserveString(v interface{}) []string

ToStringSlicePreserveString converts v to a string slice. If v is a string, it will be wrapped in a string slice.

func TypeToString Uses

func TypeToString(v interface{}) (string, bool)

TypeToString converts v to a string if it's a valid string type. Note that this will not try to convert numeric values etc., use ToString for that.

type DevMarker Uses

type DevMarker interface {

DevMarker is a marker interface for types that should only be used during development.

type EvictingStringQueue Uses

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 Uses

func NewEvictingStringQueue(size int) *EvictingStringQueue

NewEvictingStringQueue creates a new queue with the given size.

func (*EvictingStringQueue) Add Uses

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) Contains Uses

func (q *EvictingStringQueue) Contains(v string) bool

Contains returns whether the queue contains v.

func (*EvictingStringQueue) Peek Uses

func (q *EvictingStringQueue) Peek() string

Peek looks at the last element added to the queue.

func (*EvictingStringQueue) PeekAll Uses

func (q *EvictingStringQueue) PeekAll() []string

PeekAll looks at all the elements in the queue, with the newest first.

func (*EvictingStringQueue) PeekAllSet Uses

func (q *EvictingStringQueue) PeekAllSet() map[string]bool

PeekAllSet returns PeekAll as a set.

type KeyValueStr Uses

type KeyValueStr struct {
    Key   string
    Value string

KeyValueStr is a string tuple.

type KeyValues Uses

type KeyValues struct {
    Key    interface{}
    Values []interface{}

KeyValues holds an key and a slice of values.

func NewKeyValuesStrings Uses

func NewKeyValuesStrings(key string, values ...string) KeyValues

NewKeyValuesStrings takes a given key and slice of values and returns a new KeyValues struct.

func (KeyValues) KeyString Uses

func (k KeyValues) KeyString() string

KeyString returns the key as a string, an empty string if conversion fails.

func (KeyValues) String Uses

func (k KeyValues) String() string

type RLocker Uses

type RLocker interface {

RLocker represents the read locks in sync.RWMutex.

type Zeroer Uses

type Zeroer interface {
    IsZero() bool

Zeroer, as implemented by time.Time, will be used by the truth template funcs in Hugo (if, with, not, and, or).

Package types imports 6 packages (graph) and is imported by 210 packages. Updated 2020-12-03. Refresh now. Tools for package owners.