git

package
v2.0.0-...-12a7e32 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckoutSource

func CheckoutSource(folder string, source *Source) error

CheckoutSource for the local runtime server folder is the folder to check out the source code to Modifies source path to set it to checked out repo absolute path locally.

func GetRepoRoot

func GetRepoRoot(fullPath string) (string, error)

GetRepoRoot determines the repo root from a full path. Returns empty string and no error if not found

Types

type Gitter

type Gitter interface {
	Clone(repo string) error
	FetchAll(repo string) error
	Checkout(repo, branchOrCommit string) error
	RepoDir(repo string) string
}

func NewGitter

func NewGitter(folder string) Gitter

type Source

type Source struct {
	// is it a local folder intended for a local runtime?
	Local bool
	// absolute path to service folder in local mode
	FullPath string
	// path of folder to repo root
	// be it local or github repo
	Folder string
	// github ref
	Ref string
	// for cloning purposes
	// blank for local
	Repo string
	// dir to repo root
	// blank for non local
	LocalRepoRoot string
}

Source is not just git related @todo move

func ParseSource

func ParseSource(source string) (*Source, error)

ParseSource parses a `micro run/update/kill` source.

func ParseSourceLocal

func ParseSourceLocal(workDir, source string, pathExistsFunc ...func(path string) (bool, error)) (*Source, error)

ParseSourceLocal detects and handles local pathes too workdir should be used only from the CLI @todo better interface for this function. PathExistsFunc exists only for testing purposes, to make the function side effect free.

func (*Source) RuntimeName

func (s *Source) RuntimeName() string

Name to be passed to RPC call runtime.Create Update Delete eg: `helloworld/api`, `crufter/myrepo/helloworld/api`, `localfolder`

func (*Source) RuntimeSource

func (s *Source) RuntimeSource() string

Source to be passed to RPC call runtime.Create Update Delete eg: `helloworld`, `github.com/crufter/myrepo/helloworld`, `/path/to/localrepo/localfolder`

Jump to

Keyboard shortcuts

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