Documentation ¶
Index ¶
- Constants
- func AppendModuleReference(rootSyncDir string, ownerName string, repoName string, reference string, ...) error
- func ReadGlobalState(reader io.ReadCloser) (_ *statev1alpha1.GlobalState, retErr error)
- func ReadModStateFile(readCloser io.ReadCloser) (_ *statev1alpha1.ModuleState, retErr error)
- func WriteGlobalState(writer io.WriteCloser, globalState *statev1alpha1.GlobalState) (retErr error)
- func WriteModStateFile(writeCloser io.WriteCloser, moduleState *statev1alpha1.ModuleState) (retErr error)
Constants ¶
const GlobalStateFileName = "state.json"
const ModStateFileName = "state.json"
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.