vc

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

README

Version Control Service

Service Id Action Description Request Response
version/control status run version control check on provided URL StatusRequest Info
version/control checkout if target directory already exist with matching origin URL, this action only pulls the latest changes without overriding local ones, otherwise full checkout CheckoutRequest Info
version/control commit commit commits local changes to the version control CommitRequest Info
version/control pull retrieve the latest changes from the origin PullRequest Info

Documentation

Index

Constants

View Source
const (
	//ServiceID version control service id
	ServiceID = "version/control"
	//CredentialKey represents credentials key
	CredentialKey = "***vc***"
)

Variables

This section is empty.

Functions

func New

func New() endly.Service

New creates a new version control service (git,svn)

Types

type CheckoutRequest

type CheckoutRequest struct {
	Type               string        `required:"true" description:"version control type: git, svn"`
	Origin             *url.Resource `required:"true" description:"checkout source for git or svn or simply file::/path"`
	Dest               *url.Resource `required:"true" description:"checkout dest defined by host and path URL"`
	Modules            []string      `description:"list of modules to checkout"`
	RemoveLocalChanges bool          `description:"flat to remove local directory before checkout"`
}

CheckoutRequest represents checkout request. If target directory exist and contains matching origin URL, only taking the latest changes without overriding local if performed, otherwise full checkout

func (*CheckoutRequest) Init

func (r *CheckoutRequest) Init() error

Init initializes request

func (*CheckoutRequest) Messages

func (r *CheckoutRequest) Messages() []*msg.Message

Items returns tag messages

func (*CheckoutRequest) Validate

func (r *CheckoutRequest) Validate() error

Validate validates request

type CheckoutResponse

type CheckoutResponse struct {
	Checkouts map[string]*Info
}

CheckoutResponse represents checkout response

type CommitRequest

type CommitRequest struct {
	Source  *url.Resource `required:"true" description:"location to local source code"`
	Type    string        `description:"version control type: git,svn"`
	Message string        `required:"true"`
}

CommitRequest represents a commit request

func (*CommitRequest) Init

func (r *CommitRequest) Init() error

Init initializes request

func (*CommitRequest) Validate

func (r *CommitRequest) Validate() error

Validate validates request

type CommitResponse

type CommitResponse struct {
	*Info
}

CommitResponse represents a commit response

type Info

type Info struct {
	IsVersionControlManaged bool   //returns true if directory is source controlled managed
	Origin                  string //Origin URL
	Revision                string //Origin Revision
	Branch                  string //current branch
	IsUptoDate              bool
	New                     []string //new files
	Untracked               []string //untracked files
	Modified                []string //modified files
	Deleted                 []string //deleted files
}

Info represents version control info

func (*Info) HasPendingChanges

func (r *Info) HasPendingChanges() bool

HasPendingChanges returns true if there are any untracked, new, modified, deleted files.

type PullRequest

type PullRequest struct {
	Type   string
	Dest   *url.Resource `required:"true"`
	Origin *url.Resource `required:"true"` //version control origin
}

PullRequest represents a pull request

func (*PullRequest) Init

func (r *PullRequest) Init() error

Init initializes request

func (*PullRequest) Validate

func (r *PullRequest) Validate() error

Validate validates request

type PullResponse

type PullResponse struct {
	*Info
}

PullResponse represents a pull response

type StatusRequest

type StatusRequest struct {
	Source *url.Resource `required:"true"`
	Type   string
}

StatusRequest represents version control status

func (*StatusRequest) Init

func (r *StatusRequest) Init() error

Init initializes request

func (*StatusRequest) Validate

func (r *StatusRequest) Validate() error

Validate validates request

type StatusResponse

type StatusResponse struct {
	*Info
}

StatusResponse represents version control status response

Jump to

Keyboard shortcuts

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