Documentation
¶
Index ¶
- type RepoSpec
- func (rs *RepoSpec) Checkout(ctx context.Context, reference plumbing.ReferenceName) (*git.Repository, string, error)
- func (rs *RepoSpec) CloneDirectory(branch string) string
- func (rs *RepoSpec) ListBranches(ctx context.Context) ([]*plumbing.Reference, error)
- func (rs *RepoSpec) Name() string
- func (rs *RepoSpec) Open(ctx context.Context) (*git.Repository, error)
- func (rs *RepoSpec) ResolveRevion(ctx context.Context, ref string) (*plumbing.Hash, error)
- type RepoSpecOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RepoSpec ¶
type RepoSpec struct {
URL string
Credentials transport.AuthMethod
Progress io.Writer
// contains filtered or unexported fields
}
func NewRepoSpec ¶
func NewRepoSpec(url string, credentials transport.AuthMethod, opts ...RepoSpecOption) *RepoSpec
NewRepoSpec creates a new RepoSpec instance with the given URL and credentials. Optional functional options can be provided to configure the RepoSpec's behavior, such as adding tracing support.
func (*RepoSpec) Checkout ¶
func (rs *RepoSpec) Checkout(ctx context.Context, reference plumbing.ReferenceName) (*git.Repository, string, error)
Checkout checks out a specific reference and returns the repository and directory. It creates a shallow clone of the reference to enable concurrent operations.
func (*RepoSpec) CloneDirectory ¶
func (*RepoSpec) ListBranches ¶
type RepoSpecOption ¶
type RepoSpecOption func(*RepoSpec)
RepoSpecOption is a functional option for configuring a RepoSpec.
func WithOtelTracer ¶
func WithOtelTracer(tracer trace.Tracer) RepoSpecOption
WithOtelTracer configures the RepoSpec to use the provided OpenTelemetry tracer for instrumentation.
func WithTracer ¶
func WithTracer(tracer *tracing.Tracer) RepoSpecOption
WithTracer configures the RepoSpec to use the provided tracer for instrumentation.
Click to show internal directories.
Click to hide internal directories.