Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Capabilities ¶
Capabilities represents fetch-related capabilities advertised by a Git server.
func (*Capabilities) CanFetchBySHA ¶
func (c *Capabilities) CanFetchBySHA() bool
CanFetchBySHA returns true if the server allows fetching by arbitrary SHA.
func (*Capabilities) CanFetchShallow ¶
func (c *Capabilities) CanFetchShallow() bool
CanFetchShallow returns true if the server supports shallow clones.
type CapabilityDetector ¶
type CapabilityDetector struct {
// contains filtered or unexported fields
}
CapabilityDetector detects Git server capabilities.
func NewCapabilityDetector ¶
func NewCapabilityDetector() *CapabilityDetector
NewCapabilityDetector creates a new CapabilityDetector with the default session factory.
func NewCapabilityDetectorWithFactory ¶
func NewCapabilityDetectorWithFactory(factory SessionFactory) *CapabilityDetector
NewCapabilityDetectorWithFactory creates a new CapabilityDetector with a custom session factory.
func (*CapabilityDetector) ChooseStrategy ¶
func (d *CapabilityDetector) ChooseStrategy(caps *Capabilities) StrategyType
The ChooseStrategy method in the CapabilityDetector struct is determining the appropriate strategy type based on the capabilities provided by the Git server. It takes a Capabilities struct as input and evaluates the capabilities to decide which strategy should be used for fetching data from the server.
func (*CapabilityDetector) Detect ¶
func (d *CapabilityDetector) Detect(url string, auth transport.AuthMethod) (*Capabilities, error)
Detect ask the server for capabilities and return the supported capabilities Detect queries the Git server at the given URL and returns its capabilities.
type DefaultSessionFactory ¶
type DefaultSessionFactory struct{}
DefaultSessionFactory is the production implementation that connects to real Git servers.
func NewDefaultSessionFactory ¶
func NewDefaultSessionFactory() *DefaultSessionFactory
NewDefaultSessionFactory creates a new DefaultSessionFactory.
func (*DefaultSessionFactory) NewSession ¶
func (f *DefaultSessionFactory) NewSession(url string, auth transport.AuthMethod) (UploadPackSession, error)
NewSession creates a new upload-pack session to the specified Git server.
type SessionFactory ¶
type SessionFactory interface {
NewSession(url string, auth transport.AuthMethod) (UploadPackSession, error)
}
SessionFactory creates upload-pack sessions to Git servers. Implementations can be swapped for testing or custom transport logic.
type StrategyType ¶
type StrategyType int
const ( StrategyShallowSHA StrategyType = iota StrategyFullSHA StrategyIncrementalDeepen StrategyFullClone )
func (StrategyType) String ¶
func (st StrategyType) String() string