Documentation
¶
Index ¶
- Constants
- func ExtractDirectDependencies(berksfilePath string, groups []string) ([]string, error)
- type CookbookLock
- type LockFile
- func (lf *LockFile) AddCookbook(sourceKey string, cookbook *berkshelf.Cookbook, sourceInfo *SourceInfo)
- func (lf *LockFile) GetCookbook(name string) (*CookbookLock, string, bool)
- func (lf *LockFile) GetRevision() int
- func (lf *LockFile) HasCookbook(name string) bool
- func (lf *LockFile) IsOutdated(maxAge time.Duration) bool
- func (lf *LockFile) ListCookbooks() map[string]*CookbookLock
- func (lf *LockFile) ToJSON() ([]byte, error)
- func (lf *LockFile) ToRubyFormat(dependencies []string) ([]byte, error)
- func (lf *LockFile) UpdateGeneratedAt()
- type Manager
- func (m *Manager) Backup() error
- func (m *Manager) Exists() bool
- func (m *Manager) Generate(resolution *resolver.Resolution) (*LockFile, error)
- func (m *Manager) GenerateBoth(resolution *resolver.Resolution, dependencies []string) error
- func (m *Manager) GetPath() string
- func (m *Manager) GetRubyPath() string
- func (m *Manager) IsOutdated() (bool, error)
- func (m *Manager) Load() (*LockFile, error)
- func (m *Manager) Remove() error
- func (m *Manager) RemoveBoth() error
- func (m *Manager) RemoveRuby() error
- func (m *Manager) RubyExists() bool
- func (m *Manager) Save(lockFile *LockFile) error
- func (m *Manager) SaveBoth(lockFile *LockFile, dependencies []string) error
- func (m *Manager) SaveRuby(lockFile *LockFile, dependencies []string) error
- func (m *Manager) Update(resolution *resolver.Resolution) error
- func (m *Manager) UpdateBoth(resolution *resolver.Resolution, dependencies []string) error
- func (m *Manager) Validate() error
- type SourceInfo
- type SourceLock
Constants ¶
const ( // DefaultLockFileName is the default name for lock files DefaultLockFileName = "Berksfile.go.lock" // RubyLockFileName is the Ruby Berkshelf compatible lock file name RubyLockFileName = "Berksfile.lock" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CookbookLock ¶
type CookbookLock struct {
Version string `json:"version"`
Dependencies map[string]string `json:"dependencies,omitempty"`
Source *SourceInfo `json:"source,omitempty"`
}
CookbookLock represents a locked cookbook with its resolved dependencies
type LockFile ¶
type LockFile struct {
Revision int `json:"revision"`
GeneratedAt time.Time `json:"generated_at"`
Sources map[string]*SourceLock `json:"sources"`
}
LockFile represents a Berksfile.lock file structure
func NewLockFile ¶
func NewLockFile() *LockFile
NewLockFile creates a new lock file with current revision
func (*LockFile) AddCookbook ¶
func (lf *LockFile) AddCookbook(sourceKey string, cookbook *berkshelf.Cookbook, sourceInfo *SourceInfo)
AddCookbook adds a cookbook to the lock file under the specified source key
func (*LockFile) GetCookbook ¶
func (lf *LockFile) GetCookbook(name string) (*CookbookLock, string, bool)
GetCookbook retrieves a cookbook from the lock file
func (*LockFile) GetRevision ¶
GetRevision returns the lock file format revision
func (*LockFile) HasCookbook ¶
HasCookbook checks if a cookbook exists in the lock file
func (*LockFile) IsOutdated ¶
IsOutdated checks if the lock file is older than the specified duration
func (*LockFile) ListCookbooks ¶
func (lf *LockFile) ListCookbooks() map[string]*CookbookLock
ListCookbooks returns all cookbooks in the lock file
func (*LockFile) ToRubyFormat ¶
ToRubyFormat serializes the lock file to Ruby Berkshelf format
func (*LockFile) UpdateGeneratedAt ¶
func (lf *LockFile) UpdateGeneratedAt()
UpdateGeneratedAt updates the generation timestamp
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles lock file operations for both JSON and Ruby formats
func NewManager ¶
NewManager creates a new lock file manager
func NewManagerWithPath ¶
NewManagerWithPath creates a new lock file manager with custom path
func (*Manager) Generate ¶
func (m *Manager) Generate(resolution *resolver.Resolution) (*LockFile, error)
Generate creates a lock file from a resolution result
func (*Manager) GenerateBoth ¶
func (m *Manager) GenerateBoth(resolution *resolver.Resolution, dependencies []string) error
GenerateBoth creates and saves both JSON and Ruby format lock files
func (*Manager) GetRubyPath ¶
GetRubyPath returns the Ruby lock file path
func (*Manager) IsOutdated ¶
IsOutdated checks if the lock file needs updating
func (*Manager) RemoveBoth ¶
RemoveBoth deletes both lock files
func (*Manager) RemoveRuby ¶
RemoveRuby deletes the Ruby lock file
func (*Manager) RubyExists ¶
RubyExists checks if the Ruby lock file exists
func (*Manager) Update ¶
func (m *Manager) Update(resolution *resolver.Resolution) error
Update updates an existing lock file with new resolution data
func (*Manager) UpdateBoth ¶
func (m *Manager) UpdateBoth(resolution *resolver.Resolution, dependencies []string) error
UpdateBoth updates both JSON and Ruby format lock files
type SourceInfo ¶
type SourceInfo struct {
Type string `json:"type"`
URL string `json:"url,omitempty"`
Path string `json:"path,omitempty"`
Branch string `json:"branch,omitempty"`
Tag string `json:"tag,omitempty"`
Ref string `json:"ref,omitempty"`
}
SourceInfo contains additional source information for the cookbook
type SourceLock ¶
type SourceLock struct {
Type string `json:"type,omitempty"`
URL string `json:"url,omitempty"`
Cookbooks map[string]*CookbookLock `json:"cookbooks"`
}
SourceLock represents a cookbook source in the lock file