scm

package
v1.0.1-gitspaces-beta Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoDefaultBranch = errors.New("no default branch")
)
View Source
var WireSet = wire.NewSet(
	ProvideSCM,
)

WireSet provides a wire set for this package.

Functions

This section is empty.

Types

type CodeRepositoryRequest

type CodeRepositoryRequest struct {
	URL string `json:"url"`
}

type CodeRepositoryResponse

type CodeRepositoryResponse struct {
	URL               string `json:"url"`
	Branch            string `json:"branch,omitempty"`
	CodeRepoIsPrivate bool   `json:"is_private"`
}

type SCM

type SCM interface {
	// RepoNameAndDevcontainerConfig fetches repository name & devcontainer config file from the given repo and branch.
	RepoNameAndDevcontainerConfig(
		ctx context.Context,
		gitspaceConfig *types.GitspaceConfig,
	) (string, *types.DevcontainerConfig, error)

	// CheckValidCodeRepo checks if the current URL is a valid and accessible code repo,
	// input can be connector info, user token etc.
	CheckValidCodeRepo(ctx context.Context, request CodeRepositoryRequest) (*CodeRepositoryResponse, error)
}

func NewSCM

func NewSCM() SCM

func ProvideSCM

func ProvideSCM() SCM

Jump to

Keyboard shortcuts

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