Documentation ¶
Index ¶
- func NewModuleSet(moduleDatas ...ModuleData) (bufmodule.ModuleSet, error)
- func NewModuleSetForBucket(bucket storage.ReadBucket) (bufmodule.ModuleSet, error)
- func NewModuleSetForDirPath(dirPath string) (bufmodule.ModuleSet, error)
- func NewModuleSetForPathToData(pathToData map[string][]byte) (bufmodule.ModuleSet, error)
- type ModuleData
- type OmniProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewModuleSet ¶ added in v1.32.0
func NewModuleSet( moduleDatas ...ModuleData, ) (bufmodule.ModuleSet, error)
NewModuleSet returns a new ModuleSet.
This can be used in cases where ModuleKeyProviders and ModuleDataProviders are not needed, and when ModuleFullNames do not matter.
Note the ModuleDatas must be self-contained, that is they only import from each other.
func NewModuleSetForBucket ¶ added in v1.32.0
func NewModuleSetForBucket( bucket storage.ReadBucket, ) (bufmodule.ModuleSet, error)
NewModuleSetForBucket returns a new ModuleSet for the Bucket.
This can be used in cases where ModuleKeyProviders and ModuleDataProviders are not needed, and when ModuleFullNames do not matter.
Note that this Module cannot have any dependencies.
func NewModuleSetForDirPath ¶ added in v1.32.0
NewModuleSetForDirPath returns a new ModuleSet for the directory path.
This can be used in cases where ModuleKeyProviders and ModuleDataProviders are not needed, and when ModuleFullNames do not matter.
Note that this Module cannot have any dependencies.
func NewModuleSetForPathToData ¶ added in v1.32.0
NewModuleSetForPathToData returns a new ModuleSet for the path to data map.
This can be used in cases where ModuleKeyProviders and ModuleDataProviders are not needed, and when ModuleFullNames do not matter.
Note that this Module cannot have any dependencies.
Types ¶
type ModuleData ¶ added in v1.32.0
type ModuleData struct { Name string CommitID uuid.UUID CreateTime time.Time DirPath string PathToData map[string][]byte Bucket storage.ReadBucket NotTargeted bool BufYAMLObjectData bufmodule.ObjectData BufLockObjectData bufmodule.ObjectData ReadObjectDataFromBucket bool }
ModuleData is the data needed to construct a Module in test.
Exactly one of PathToData, Bucket, DirPath must be set.
Name is the ModuleFullName string. When creating an OmniProvider, Name is required.
CommitID is optional, but it must be unique across all ModuleDatas. If CommitID is not set, a mock commitID is created if Name is set.
CreateTime is optional. If CreateTime is not set, a mock create Time is created. This create time is the same for all data without a Time.
If ReadObjectDataFromBucket is true, buf.yamls and buf.locks will attempt to be read from PathToData, Bucket, or DirPath. Otherwise, BufYAMLObjectData and BufLockObjectData will be used. It is an error to both set ReadObjectDataFromBucket and set Buf.*ObjectData.
type OmniProvider ¶ added in v1.32.0
type OmniProvider interface { bufmodule.ModuleKeyProvider bufmodule.ModuleDataProvider bufmodule.GraphProvider bufmodule.CommitProvider bufmodule.ModuleSet }
OmniProvider is a ModuleKeyProvider, ModuleDataProvider, GraphProvider, CommitProvider, and ModuleSet for testing.
func NewOmniProvider ¶ added in v1.32.0
func NewOmniProvider( moduleDatas ...ModuleData, ) (OmniProvider, error)
NewOmniProvider returns a new OmniProvider.
Note the ModuleDatas must be self-contained, that is they only import from each other.