cache

package
v1.12.0-rc1 Latest Latest
Warning

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

Go to latest
Published: May 18, 2020 License: MIT Imports: 9 Imported by: 141

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInt

func GetInt(key string, getFunc func() (int, error)) (int, error)

GetInt returns key value from cache with callback when no key exists in cache

func GetInt64

func GetInt64(key string, getFunc func() (int64, error)) (int64, error)

GetInt64 returns key value from cache with callback when no key exists in cache

func GetString added in v1.12.0

func GetString(key string, getFunc func() (string, error)) (string, error)

GetString returns the key value from cache with callback when no key exists in cache

func NewContext

func NewContext() error

NewContext start cache service

func Remove

func Remove(key string)

Remove key from cache

Types

type LastCommitCache added in v1.12.0

type LastCommitCache struct {
	mc.Cache
	// contains filtered or unexported fields
}

LastCommitCache represents a cache to store last commit

func NewLastCommitCache added in v1.12.0

func NewLastCommitCache(repoPath string, gitRepo *git.Repository, ttl int64) *LastCommitCache

NewLastCommitCache creates a new last commit cache for repo

func (LastCommitCache) Get added in v1.12.0

func (c LastCommitCache) Get(ref, entryPath string) (*object.Commit, error)

Get get the last commit information by commit id and entry path

func (LastCommitCache) Put added in v1.12.0

func (c LastCommitCache) Put(ref, entryPath, commitID string) error

Put put the last commit id with commit and entry path

Jump to

Keyboard shortcuts

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