Documentation
¶
Index ¶
- type FileVersion
- type Manager
- func (m *Manager) CleanupOldVersions(outputDir string) error
- func (m *Manager) ComputeHash(filePath string) (string, error)
- func (m *Manager) GenerateVersion(protoPath string) (string, error)
- func (m *Manager) GetCurrentVersion(protoPath string) (*FileVersion, error)
- func (m *Manager) GetVersionedOutputPath(baseOutputPath, version string) string
- func (m *Manager) IsEnabled() bool
- func (m *Manager) SaveVersion(protoPath, version string) error
- func (m *Manager) ShouldGenerateNewVersion(protoPath string) (bool, error)
- type Options
- type OutputFormat
- type Strategy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileVersion ¶
type FileVersion struct {
ProtoPath string // Path to proto file
Version string // Version identifier
Hash string // Content hash
Timestamp time.Time // Creation time
OutputPath string // Path to generated output
GeneratedAt time.Time // When it was generated
}
FileVersion represents a versioned file
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages file versioning
func (*Manager) CleanupOldVersions ¶
CleanupOldVersions removes old versions keeping only the latest N versions
func (*Manager) ComputeHash ¶
ComputeHash computes SHA256 hash of a file
func (*Manager) GenerateVersion ¶
GenerateVersion generates a new version identifier
func (*Manager) GetCurrentVersion ¶
func (m *Manager) GetCurrentVersion(protoPath string) (*FileVersion, error)
GetCurrentVersion gets the current version for a proto file
func (*Manager) GetVersionedOutputPath ¶
GetVersionedOutputPath returns the output path with version
func (*Manager) SaveVersion ¶
SaveVersion saves the version state
type Options ¶
type Options struct {
Enabled bool
Strategy Strategy
OutputFormat OutputFormat
KeepVersions int
StateDir string
}
Options contains versioning options
type OutputFormat ¶
type OutputFormat string
OutputFormat represents how versioned files are organized
const ( FormatDirectory OutputFormat = "directory" // Create version directories (v1/, v2/) FormatSuffix OutputFormat = "suffix" // Add version suffix (_v1, _v2) )
Click to show internal directories.
Click to hide internal directories.