location

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package location defines the Location domain entity, its factory, and the Service port interface. Consumers depend on Service rather than any concrete implementation to preserve the hexagonal architecture boundary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Location

type Location struct {
	Key        string
	Path       string
	ConfigFile string
}

Location represents a single gitconfig includeIf entry: a repository path pattern associated with a dedicated gitconfig file and a short lookup key.

func NewLocation

func NewLocation(key string, location string) *Location

NewLocation creates a Location for the given key and path. The ConfigFile is set to ~/.gitconfigs/<key>.gitconfig automatically.

func (Location) ToSection

func (l Location) ToSection() (string, error)

Returns the section composed from the location object this section is the text that usually goes into the gitconfig file

type Service

type Service interface {
	GetLocations() ([]Location, error)
	FindLocationByKey(key string) (*Location, error)
	SaveLocation(key string, location string) error
	DeleteLocation(key string) error
}

Service is the port that defines all location management operations. Consumers (e.g. CLI adapters) depend on this interface, never on the concrete implementation, keeping the hexagonal boundary intact.

Jump to

Keyboard shortcuts

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