infrastructure

package
v4.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 2 Imported by: 4 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServiceTypeToProviderName

func ServiceTypeToProviderName(serviceType globalEntities.ServiceType) string

ServiceTypeToProviderName maps a ServiceType to the provider name string used for registry lookups. Returns empty string for unknown service types.

Exported for use by autobump (github.com/rios0rios0/autobump) and autoupdate (github.com/rios0rios0/autoupdate).

Types

type DiscovererFactory

type DiscovererFactory func(token string) globalEntities.RepositoryDiscoverer

DiscovererFactory is a constructor that creates a RepositoryDiscoverer given an auth token.

type ProviderFactory

type ProviderFactory func(token string) globalEntities.ForgeProvider

ProviderFactory is a constructor function that creates a ForgeProvider given an auth token.

type ProviderRegistry

type ProviderRegistry struct {
	// contains filtered or unexported fields
}

ProviderRegistry manages all registered Git provider implementations. It supports both factory-based creation (by name + token) and direct adapter lookup.

func NewProviderRegistry

func NewProviderRegistry() *ProviderRegistry

NewProviderRegistry creates an empty provider registry.

func (*ProviderRegistry) Get

func (r *ProviderRegistry) Get(name, token string) (globalEntities.ForgeProvider, error)

Get returns a configured provider instance for the given name and token.

func (*ProviderRegistry) GetAdapterByServiceType

func (r *ProviderRegistry) GetAdapterByServiceType(
	serviceType globalEntities.ServiceType,
) globalEntities.LocalGitAuthProvider

GetAdapterByServiceType returns the adapter for the given service type. Only works with adapters that implement LocalGitAuthProvider.

func (*ProviderRegistry) GetAdapterByURL

func (r *ProviderRegistry) GetAdapterByURL(url string) globalEntities.ForgeProvider

GetAdapterByURL returns the appropriate adapter for the given URL.

func (*ProviderRegistry) GetDiscoverer

func (r *ProviderRegistry) GetDiscoverer(name, token string) (globalEntities.RepositoryDiscoverer, error)

GetDiscoverer returns a configured discoverer instance for the given provider name and token.

func (*ProviderRegistry) GetReviewProvider

func (r *ProviderRegistry) GetReviewProvider(
	name, token string,
) (globalEntities.ReviewProvider, error)

GetReviewProvider returns a configured ReviewProvider instance for the given name and token. It returns an error if the provider does not implement ReviewProvider.

func (*ProviderRegistry) Names

func (r *ProviderRegistry) Names() []string

Names returns the list of registered provider factory names.

func (*ProviderRegistry) RegisterAdapter

func (r *ProviderRegistry) RegisterAdapter(adapter globalEntities.ForgeProvider)

RegisterAdapter adds a pre-created provider adapter for URL and service type lookups.

func (*ProviderRegistry) RegisterDiscoverer

func (r *ProviderRegistry) RegisterDiscoverer(name string, factory DiscovererFactory)

RegisterDiscoverer adds a discoverer factory under the given provider name.

func (*ProviderRegistry) RegisterFactory

func (r *ProviderRegistry) RegisterFactory(name string, factory ProviderFactory)

RegisterFactory adds a provider factory under the given name (e.g. "github").

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL