domain

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Finder

type Finder struct {
	Binary string   `json:"binary"`
	Args   []string `json:"args,omitempty"`
	Extra  []string `json:"extra,omitempty"`
}

type Icons

type Icons struct {
	Modified  string `json:"modified,omitempty"`
	Untracked string `json:"untracked,omitempty"`
	DiffError string `json:"diffError,omitempty"`
	DiffClean string `json:"diffClean,omitempty"`
	Ahead     string `json:"ahead,omitempty"`
	Behind    string `json:"behind,omitempty"`
	NA        string `json:"na,omitempty"`
}

type Project

type Project struct {
	Source      *ProviderSource `json:"source,omitempty"`
	Clone       *bool           `json:"clone,omitempty"`
	ID          string          `json:"id"`
	Name        string          `json:"name"`
	Path        string          `json:"path"`
	Desc        string          `json:"desc,omitempty"`
	Hash        string          `json:"-"`
	AbsPath     string          `json:"-"`
	Repos       []Repository    `json:"repos,omitempty"`
	SubProjects []Project       `json:"subprojects,omitempty"`
	Include     []string        `json:"include,omitempty"`
	Exclude     []string        `json:"exclude,omitempty"`
}

Project represents a single project that can have many child projects, while each project can have many repositories.

func (*Project) CalculateHash added in v0.10.0

func (p *Project) CalculateHash() error

func (*Project) Filter

func (p *Project) Filter()

Filter filters the project repositories by user include/exclude filters.

func (Project) GetAllRepos

func (p Project) GetAllRepos(prefix ...string) []Repository

GetAllRepos returns a list of all repositories in the project.

func (Project) GetRepo

func (p Project) GetRepo(name, prefix string) (Repository, bool)

GetRepo returns a repository by name and initial prefix.

func (Project) GetRepoAbsPath

func (p Project) GetRepoAbsPath(repo Repository) (string, error)

GetRepoAbsPath returns an absolute path of one of its repositories.

func (Project) GetSubProject

func (p Project) GetSubProject(name, prefix string) (Project, bool)

GetSubProject returns a sub-project by name and initial prefix.

func (Project) ListReposWithNamespace

func (p Project) ListReposWithNamespace(prefix ...string) []string

ListReposWithNamespace returns a list of repository names with namespace.

type ProjectListKeyed

type ProjectListKeyed map[string]Project

ProjectList is a list of projects with keys.

type ProviderSource

type ProviderSource struct {
	Type   string `json:"type,omitempty"`
	Search string `json:"search,omitempty"`
}

ProviderSource represents a cloud-provider source of repositories.

func (ProviderSource) UniqueKey

func (ps ProviderSource) UniqueKey() string

UniqueKey returns a unique key for a specific provider source.

func (ProviderSource) Validate

func (ps ProviderSource) Validate() error

type RepoState

type RepoState string

RepoState represents the state of a repository.

var (
	RepoStateUnknown RepoState = "Unknown"
	RepoStateError   RepoState = "Error"
	RepoStateRemote  RepoState = "Remote"
	RepoStateNoLocal RepoState = "N/A"
	RepoStateOK      RepoState = "OK"
)

type Repository

type Repository struct {
	ID        string `json:"id,omitempty"`
	Name      string `json:"name,omitempty"`
	Namespace string `json:"namespace,omitempty"`
	Src       string `json:"src,omitempty"`
	Dir       string `json:"dir,omitempty"`
	URL       string `json:"url,omitempty"`
	Desc      string `json:"desc,omitempty"`

	Type    string    `json:"-"`
	AbsPath string    `json:"-"`
	State   RepoState `json:"-"`
	Reason  string    `json:"-"`
}

Repository represents a single repository from filesystem or git provider.

func (Repository) ContainedIn

func (r Repository) ContainedIn(paths []string) bool

func (Repository) GetName

func (r Repository) GetName() string

func (Repository) GetNameWithNamespace

func (r Repository) GetNameWithNamespace() string

func (Repository) GetSource

func (r Repository) GetSource() string

type Settings

type Settings struct {
	Cache   *bool  `json:"cache,omitempty"`
	Finder  Finder `json:"finder"`
	Icons   Icons  `json:"icons"`
	Theme   Theme  `json:"theme"`
	Verbose bool   `json:"verbose,omitempty"`
}

type Style

type Style struct {
	Color string `json:"color,omitempty"`
	Align string `json:"align,omitempty"`
	Width int    `json:"width,omitempty"`
}

type Theme

type Theme struct {
	// General
	Normal        Style `json:"normal,omitempty"`
	Bullet        Style `json:"bullet,omitempty"`
	PreviewHeader Style `json:"previewHeader,omitempty"`

	// Project
	ProjectTitle Style `json:"projectTitle,omitempty"`
	Provider     Style `json:"provider,omitempty"`
	Desc         Style `json:"desc,omitempty"`

	// Repository
	RepoTitle Style `json:"repoTitle,omitempty"`
	RepoPath  Style `json:"repoPath,omitempty"`
	GitOutput Style `json:"gitOutput,omitempty"`

	// Branch
	BranchName      Style `json:"branchName,omitempty"`
	BranchCurrent   Style `json:"branchCurrent,omitempty"`
	BranchIndicator Style `json:"branchIndicator,omitempty"`
	RemoteName      Style `json:"remoteName,omitempty"`

	// Tag
	TagIndicator Style `json:"tagIndicator,omitempty"`

	// Status
	Modified  Style `json:"modified,omitempty"`
	Untracked Style `json:"untracked,omitempty"`
	Diff      Style `json:"diff,omitempty"`
	Error     Style `json:"error,omitempty"`

	// Table
	TableBorderStyle Style `json:"tableBorderStyle,omitempty"`
	TableHeader      Style `json:"tableHeader,omitempty"`
	TableRowEven     Style `json:"tableRowEven,omitempty"`
	TableRowOdd      Style `json:"tableRowOdd,omitempty"`
}

Jump to

Keyboard shortcuts

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