hugo: github.com/gohugoio/hugo/identity Index | Files

package identity

import "github.com/gohugoio/hugo/identity"

Index

Package Files

identity.go

type Identities Uses

type Identities map[Identity]Provider

Identities stores identity providers.

type IdentitiesProvider Uses

type IdentitiesProvider interface {
    GetIdentities() Identities
}

IdentitiesProvider provides all Identities.

type Identity Uses

type Identity interface {
    Provider
    Name() string
}

Identity represents an thing that can provide an identify. This can be any Go type, but the Identity returned by GetIdentify must be hashable.

type IncrementByOne Uses

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

IncrementByOne implements Incrementer adding 1 every time Incr is called.

func (*IncrementByOne) Incr Uses

func (c *IncrementByOne) Incr() int

type Incrementer Uses

type Incrementer interface {
    Incr() int
}

Incrementer increments and returns the value. Typically used for IDs.

type KeyValueIdentity Uses

type KeyValueIdentity struct {
    Key   string
    Value string
}

A KeyValueIdentity a general purpose identity.

func (KeyValueIdentity) GetIdentity Uses

func (id KeyValueIdentity) GetIdentity() Identity

GetIdentity returns itself.

func (KeyValueIdentity) Name Uses

func (id KeyValueIdentity) Name() string

Name returns the Key.

type Manager Uses

type Manager interface {
    IdentitiesProvider
    Provider
    Add(ids ...Provider)
    Search(id Identity) Provider
    Reset()
}

Manager manages identities, and is itself a Provider of Identity.

func NewManager Uses

func NewManager(id Provider) Manager

NewIdentityManager creates a new Manager starting at id.

type PathIdentity Uses

type PathIdentity struct {
    Type string
    Path string
}

A PathIdentity is a common identity identified by a type and a path, e.g. "layouts" and "_default/single.html".

func NewPathIdentity Uses

func NewPathIdentity(typ, pat string) PathIdentity

NewPathIdentity creates a new Identity with the two identifiers type and path.

func (PathIdentity) GetIdentity Uses

func (id PathIdentity) GetIdentity() Identity

GetIdentity returns itself.

func (PathIdentity) Name Uses

func (id PathIdentity) Name() string

Name returns the Path.

type Provider Uses

type Provider interface {
    GetIdentity() Identity
}

Provider provides the hashable Identity.

Package identity imports 4 packages (graph) and is imported by 67 packages. Updated 2020-09-27. Refresh now. Tools for package owners.