store

package
v0.2.0-rc7 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package store tracks derived information for modules. A module is equivalent to a directory on the filesystem.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Content

type Content struct {
	Path    string                     // the directory of the module.
	Files   map[string]*hcl.File       // parsed files by unqualified filename.
	Diags   map[string]hcl.Diagnostics // diags by unqualified filename.
	Targets *target.Targets            // computed reference targets.
	RefMap  *target.ReferenceMap       // computed reference map.
	XRD     *XRD                       // XRD information, if present in the module metadata file.
}

Content contains information being tracked for a module.

type Store

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

Store tracks module state for multiple directories.

func New

func New() *Store

New creates a new store.

func (*Store) Exists

func (s *Store) Exists(dir string) bool

Exists returns true if the module store is currently tracking the supplied directory.

func (*Store) Get

func (s *Store) Get(dir string) *Content

Get returns module information for the supplied directory or nil if no such information exists.

func (*Store) ListDirs

func (s *Store) ListDirs() []string

ListDirs returns all known module directories.

func (*Store) Put

func (s *Store) Put(content *Content)

Put adds or updates information stored for the supplied module.

func (*Store) Remove

func (s *Store) Remove(dir string)

Remove removes stored information for the supplied directory if such information exists.

type XRD

type XRD struct {
	APIVersion string `json:"apiVersion"`
	Kind       string `json:"kind"`
}

XRD captures the API version and kind of the composite associated with the module.

Jump to

Keyboard shortcuts

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