bufstate

package
v0.0.0-...-7f7f0ca Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const GlobalStateFileName = "state.json"
View Source
const ModStateFileName = "state.json"
View Source
const (
	SyncRoot = "modules/sync"
)

Variables

This section is empty.

Functions

func AppendModuleReference

func AppendModuleReference(
	rootSyncDir string,
	ownerName string,
	repoName string,
	reference string,
	digest string,
) error

AppendModuleReference appends a reference-digest pair at the end of the module state, and updates the module's latest reference in the global state. It assumes the structure of the sync dir is `root-sync-dir/owner-name/repo-name/state.json` for module state file, and `root-sync-dir/state.json` for global state file.

func ReadGlobalState

func ReadGlobalState(reader io.ReadCloser) (_ *statev1alpha1.GlobalState, retErr error)

ReadGlobalState reads a JSON encoded GlobalState from the given reader before closing it.

func ReadModStateFile

func ReadModStateFile(readCloser io.ReadCloser) (_ *statev1alpha1.ModuleState, retErr error)

ReadModStateFile reads a JSON encoded ModuleState from the given reader before closing it.

func WriteGlobalState

func WriteGlobalState(writer io.WriteCloser, globalState *statev1alpha1.GlobalState) (retErr error)

WriteGlobalState takes a global state and writes it to the given writer before closing it.

func WriteModStateFile

func WriteModStateFile(writeCloser io.WriteCloser, moduleState *statev1alpha1.ModuleState) (retErr error)

WriteModStateFile takes a module state and writes it to the given writer before closing it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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