cache

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 18, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedSource

type CachedSource interface {
	Update(c LocalCacheContext) error
	GetVersions(c LocalCacheContext) ([]version.Version, error)
	GetPath(c LocalCacheContext) string
	SwitchToVersion(c LocalCacheContext, v version.Version) error
}

type GitLocalSource

type GitLocalSource struct {
	LocalPath string
}

func (*GitLocalSource) GetPath

func (s *GitLocalSource) GetPath(c LocalCacheContext) string

func (*GitLocalSource) GetVersions

func (s *GitLocalSource) GetVersions(c LocalCacheContext) ([]version.Version, error)

func (*GitLocalSource) SwitchToVersion

func (s *GitLocalSource) SwitchToVersion(c LocalCacheContext, v version.Version) error

func (*GitLocalSource) Update

func (s *GitLocalSource) Update(c LocalCacheContext) error

type GitSource

type GitSource struct {
	Remote string
}

func (*GitSource) GetPath

func (s *GitSource) GetPath(c LocalCacheContext) string

func (*GitSource) GetVersions

func (s *GitSource) GetVersions(c LocalCacheContext) ([]version.Version, error)

func (*GitSource) SwitchToVersion

func (s *GitSource) SwitchToVersion(c LocalCacheContext, v version.Version) error

func (*GitSource) Update

func (s *GitSource) Update(c LocalCacheContext) error

type LocalCacheContext

type LocalCacheContext interface {
	GetCacheRoot() string
	Mark(mark string)
	CheckMarked(mark string) bool
}

func DefaultCacheContext

func DefaultCacheContext() (LocalCacheContext, error)

type NotCommitedError

type NotCommitedError interface {
	error
	NotCommitedFiles() []string
}

type SimpleContext

type SimpleContext struct {
	Path  string
	Marks map[string]bool
}

func (*SimpleContext) CheckMarked

func (c *SimpleContext) CheckMarked(mark string) bool

func (*SimpleContext) GetCacheRoot

func (c *SimpleContext) GetCacheRoot() string

func (*SimpleContext) Mark

func (c *SimpleContext) Mark(mark string)

type SourceOfTruth

type SourceOfTruth interface {
	CheckVersion(v version.Version) (bool, error)
	GetVersions() ([]version.Version, error)
	FreezeVersion(v version.Version) error
	IsFrozen() (bool, error)
	IsClean() ([]string, error)
}

func NewLocalSourceOfTruth

func NewLocalSourceOfTruth(path string) (SourceOfTruth, error)

Jump to

Keyboard shortcuts

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