go-micro: github.com/micro/go-micro/runtime/local/source/git Index | Files

package git

import "github.com/micro/go-micro/runtime/local/source/git"


Package Files


func CheckoutSource Uses

func CheckoutSource(folder string, source *Source, secrets map[string]string) 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 Uses

func GetRepoRoot(fullPath string) (string, error)

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

func IsLocal Uses

func IsLocal(workDir, source string, pathExistsFunc ...func(path string) (bool, error)) (bool, string)

IsLocal tries returns true and full path of directory if the path is a local one, and false and empty string if not.

func Uncompress Uses

func Uncompress(src string, dst string) error

Uncompress is a modified version of: https://gist.github.com/mimoo/25fc9716e0f1353791f5908f94d6e726

type Gitter Uses

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

func NewGitter Uses

func NewGitter(folder string, secrets map[string]string) Gitter

type Source Uses

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 Uses

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

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

func ParseSourceLocal Uses

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

ParseSourceLocal a version of ParseSource that detects and handles local paths. 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 Uses

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 Uses

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`

Package git imports 15 packages (graph). Updated 2020-09-20. Refresh now. Tools for package owners.