models

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App interface {
	Name() string

	GetCmd(target Target) (*exec.Cmd, error)
}

An app represents an application which can be started within the context of a Target.

type Repo

type Repo interface {
	Target

	// FullName gets the full name of the repository including its namespace
	FullName() string
	// Namespace gets the portion of the repository's full name prior to its final short name segment.
	Namespace() string

	// Service retrieves the details of the service hosting this repository
	Service() Service

	Website() string
	GitURL() string
	HttpURL() string

	// Exists checks whether a repository entry is present on the local filesystem
	// at the expected path.
	Exists() bool

	// Valid checks whether the current repo is initialized correctly.
	Valid() bool
}

A Repo represents a specific git repository

type Scratchpad

type Scratchpad interface {
	Target
	Exists() bool
}

type Service

type Service interface {
	// The Domain is the canonical domain used to host repositories for
	// this service. For example: github.com or dev.azure.com
	Domain() string

	// The DirectoryGlob is used to determine how repository directories are
	// located on the file system within this service's repository tree.
	DirectoryGlob() string

	// Website fetches the HTTP(S) URL which may be used to view a web based
	// representation of a repository.
	Website(r Repo) string

	// HttpURL fetches the git+http URL which may be used to fetch or push
	// the repository's code.
	HttpURL(r Repo) string

	// GitURL fetches the git+ssh URL which may be used to fetch or push
	// the repository's code.
	GitURL(r Repo) string
}

A Service represents a git hosting service responsible for storing and serving repositories.

type Target

type Target interface {
	// Name gets the name
	Name() string

	// Path gets the location on the local filesystem where this target may be found.
	Path() string

	// TemplateContext gets the context used to render templates for this target type.
	TemplateContext() *TemplateContext
}

A Target represents a location where which an application may be launched

type TemplateContext

type TemplateContext struct {
	Target     Target
	Repo       Repo
	Scratchpad Scratchpad
	Service    Service
}

TemplateContext is used for the rendering of all templates for target objects

Jump to

Keyboard shortcuts

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