git

package
v0.0.0-...-5dc3574 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Copyright © 2019 Marcello de Sales <marcello.desales@gmail.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2019 Marcello de Sales <marcello.desales@gmail.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2019 Marcello de Sales <marcello.desales@gmail.com>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneGitRepo

func CloneGitRepo(cloneRequest *CloneGitRepoRequest, config *config.Configuration) (int, []error)

*

  • Clones the repo implementation, returning the exit code and any error message

Types

type CloneGitRepoRequest

type CloneGitRepoRequest struct {
	Url  string
	Type *GitRepoType
	//Tag string
	//Branch string
	//Revision string
	Depth uint
	//SparsePaths []string
	CloneLocation  string
	Force          bool
	PrivateKeyFile string
}

type GitRepoType

type GitRepoType struct {
	Protocol string
	Host     string
	User     string
	Repo     string
}

func (GitRepoType) GetRepoDir

func (gitRepo GitRepoType) GetRepoDir() string

func (GitRepoType) GetUserDir

func (gitRepo GitRepoType) GetUserDir() string

type GitServiceType

type GitServiceType struct{}
var GitService GitServiceType

func (GitServiceType) GetOrgLocalPath

func (service GitServiceType) GetOrgLocalPath(gitRepoClone *CloneGitRepoRequest, config *config.Configuration) string

*

  • Get the repo clone dir expected to be created

func (GitServiceType) GetRepoLocalPath

func (service GitServiceType) GetRepoLocalPath(gitRepoClone *CloneGitRepoRequest, config *config.Configuration) string

*

  • Get the org

func (GitServiceType) GoCloneRepo

func (service GitServiceType) GoCloneRepo(gitRepoCloneRequest *CloneGitRepoRequest, config *config.Configuration) error

*

  • Clone the git repo to the clone location using go-git based on the request

func (GitServiceType) GoPrintTree

func (service GitServiceType) GoPrintTree(gitRepoClone *CloneGitRepoRequest) (string, error)

*

  • Print the list of the files in the dir just like the "tree" unix command

func (GitServiceType) Init

func (service GitServiceType) Init(repoUrl, privateKeyPath string, forceClone bool) (*CloneGitRepoRequest, error)

Init from the CLI inputs

func (GitServiceType) MakeCloneDir

func (service GitServiceType) MakeCloneDir(gitRepoClone *CloneGitRepoRequest, config *config.Configuration) error

*

  • Makes the base clone dir is the org and parts of the repo dir since the clone service creates the repo dir

func (GitServiceType) ParseRepoString

func (service GitServiceType) ParseRepoString(gitRepoClone *CloneGitRepoRequest) error

*

  • @return a new instance of the GitRepoType

func (GitServiceType) VerifyCloneDir

func (service GitServiceType) VerifyCloneDir(gitRepoClone *CloneGitRepoRequest, config *config.Configuration) (bool, error)

*

  • Make sure the clone dir does not exist. If it does, force clone must be provided to not fail.

Jump to

Keyboard shortcuts

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