gitflow-core
Core domain types, traits, and business logic for the gf workspace.
Overview
gitflow-core provides the foundational types and abstractions used across the gf ecosystem. This crate is designed to be platform-agnostic, defining the core interfaces that platform-specific implementations (GitHub, GitLab, GitCode) must implement.
Features
- Domain Types: Issue, PR, Release, Review, Pipeline, Label, and more
- Platform Abstractions: Traits for cross-platform Git hosting services
- Error Handling: Consistent error types with
thiserror - Output Formatting: CLI output utilities with
mietteintegration - Auth Checking: Authentication status verification utilities
- Type Safety: Strongly typed enums and newtypes for domain concepts
Installation
Add to your Cargo.toml:
[]
= "0.8"
Usage
Domain Types
use ;
// Work with issues
let issue = Issue ;
Platform Traits
use ;
// Implement platform-specific providers
;
Error Handling
use Error;
Output Formatting
use ;
// Format CLI output
let output = success;
println!;
// Handle errors
let error = new;
eprintln!;
Core Modules
issue
Issue tracking types and operations:
Issue- Issue data structureIssueState- Open/Closed stateIssueProvider- Provider trait for issue operations
pr
Pull request types and operations:
PullRequest- PR data structurePrState- Open/Closed/Merged statePrProvider- Provider trait for PR operations
release
Release management types:
Release- Release data structureReleaseProvider- Provider trait for release operations
review
Code review types:
Review- Review data structureReviewProvider- Provider trait for review operations
pipeline
CI/CD pipeline types:
Pipeline- Pipeline data structurePipelineStatus- Success/Failure/Running statusPipelineProvider- Provider trait for pipeline operations
platform
URL-based platform detection (not a capability trait — see the provider traits above for the actual per-platform abstraction):
Platform- Platform enum (GitHub/GitLab/GitCode)PlatformDetection- detection result, withPlatform::detect_from_remote_url()
auth
Authentication types and checking:
AuthChecker- Authentication status verificationAuthCheckResult- Auth check results
Design Principles
- Platform Agnostic: Core types work across all supported platforms
- Type Safety: Use enums and newtypes to prevent invalid states
- Error Handling: Consistent error types with context
- No I/O: Pure domain logic without network or file I/O
- Serializable: All types support
serdefor JSON/YAML/TOML
Ecosystem
This crate is part of the gf workspace:
- gitflow-core (this crate) - Core types and traits
- gitflow-github - GitHub platform implementation
- gitflow-gitlab - GitLab platform implementation
- gitflow-gitcode - GitCode platform implementation
- gf - CLI application
Documentation
Contributing
Contributions are welcome! Please see the main repository for contribution guidelines.
License
Licensed under the MIT License. See LICENSE for details.