Documentation
¶
Index ¶
- func NewModuleSet(moduleDatas ...ModuleData) (bufmodule2.ModuleSet, error)
- func NewModuleSetForBucket(bucket storage.ReadBucket) (bufmodule2.ModuleSet, error)
- func NewModuleSetForDirPath(dirPath string) (bufmodule2.ModuleSet, error)
- func NewModuleSetForPathToData(pathToData map[string][]byte) (bufmodule2.ModuleSet, error)
- type ModuleData
- type OmniProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewModuleSet ¶
func NewModuleSet( moduleDatas ...ModuleData, ) (bufmodule2.ModuleSet, error)
NewModuleSet returns a new ModuleSet.
This can be used in cases where ModuleKeyProviders and ModuleDataProviders are not needed, and when FullNames do not matter.
Note the ModuleDatas must be self-contained, that is they only import from each other.
func NewModuleSetForBucket ¶
func NewModuleSetForBucket( bucket storage.ReadBucket, ) (bufmodule2.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 FullNames do not matter.
Note that this Module cannot have any dependencies.
func NewModuleSetForDirPath ¶
func NewModuleSetForDirPath( dirPath string, ) (bufmodule2.ModuleSet, error)
NewModuleSetForDirPath returns a new ModuleSet for the directory path.
This can be used in cases where ModuleKeyProviders and ModuleDataProviders are not needed, and when FullNames do not matter.
Note that this Module cannot have any dependencies.
func NewModuleSetForPathToData ¶
func NewModuleSetForPathToData( pathToData map[string][]byte, ) (bufmodule2.ModuleSet, error)
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 FullNames do not matter.
Note that this Module cannot have any dependencies.
Types ¶
type ModuleData ¶
type ModuleData struct {
Name string
CommitID uuid.UUID
CreateTime time.Time
DirPath string
PathToData map[string][]byte
Bucket storage.ReadBucket
NotTargeted bool
BufYAMLObjectData bufmodule2.ObjectData
BufLockObjectData bufmodule2.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 FullName 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 ¶
type OmniProvider interface {
bufmodule2.ModuleKeyProvider
bufmodule2.ModuleDataProvider
bufmodule2.GraphProvider
bufmodule2.CommitProvider
bufmodule2.ModuleSet
}
OmniProvider is a ModuleKeyProvider, ModuleDataProvider, GraphProvider, CommitProvider, and ModuleSet for testing.
func NewOmniProvider ¶
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.