Documentation
¶
Index ¶
- func GenerateCategoryMarkdown(frontMatter CategoryFrontMatter, body string) (string, error)
- func GenerateCollectionMarkdown(frontMatter CollectionFrontMatter, body string) (string, error)
- func GenerateCommitMessage(action string, entityType string, entityID string, summary string) string
- func GenerateProductMarkdown(frontMatter ProductFrontMatter, body string) (string, error)
- func GenerateReleaseTagName() string
- func GetCategoryFilePath(slug string) string
- func GetCollectionFilePath(slug string) string
- func GetProductFilePath(sku, categorySlug string) string
- type CategoryFrontMatter
- type CollectionFrontMatter
- type CommitBuilder
- func (cb *CommitBuilder) Commit(opts CommitOptions) (string, error)
- func (cb *CommitBuilder) CommitAll(message string) (string, error)
- func (cb *CommitBuilder) CommitChange(filePath string, content string, message string) (string, error)
- func (cb *CommitBuilder) CommitDelete(filePath string, message string) (string, error)
- func (cb *CommitBuilder) CommitMultiple(changes map[string]string, message string) (string, error)
- func (cb *CommitBuilder) DeleteFile(filePath string) error
- func (cb *CommitBuilder) GetCurrentCommitHash() string
- func (cb *CommitBuilder) GetStatus() (git.Status, error)
- func (cb *CommitBuilder) HasChanges() (bool, error)
- func (cb *CommitBuilder) StageAll() error
- func (cb *CommitBuilder) StageFile(filePath string) error
- func (cb *CommitBuilder) WriteFile(filePath string, content string) error
- type CommitOptions
- type HTTPGitClient
- func (c *HTTPGitClient) HealthCheck(ctx context.Context) error
- func (c *HTTPGitClient) PushChange(ctx context.Context, filePath string, content string, commitMessage string) error
- func (c *HTTPGitClient) PushDelete(ctx context.Context, filePath string, commitMessage string) error
- func (c *HTTPGitClient) PushMultiple(ctx context.Context, changes map[string]string, commitMessage string) error
- type ProductFrontMatter
- type PushClient
- type PushOptions
- type TagClient
- func (tc *TagClient) CreateAndPushTag(opts TagOptions, remoteName string, remoteURL string) (string, error)
- func (tc *TagClient) CreateTag(opts TagOptions) (string, error)
- func (tc *TagClient) DeleteTag(tagName string) error
- func (tc *TagClient) GenerateSemverTagName() (string, error)
- func (tc *TagClient) GetTag(tagName string) (*object.Tag, error)
- func (tc *TagClient) ListTags() ([]string, error)
- func (tc *TagClient) PushAllTags(remoteName string, remoteURL string) error
- func (tc *TagClient) PushTag(tagName string, remoteName string, remoteURL string) error
- func (tc *TagClient) TagExists(tagName string) (bool, error)
- type TagOptions
- type ValidationError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateCategoryMarkdown ¶
func GenerateCategoryMarkdown(frontMatter CategoryFrontMatter, body string) (string, error)
GenerateCategoryMarkdown generates a markdown file with YAML front-matter for a category
func GenerateCollectionMarkdown ¶
func GenerateCollectionMarkdown(frontMatter CollectionFrontMatter, body string) (string, error)
GenerateCollectionMarkdown generates a markdown file with YAML front-matter for a collection
func GenerateCommitMessage ¶
func GenerateCommitMessage(action string, entityType string, entityID string, summary string) string
GenerateCommitMessage generates a descriptive commit message for catalog changes
func GenerateProductMarkdown ¶
func GenerateProductMarkdown(frontMatter ProductFrontMatter, body string) (string, error)
GenerateProductMarkdown generates a markdown file with YAML front-matter for a product
func GenerateReleaseTagName ¶
func GenerateReleaseTagName() string
GenerateReleaseTagName generates a timestamped release tag name
func GetCategoryFilePath ¶
GetCategoryFilePath returns the file path for a category markdown file Format: categories/{slug}.md
func GetCollectionFilePath ¶
GetCollectionFilePath returns the file path for a collection markdown file Format: collections/{slug}.md
func GetProductFilePath ¶
GetProductFilePath returns the file path for a product markdown file Format: products/{category-slug}/{SKU}.md
Types ¶
type CategoryFrontMatter ¶
type CategoryFrontMatter struct {
ID string `yaml:"id"`
Name string `yaml:"name"`
Slug string `yaml:"slug"`
Description *string `yaml:"description,omitempty"`
ParentID *string `yaml:"parent_id,omitempty"`
DisplayOrder int `yaml:"display_order"`
CreatedAt string `yaml:"created_at"`
UpdatedAt string `yaml:"updated_at"`
}
CategoryFrontMatter represents category metadata for YAML front-matter
type CollectionFrontMatter ¶
type CollectionFrontMatter struct {
ID string `yaml:"id"`
Name string `yaml:"name"`
Slug string `yaml:"slug"`
Description *string `yaml:"description,omitempty"`
ProductIDs []string `yaml:"product_ids"`
DisplayOrder int `yaml:"display_order"`
CreatedAt string `yaml:"created_at"`
UpdatedAt string `yaml:"updated_at"`
}
CollectionFrontMatter represents collection metadata for YAML front-matter
type CommitBuilder ¶
type CommitBuilder struct {
// contains filtered or unexported fields
}
CommitBuilder handles git commit operations
func NewCommitBuilder ¶
func NewCommitBuilder(repoPath string) (*CommitBuilder, error)
NewCommitBuilder creates a new commit builder for a git repository
func (*CommitBuilder) Commit ¶
func (cb *CommitBuilder) Commit(opts CommitOptions) (string, error)
Commit creates a commit with the staged changes
func (*CommitBuilder) CommitAll ¶
func (cb *CommitBuilder) CommitAll(message string) (string, error)
CommitAll stages and commits all changes in the repository
func (*CommitBuilder) CommitChange ¶
func (cb *CommitBuilder) CommitChange(filePath string, content string, message string) (string, error)
CommitChange is a convenience method to write a file, stage it, and commit in one operation
func (*CommitBuilder) CommitDelete ¶
func (cb *CommitBuilder) CommitDelete(filePath string, message string) (string, error)
CommitDelete is a convenience method to delete a file, stage it, and commit
func (*CommitBuilder) CommitMultiple ¶
CommitMultiple commits multiple file changes in a single commit
func (*CommitBuilder) DeleteFile ¶
func (cb *CommitBuilder) DeleteFile(filePath string) error
DeleteFile deletes a file from the repository
func (*CommitBuilder) GetCurrentCommitHash ¶
func (cb *CommitBuilder) GetCurrentCommitHash() string
GetCurrentCommitHash returns the current HEAD commit hash
func (*CommitBuilder) GetStatus ¶
func (cb *CommitBuilder) GetStatus() (git.Status, error)
GetStatus returns the current status of the working tree
func (*CommitBuilder) HasChanges ¶
func (cb *CommitBuilder) HasChanges() (bool, error)
HasChanges checks if there are any uncommitted changes
func (*CommitBuilder) StageAll ¶
func (cb *CommitBuilder) StageAll() error
StageAll stages all changes in the repository
func (*CommitBuilder) StageFile ¶
func (cb *CommitBuilder) StageFile(filePath string) error
StageFile stages a file for commit
type CommitOptions ¶
CommitOptions contains options for creating a commit
type HTTPGitClient ¶
type HTTPGitClient struct {
// contains filtered or unexported fields
}
HTTPGitClient handles git operations via HTTP protocol to the git-server
func NewHTTPGitClient ¶
func NewHTTPGitClient(serverURL, repoName, localPath string, logger *zap.Logger) *HTTPGitClient
NewHTTPGitClient creates a new HTTP git client
func (*HTTPGitClient) HealthCheck ¶
func (c *HTTPGitClient) HealthCheck(ctx context.Context) error
HealthCheck verifies connectivity to the git-server
func (*HTTPGitClient) PushChange ¶
func (c *HTTPGitClient) PushChange(ctx context.Context, filePath string, content string, commitMessage string) error
PushChange creates a commit with the given file changes and pushes to git-server
func (*HTTPGitClient) PushDelete ¶
func (c *HTTPGitClient) PushDelete(ctx context.Context, filePath string, commitMessage string) error
PushDelete deletes a file and pushes the change to git-server
func (*HTTPGitClient) PushMultiple ¶
func (c *HTTPGitClient) PushMultiple(ctx context.Context, changes map[string]string, commitMessage string) error
PushMultiple commits multiple file changes in a single commit and pushes
type ProductFrontMatter ¶
type ProductFrontMatter struct {
ID string `yaml:"id"`
SKU string `yaml:"sku"`
Title string `yaml:"title"`
Price float64 `yaml:"price"`
Currency string `yaml:"currency"`
InventoryStatus string `yaml:"inventory_status"`
InventoryQuantity *int `yaml:"inventory_quantity,omitempty"`
CategoryID string `yaml:"category_id"`
CollectionIDs []string `yaml:"collection_ids,omitempty"`
Images []string `yaml:"images,omitempty"`
Metadata map[string]interface{} `yaml:"metadata,omitempty"`
CreatedAt string `yaml:"created_at"`
UpdatedAt string `yaml:"updated_at"`
}
ProductFrontMatter represents product metadata for YAML front-matter
type PushClient ¶
type PushClient struct {
// contains filtered or unexported fields
}
PushClient handles git push operations
func NewPushClient ¶
func NewPushClient(repoPath string, remoteName string, remoteURL string) (*PushClient, error)
NewPushClient creates a new push client for a git repository
func (*PushClient) EnsureRemote ¶
func (pc *PushClient) EnsureRemote() error
EnsureRemote ensures the remote exists with the correct URL
func (*PushClient) GetRemoteName ¶
func (pc *PushClient) GetRemoteName() string
GetRemoteName returns the configured remote name
func (*PushClient) GetRemoteURL ¶
func (pc *PushClient) GetRemoteURL() string
GetRemoteURL returns the configured remote URL
func (*PushClient) Push ¶
func (pc *PushClient) Push(opts PushOptions) error
Push pushes commits to the remote repository
func (*PushClient) PushBranch ¶
func (pc *PushClient) PushBranch() error
PushBranch pushes the current branch to remote
func (*PushClient) PushWithRefSpec ¶
func (pc *PushClient) PushWithRefSpec(refSpecs ...string) error
PushWithRefSpec pushes specific refs to remote
type PushOptions ¶
type PushOptions struct {
// RefSpecs to push (e.g., "refs/heads/main:refs/heads/main")
// If empty, pushes current branch
RefSpecs []string
// Force push (not recommended for shared branches)
Force bool
// Auth credentials (if required)
Auth transport.AuthMethod
}
PushOptions contains options for pushing to remote
type TagClient ¶
type TagClient struct {
// contains filtered or unexported fields
}
TagClient handles git tag operations
func NewTagClient ¶
NewTagClient creates a new tag client for a git repository
func (*TagClient) CreateAndPushTag ¶
func (tc *TagClient) CreateAndPushTag(opts TagOptions, remoteName string, remoteURL string) (string, error)
CreateAndPushTag creates a tag and pushes it to remote in one operation
func (*TagClient) CreateTag ¶
func (tc *TagClient) CreateTag(opts TagOptions) (string, error)
CreateTag creates an annotated tag
func (*TagClient) GenerateSemverTagName ¶
GenerateSemverTagName generates next semantic version tag Increments patch version (e.g., v1.0.0 -> v1.0.1)
func (*TagClient) PushAllTags ¶
PushAllTags pushes all tags to remote
type TagOptions ¶
type TagOptions struct {
// Tag name (e.g., "v1.0.0" or "2026-03-10")
Name string
// Tag message
Message string
// Tagger signature (optional, defaults to "GitStore Admin")
Tagger *object.Signature
// Target commit hash (optional, defaults to HEAD)
Target string
}
TagOptions contains options for creating a tag
type ValidationError ¶
ValidationError represents a validation error from the git server
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string