cacher

package
v0.0.0-...-5ddb564 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsCachedError

func IsCachedError(err error) bool

IsCachedError returns true if the given error is a CachedError.

Types

type CachedError

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

CachedError

func (*CachedError) Error

func (e *CachedError) Error() string

Error implements error.

type Cacher

type Cacher interface {
	// GetOrCacheRepoState returns the cached value(s) for the given RepoState,
	// performing the sync to obtain and insert the value(s) into the cache(s) if
	// necessary.
	GetOrCacheRepoState(ctx context.Context, rs types.RepoState) (*specs.TasksCfg, error)
}

type CacherImpl

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

CacherImpl is a struct which handles insertion of data for RepoStates into various caches used by Task Scheduler. It ensures that we only sync to a given RepoState once (barring transient errors).

func New

New creates a Cacher instance.

func (*CacherImpl) GetOrCacheRepoState

func (c *CacherImpl) GetOrCacheRepoState(ctx context.Context, rs types.RepoState) (*specs.TasksCfg, error)

GetOrCacheRepoState returns the cached value(s) for the given RepoState, performing the sync to obtain and insert the value(s) into the cache(s) if necessary.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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