cache

package
v10.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package cache provides infrastructure to cache things in memory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bool

type Bool = Cache[bool]

Bool is a cache for bool variables.

type Cache

type Cache[T any] struct {
	// contains filtered or unexported fields
}

Cache is a cache implementation for arbitrary data structures that ensures it is initialized. The zero value is an empty cache.

func (*Cache[T]) Initialized

func (c *Cache[T]) Initialized() bool

Initialized indicates if we have a current branch.

func (*Cache[T]) Invalidate

func (c *Cache[T]) Invalidate()

Invalidate removes the cached value.

func (*Cache[T]) Set

func (c *Cache[T]) Set(newValue T)

Set allows collaborators to signal when the current branch has changed.

func (*Cache[T]) Value

func (c *Cache[T]) Value() T

Value provides the current value.

type LocalBranch

type LocalBranch = Cache[domain.LocalBranchName]

LocalBranch is a cache for domain.LocalBranchName variables.

type RemoteBranch

type RemoteBranch = Cache[domain.RemoteBranchName]

RemoteBranch is a cache for domain.RemoteBranchName variables.

type Remotes

type Remotes = Cache[domain.Remotes]

Remotes is a cache for domain.Remotes variables.

type String

type String = Cache[string]

String is a cache for string variables.

type Strings

type Strings = Cache[[]string]

Strings is a cache for string variables.

Jump to

Keyboard shortcuts

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