hostingdomain

package
v14.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnsupportedServiceError

func UnsupportedServiceError() error

UnsupportedServiceError communicates that the origin remote runs an unknown code hosting platform.

Types

type Config

type Config struct {
	// Hostname override
	Hostname string

	// the Organization within the hosting platform that owns the repo
	Organization string

	// repo name within the organization
	Repository string
}

Config contains data needed by all platform connectors.

func (Config) HostnameWithStandardPort

func (self Config) HostnameWithStandardPort() string

type Connector

type Connector interface {
	// DefaultProposalMessage provides the text that the form for creating new proposals
	// on the respective hosting platform is prepopulated with.
	DefaultProposalMessage(proposal Proposal) string

	// FindProposal provides details about the proposal for the given branch into the given target branch.
	// Returns nil if no proposal exists.
	FindProposal(branch, target gitdomain.LocalBranchName) (*Proposal, error)

	// SquashMergeProposal squash-merges the proposal with the given number
	// using the given commit message.
	SquashMergeProposal(number int, message gitdomain.CommitMessage) error

	// NewProposalURL provides the URL of the page
	// to create a new proposal online.
	NewProposalURL(branch, parentBranch gitdomain.LocalBranchName) (string, error)

	// RepositoryURL provides the URL where the current repository can be found online.
	RepositoryURL() string

	// UpdateProposalTarget updates the target branch of the given proposal.
	UpdateProposalTarget(number int, target gitdomain.LocalBranchName) error
}

Connector describes the activities that Git Town can perform on code hosting platforms. Individual implementations exist to talk to specific hosting platforms.

type Proposal

type Proposal struct {
	// whether this proposal can be merged via the API
	MergeWithAPI bool

	// the number used to identify the proposal on the hosting platform
	Number int

	// name of the target branch ("base") of this proposal
	Target gitdomain.LocalBranchName

	// textual title of the proposal
	Title string
}

Proposal contains information about a change request on a code hosting platform. Alternative names are "pull request" or "merge request".

Jump to

Keyboard shortcuts

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